๐ How H.264 MP4 Files Work
A practical guide for video editors, content creators, and anyone who's ever wondered why their video plays on some devices but not others
๐ฆ 1. What Is an H.264 MP4?
At its core, an MP4 is a container โ not a format. Think of it as a shipping box. What actually matters is what you put in that box. The H.264 codec is the contents โ the actual video data. The MP4 container wraps together video (H.264), audio (usually AAC), metadata, and timing information into a single file.
Unlike older formats, H.264 uses inter-frame compression โ it stores most frames as differences from neighboring frames rather than complete pictures. This is why file sizes are small while quality remains high.
โ๏ธ 2. The Four Key Properties of a Good H.264 MP4
Not all H.264 MP4s are created equal. Depending on how they were encoded, they behave very differently when you try to play, edit, or stream them.
๐ฌ H.264 Video โ The Codec Itself
The video compression algorithm. H.264 is a delivery codec โ it's designed for playback, not editing. It uses "long GOP" (Group of Pictures) structure, meaning most frames are stored as differences from neighbors. To show you one frame at an arbitrary point, the player must decode a chunk of surrounding frames. This is why scrubbing gets sluggish compared to editing codecs.
๐ต AAC Audio โ The Soundtrack
Advanced Audio Coding โ the standard audio companion for H.264 video in MP4 files. AAC is a lossy format that compresses audio while preserving perceptual quality. A bitrate of 192kbps at 48kHz is the sweet spot for general use: good quality without bloating file size.
๐ yuv420p โ The "Just Works" Pixel Format
This is the color sampling scheme. yuv420p stores color information at quarter resolution (one color sample for every four brightness samples) and uses 8 bits per channel. Exotic formats (4:4:4, 10-bit, HDR) look better on paper and choke a surprising amount of software. yuv420p is the universal compatibility choice.
โก faststart โ The Streaming Flag
This moves the index (the "moov atom") from the end of the file to the front. Without it, a browser must download the entire file before showing frame one. With it, playback starts immediately. For a website, this is the difference between working and appearing broken.
๐ง The Exact Command Behind All Four
These four properties are not abstractions โ they are literally the flags the converter hands to ffmpeg, running in your browser, on your machine:
ffmpeg -i input \
-c:v libx264 -profile:v high -pix_fmt yuv420p \
-crf 18 -preset medium \
-c:a aac -b:a 192k -ar 48000 \
-movflags +faststart \
output.mp4
-crf is the quality dial, and it runs backwards from what you would expect: lower means better. 16 is visually lossless for practical purposes, 18 is the default and near-transparent, and 20 trades a little detail for a noticeably smaller file. Grainy sources such as VHS captures inflate at any CRF setting, because film grain is random and random data does not compress.
โ 3. Where H.264 MP4 Is Genuinely Better
Universal Hardware Support
H.264 decoding is baked into silicon in every phone, TV, laptop GPU, and browser made in the last ~15 years. Nothing else has that reach. During testing, open-source Chromium builds couldn't decode H.264 at all because of patent licensing โ a stark reminder of how critical hardware support is.
Predictability
When your sources are a zoo โ VHS captures, DVD rips, phone clips with variable frame rates โ normalizing them all into one shape is why editors stop desyncing audio. H.264 MP4 imposes order on chaos.
Streaming Ready
With +faststart, playback begins immediately. No waiting for downloads. No buffering. This is the standard for web video delivery.
โ 4. Where H.264 MP4 Is Genuinely Worse
Generation Loss โ The Big One
H.264 is lossy โ lossy. It decodes your video to raw pixels and re-compresses from scratch, throwing away detail permanently. Converting an already-H.264 MP4 through another encoding pass makes it strictly worse with zero benefit. Same for the audio: re-encoding even if the source was already fine AAC.
Old and Inefficient
H.264 is from 2003. At equal quality:
| Codec | Relative File Size | Plays Everywhere? |
|---|---|---|
| H.264 | 100% | Yes, universally |
| H.265 / HEVC | ~50โ70% | Patchy (Safari โ, Firefox โ) |
| VP9 | ~50โ70% | Browsers โ, editors meh |
| AV1 | ~40โ60% | Newer devices only |
You're paying maybe 30โ50% extra file size for compatibility. For a site people actually visit on random devices, that's a trade worth making.
"Editor-Ready" Is a Bit of a Fib
H.264 is a delivery codec, not an editing codec. True editing codecs (ProRes, DNxHR) store every frame whole โ massive files, buttery scrubbing. H.264 MP4 is the universal choice, not the fastest-to-edit choice.
Silent Data Loss
If you process an MKV with subtitles, commentary tracks, or chapters โ exactly the DVD rip use case โ that metadata disappears unless you explicitly map streams with -map. yuv420p also flattens 10-bit or HDR sources to 8-bit SDR, losing dynamic range.
๐งฉ 5. Vector vs. Raster โ The Video Analogy
Just as PDFs have vector and raster types, video has fundamentally different ways of storing information:
๐งญ Inter-frame (like Vector)
H.264 stores differences between frames. Think of it as "from frame A to frame B, move these pixels this way." Efficient but computationally expensive to decode. Efficient
๐ผ๏ธ Intra-frame (like Raster)
Codecs like ProRes and DNxHR store every frame as a complete image. Like a PDF's vector preservation, this makes editing buttery smooth โ at the cost of enormous file size. Huge files
โ ๏ธ 6. Special-Purpose File Types to Watch Out For
ProRes (Apple)
- Purpose: Professional editing and color grading
- Format: Intra-frame (every frame complete)
- Pros: Buttery scrubbing, retains quality through multiple generations
- Cons: Enormous file size (10 minutes โ 50+ GB)
- When to use: Only during editing โ NOT for delivery
DNxHR (Avid)
- Purpose: Professional editing (industry standard in film/TV)
- Format: Intra-frame
- Pros: Cross-platform, excellent editing performance
- Cons: Still huge files
H.265 / HEVC
- Purpose: Successor to H.264, same quality at half the size
- Pros: Much smaller files for equal quality
- Cons: Patchy support (Safari โ, Firefox โ, older devices struggle)
- When to use: Only if you can guarantee playback environment
MKV / Matroska
- Purpose: Universal container for video, audio, subtitles, chapters
- Pros: Supports everything, open source
- Cons: Not universally supported in browsers (Safari has limited support)
- When to use: Archival, local media players โ NOT web delivery
WebM
- Purpose: Web-optimized video (VP8/VP9 + Vorbis/Opus)
- Pros: Open source, HTML5 standard
- Cons: Limited hardware support, not suitable for professional tools
๐ 7. Quick Reference โ Choosing the Right Format
| Task | Best Format | Why |
|---|---|---|
| Web delivery | H.264 MP4 with faststart | Plays everywhere, hardware decode |
| Professional editing | ProRes or DNxHR | Smooth scrubbing, multi-generation safe |
| Archival preservation | H.265 MKV or H.264 MOV | Good compression, metadata support |
| Mobile delivery | H.264 MP4 | Universal hardware decode |
| Multiple language tracks | MKV with H.264/H.265 | Supports chapters, subtitles, commentary |
| Creating from mixed sources | H.264 MP4 | Normalizes variable frame rates, sources |
๐ Summary
H.264 MP4 is the lingua franca of video delivery because it plays everywhere, with hardware help, and has predictable behavior. It's the universal choice โ not the fastest to edit, and not the most efficient.
For delivery to a broad audience, it's a trade worth making: you pay 30โ50% extra file size for the guarantee that your video will work on any device your audience might use.
For editing, use ProRes or DNxHR. For archival, consider H.265 or MKV with full metadata. For web delivery, H.264 MP4 with +faststart, yuv420p, and AAC audio remains the gold standard. Nothing else has that reach.