Choosing a video codec means balancing four factors: compression efficiency, device compatibility, the computational cost of encoding and licensing terms. No codec wins on every front, which is why all four coexist in the real world.
H.264 / AVC: the universal standard
H.264 was standardised in the early 2000s and is still the most compatible codec of all. Practically every smartphone, TV, browser and computer from the last fifteen years decodes it in hardware.
Strengths: - near-total compatibility; - fast encoding, even in real time on modest hardware; - mature, well-optimised software encoders such as x264.
Weaknesses: - at equal quality it produces larger files than its successors; - it is covered by patents managed through licensing pools.
It is the right choice when the video has to work everywhere without surprises.
H.265 / HEVC: more efficient, more complicated
HEVC is the direct successor of H.264. It introduces larger, more flexible coding blocks and more refined prediction tools, achieving a significant bitrate saving at equal perceived quality, often quoted at around 40-50% in favourable conditions.
Strengths: - very efficient, especially at high resolution; - broad hardware support on recent devices; - widely used for 4K and HDR on discs, TVs and platforms.
Weaknesses: - licensing fragmented across several pools, which slowed its adoption in browsers; - software encoding noticeably slower than H.264.
It is very common in consumer devices and smartphone recordings, less so on the open web.
VP9: Google's alternative
VP9 was developed by Google as a royalty-free codec. Its efficiency is comparable to HEVC and YouTube adopted it on a massive scale.
Strengths: - no declared licensing fee; - good support in Chromium-based browsers and Firefox; - hardware decoding on many Android devices and smart TVs.
Weaknesses: - historically weaker support in the Apple ecosystem; - slow reference encoder, with a less favourable quality-to-time ratio than x265.
AV1: the next-generation open codec
AV1 was developed by the Alliance for Open Media, a consortium that includes major technology and streaming companies. It is designed to be royalty-free and more efficient than HEVC and VP9.
Strengths: - higher efficiency than HEVC and VP9 in most public tests; - open licensing model; - support in all major browsers and hardware decoding in the latest generations of GPUs, smartphones and TVs.
Weaknesses: - very slow software encoding at the highest-quality settings; - older devices lack hardware decoding and must rely on software, with higher battery drain.
Encoders such as SVT-AV1 have made encoding far more practical than in the early days, offering presets that trade speed for quality gradually.
Comparison table
| H.264 | HEVC | VP9 | AV1 | |
|---|---|---|---|---|
| Efficiency | baseline | high | high | very high |
| Compatibility | universal | wide, weak on the web | good on the web | growing |
| Encoding speed | high | medium | low | low-medium |
| Licensing | pooled patents | patents in several pools | royalty-free | royalty-free |
The values are indicative: the real difference depends on the encoder, the settings and the type of content.
Content type matters
A codec's efficiency is not a fixed number. On static video, such as a lecture with one slide and a speaker, every codec produces small files and the absolute difference in megabytes is modest. On difficult content, such as sport, moving water, confetti or film grain, the newer codecs show their advantage, because they have better tools to describe complex motion and, in AV1's case, also grain synthesis, which avoids encoding grain pixel by pixel.
How to choose in practice
- Video sent to anyone, without knowing what it will be opened on: H.264.
- Personal archive of 4K recordings to watch on the home TV: HEVC, if the TV supports it.
- Video published on your own site with an eye on bandwidth: AV1 with an H.264 fallback.
- Platform with large viewing volumes: several codecs in parallel, serving each device the best one it can decode.
The last point is what the big streaming services do: they encode the same content several times and the player picks the right variant. The extra encoding cost pays for itself in bandwidth saved over millions of plays.
A common mistake
Re-encoding an H.264 file to HEVC or AV1 «to save space» never improves quality: the re-encode starts from an already compressed file and inherits its flaws, adding new ones. It only makes sense if space is genuinely a problem and you accept a small loss. Whenever possible, always encode from the original master.
In short
- H.264 guarantees maximum compatibility and is fast to encode.
- HEVC is efficient and widespread on devices, but has complex licensing.
- VP9 and AV1 are royalty-free; AV1 is the most efficient but the slowest to encode.
- The advantage of modern codecs grows with complex content and high resolutions.
- Always encode from the master, not from an already compressed file.