Understanding Video Formats and Codecs
Why the file extension tells you almost nothing about a video, what H.264, VP9 and AV1 actually do, and which combination plays reliably on which device.
A file that will not play is one of the more frustrating computing experiences, largely because the error message rarely identifies the real problem. The file extension is usually blamed, and it is usually innocent. The distinction between containers and codecs explains nearly every playback failure you are likely to meet.
Containers and codecs
A container is the box. MP4, MKV and WebM are containers: they define how the separate streams inside a file are laid out, how they stay synchronised, and where metadata like titles and chapters live. The extension names the box.
A codec is the compression method applied to the contents. H.264, VP9 and AV1 are video codecs; AAC, Opus and MP3 are audio codecs. The codec determines whether your device can actually decode what is inside.
Two files can both end in .mp4 and be entirely different propositions: one carrying H.264 video that plays on a decade-old phone, the other carrying AV1 that a 2019 laptop cannot decode without stuttering. The extension is the same because the box is the same.
The codecs you will encounter
| Codec | Introduced | Compatibility | Efficiency |
|---|---|---|---|
| H.264 / AVC | 2003 | Essentially universal | Baseline |
| VP9 | 2013 | Broad; standard on the web | ~30% better than H.264 |
| HEVC / H.265 | 2013 | Good on Apple devices, patchy elsewhere | ~40% better than H.264 |
| AV1 | 2018 | Newer devices only | ~50% better than H.264 |
Why efficiency matters
A more efficient codec reaches the same visual quality with a smaller file, or better quality at the same size. AV1 at roughly half the bitrate of H.264 is a substantial saving on storage and bandwidth.
The cost is decoding effort. Devices contain dedicated hardware for common codecs, which decodes video quickly and with very little battery drain. When hardware support is missing, the work falls to the CPU: the video may still play, but the fans spin up, the battery drains noticeably faster, and on weaker hardware the playback stutters. This is why the newest codec is not automatically the right choice.
Containers in common use
- MP4. The safest default. Supported almost everywhere, including televisions, phones and editing software.
- WebM. An open container built for the web, normally holding VP9 or AV1 with Opus audio. Excellent in browsers, less consistent elsewhere.
- MKV. Extremely flexible, holding almost any codec plus multiple audio and subtitle tracks. Well supported by dedicated players such as VLC, poorly supported by phones and smart TVs.
Choosing for compatibility
If a file needs to work on an unknown device, on a smart TV, or inside video editing software, MP4 containing H.264 video and AAC audio remains the most reliable combination available. It is not the most efficient, and it will not be the smallest file, but it is the one that plays.