SaveContentMe

H.264, HEVC, VP9 and AV1: choosing a video codec

A SaveContentMe guide · Updated

A codec is not a container

The codec describes how the picture is compressed; the container describes how the tracks are packed into a file. An MP4 can hold H.264, HEVC or AV1 video, a WebM holds VP9 or AV1, and an iPhone MOV holds H.264 or HEVC. That is why two .mp4 files can behave differently: one plays anywhere, the other only on recent devices.

MediaInfo, VLC's codec information window and your file properties all show the codec. The labels can be cryptic: avc1 means H.264, hvc1 and hev1 mean HEVC, vp09 is VP9 and av01 is AV1. When a file refuses to play, look here first, since the usual culprit is a device without support for the codec rather than a damaged file.

H.264 and HEVC

H.264 (AVC) was standardized in 2003 and remains the most compatible choice. Every major browser, phone, TV and editor plays it, and even old devices have hardware decoders for it. The trade-off is size: at the same quality its files are larger than those of newer codecs. For sending to people whose devices you don't know, it is still the safe bet.

HEVC (H.265) arrived in 2013. MDN notes that in theory it can halve the file size of H.264 at comparable quality. iPhone 7 and later record HEVC when Settings, Camera, Formats is set to High Efficiency, while Most Compatible switches recording back to H.264. On Windows, playing HEVC may require the HEVC Video Extensions package from the Microsoft Store.

VP9 and AV1

VP9 is Google's open, royalty-free codec, and MDN describes its quality as comparable to HEVC at similar bitrates. It is common on the web, including YouTube playback in browsers. All major browsers support it, but cameras and editing apps rarely work with it, so you will seldom meet it as a recording or sharing format.

AV1 was released by the Alliance for Open Media in 2018. It is also royalty-free and compresses better than VP9 and HEVC. The catch is speed and support: software AV1 encoding is slow, and only fairly recent devices have hardware decoders. Safari, for example, plays AV1 only where one exists: M3 Macs and later, iPhone 15 Pro, and iPhone 16 and later.

What to pick for the job

Sending a clip to anyone, or uploading somewhere with unknown requirements: H.264 in MP4 with AAC audio. Storing your own footage on Apple devices or recent Android phones: HEVC saves space at comparable quality. Serving video on your own website: AV1 or VP9 with an H.264 fallback, since the browser plays the first listed format it supports.

Long editing projects sometimes use intermediate codecs such as Apple ProRes or DNxHR. The files are huge, but the editor doesn't have to unpack heavy compression, so scrubbing stays smooth. The final version is still exported to H.264, HEVC or AV1.

Converting from one compressed format to another always costs some quality. Re-encoding H.264 to AV1 just to save space only makes sense if the original is gone and storage really is tight. If you still have the original, export the format you need from it and keep the original separately, so you can make a copy in any other codec later.

Sources