The main video codecs in streaming
- H.264 (AVC): plays on practically every device; the universal baseline
- H.265 (HEVC): roughly 40% to 50% smaller than H.264 at the same quality; standard for 4K and HDR; well supported on televisions and Apple devices
- VP9: Google's royalty-free codec, similar in efficiency to H.265; common in Chrome and on Android
- AV1: royalty-free and roughly 30% more efficient than H.265; hardware support growing on newer devices
Audio codecs
- AAC: the standard for streaming audio, supported everywhere
- Dolby Digital and Dolby Digital Plus: surround sound for films and television
- Opus: efficient and royalty-free, used mainly with WebRTC and on the web
Codec vs container
A codec compresses the video. A container, such as MP4 or MKV, is the file format that holds the compressed video, audio and subtitles together. An MP4 file may contain H.264 or H.265; the extension alone does not tell you which.
How to choose
Three things pull against each other: compression efficiency, which lowers delivery cost; device support, which decides who can play it; and encoding cost, which rises steeply with newer codecs. Licensing terms differ too.
The usual answer is more than one. Encode everything in H.264 so that it plays everywhere, and add a more efficient codec for 4K and for your most-watched titles, where the saving in delivery outweighs the extra encoding and storage.
Last reviewed