Video Codecs Cheat Sheet — H.264 vs H.265 vs VP9 vs AV1 (2025)
A printable reference for choosing the right video codec. Covers compression efficiency, encoding speed, hardware support, licensing, and platform compatibility.
Video Codecs Comparison Table
| Feature | H.264 (AVC) | H.265 (HEVC) | VP9 | AV1 | |---------|-------------|--------------|-----|-----| | Released | 2003 | 2013 | 2013 | 2018 | | Compression | Baseline | ~50% better | ~30% better | ~50% better | | File size (1080p/min) | ~15 MB | ~8 MB | ~10 MB | ~7 MB | | Encoding speed | Fast | Moderate | Slow | Very slow | | Decoding speed | Very fast | Fast | Moderate | Moderate | | Hardware decode | Universal | Newer devices | Chrome/Android | Newest only | | Licensing | Patent pool | Patent pool | Royalty-free | Royalty-free | | Container | MP4, MKV | MP4, MKV | WebM, MKV | MP4, WebM, MKV | | Best for | Universal | Apple/mobile | Web (Google) | Future standard |
Browser Support
| Codec | Chrome | Firefox | Safari | Edge | |-------|--------|---------|--------|------| | H.264 | ✅ | ✅ | ✅ | ✅ | | H.265 | ⚠️ HW only | ❌ | ✅ | ⚠️ HW only | | VP9 | ✅ | ✅ | ✅ 14.1+ | ✅ | | AV1 | ✅ 70+ | ✅ 67+ | ✅ 17+ | ✅ 79+ |
Download sample MP4 files (H.264 + H.265), MKV files (H.264/H.265/VP9), and WebM files (VP9/AV1).
When to Use Each Codec
- Universal compatibility → H.264 in MP4 → sample MP4
- Apple ecosystem → H.265 in MP4 (iPhones encode natively)
- Web streaming → VP9 in WebM (Google/YouTube) → sample WebM
- Best compression → AV1 (if you can afford slow encoding)
- Archival / Plex → H.265 in MKV → sample MKV
Container Formats
| Container | Video Codecs | Audio Codecs | Subtitles | Browser | |-----------|-------------|-------------|-----------|---------| | MP4 | H.264, H.265, AV1 | AAC, AC3 | Limited | All | | MKV | Any | Any | SRT, ASS, PGS | None | | WebM | VP8, VP9, AV1 | Vorbis, Opus | WebVTT | Chrome/Firefox | | MOV | H.264, H.265, ProRes | AAC, PCM | Limited | Safari | | AVI | DivX, H.264 | MP3, PCM | None | None |
FFmpeg Quick Reference
# H.264 encoding (universal)
ffmpeg -i input.mov -c:v libx264 -crf 23 -c:a aac output.mp4
# H.265 encoding (50% smaller)
ffmpeg -i input.mov -c:v libx265 -crf 28 -c:a aac output.mp4
# VP9 encoding (royalty-free)
ffmpeg -i input.mov -c:v libvpx-vp9 -crf 30 -b:v 0 -c:a libopus output.webm
# AV1 encoding (best compression, slow)
ffmpeg -i input.mov -c:v libaom-av1 -crf 30 -c:a libopus output.webm
# Remux MKV to MP4 (instant, no re-encoding)
ffmpeg -i input.mkv -c copy output.mp4
Quality vs File Size vs Speed
For the same visual quality at 1080p30:
| Codec | File Size | Encode Time | Decode CPU | |-------|-----------|-------------|------------| | H.264 CRF 23 | 100% (baseline) | 1x | Very low | | H.265 CRF 28 | ~50% | 3-5x | Low | | VP9 CRF 30 | ~65% | 5-10x | Moderate | | AV1 CRF 30 | ~45% | 20-50x | Moderate |
Decision Flowchart
- Needs to play everywhere? → H.264 in MP4
- Web-only, Chrome/Firefox? → VP9 in WebM
- Apple devices primary? → H.265 in MP4
- Smallest possible, time not an issue? → AV1
- Archival with multiple audio/subs? → H.265 in MKV