Media
Video Formats Reference
Video formats comparison - codecs, containers, quality, browser support, and use cases for MP4, WebM, AV1, and more.
Overview
Video formats consist of two components: the container (file format) and the codec (compression algorithm). The container holds video, audio, and metadata, while the codec determines how the video data is compressed and decompressed. Choosing the right combination affects quality, file size, and compatibility.
| Container | Extension | Common Codecs | Use Case |
|---|
| MP4 (MPEG-4) | .mp4, .m4v | H.264, H.265, AV1 | Universal playback |
| WebM | .webm | VP8, VP9, AV1 | Web streaming |
| MKV (Matroska) | .mkv | Any codec | Archival, multi-track |
| MOV (QuickTime) | .mov | H.264, ProRes | Apple ecosystem, editing |
| AVI | .avi | Various | Legacy format |
| OGG | .ogv | Theora | Open source (legacy) |
| FLV | .flv | H.264, VP6 | Legacy Flash video |
| 3GP | .3gp | H.263, H.264 | Mobile (legacy) |
| TS (MPEG-TS) | .ts | H.264, H.265 | Broadcast, HLS streaming |
| FMP4 | .mp4 (fragmented) | H.264, H.265 | Adaptive streaming (DASH) |
Video Codecs Comparison
| Codec | Quality | Compression | Speed (encode) | Browser Support | License |
|---|
| H.264 (AVC) | Good | Good | Fast | Universal | Licensed (free for web) |
| H.265 (HEVC) | Very good | ~50% better than H.264 | Moderate | Safari, partial others | Licensed (royalties) |
| VP9 | Very good | ~30-50% better than H.264 | Slow | Chrome, Firefox, Edge | Royalty-free |
| AV1 | Excellent | ~30% better than VP9 | Very slow | Chrome, Firefox, Edge, Safari 17+ | Royalty-free |
| VP8 | Good | Similar to H.264 | Fast | Chrome, Firefox, Edge | Royalty-free |
| ProRes | Excellent | Low (editing codec) | Fast | Safari, macOS | Apple proprietary |
| H.266 (VVC) | Best | ~50% better than H.265 | Very slow | Not yet | Licensed |
Browser Support
| Format | Chrome | Firefox | Safari | Edge |
|---|
| MP4 + H.264 | Yes | Yes | Yes | Yes |
| MP4 + H.265 | Hardware only | No | Yes | Hardware only |
| WebM + VP9 | Yes | Yes | Yes (14+) | Yes |
| WebM + AV1 | Yes | Yes | Yes (17+) | Yes |
| OGG + Theora | Yes | Yes | No | Yes |
Streaming Protocols
| Protocol | Format | Use Case |
|---|
| HLS | TS or fMP4 segments | Apple ecosystem, broad support |
| DASH | fMP4 segments | Adaptive bitrate streaming |
| CMAF | fMP4 | Unified HLS/DASH |
| RTMP | FLV | Live ingest (legacy) |
| WebRTC | VP8/VP9/H.264 | Real-time communication |
| SRT | TS | Secure reliable transport |
Resolution Reference
| Name | Resolution | Aspect Ratio | Common Use |
|---|
| 480p (SD) | 854x480 | 16:9 | Mobile, low bandwidth |
| 720p (HD) | 1280x720 | 16:9 | Standard web |
| 1080p (Full HD) | 1920x1080 | 16:9 | Standard quality |
| 1440p (2K) | 2560x1440 | 16:9 | High quality |
| 2160p (4K UHD) | 3840x2160 | 16:9 | Ultra high quality |
| 4320p (8K) | 7680x4320 | 16:9 | Maximum quality |
Web Video Best Practices
- Primary format: MP4 with H.264 for maximum compatibility
- Modern browsers: WebM with VP9 or AV1 for better compression
- Adaptive streaming: Use HLS or DASH for varying network conditions
- Fallback: Always provide H.264 MP4 as the baseline format
<video controls>
<source src="video.webm" type="video/webm; codecs=av01.0.05M.08" />
<source src="video.webm" type="video/webm; codecs=vp9" />
<source src="video.mp4" type="video/mp4" />
</video>
| Tool | Type | Strengths |
|---|
| FFmpeg | CLI | Universal, all formats and codecs |
| HandBrake | GUI/CLI | User-friendly transcoding |
| x264/x265 | CLI library | High-quality H.264/H.265 |
| libaom / SVT-AV1 | CLI library | AV1 encoding |
| libvpx | CLI library | VP8/VP9 encoding |
| MediaInfo | CLI/GUI | Format inspection |