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 Formats

ContainerExtensionCommon CodecsUse Case
MP4 (MPEG-4).mp4, .m4vH.264, H.265, AV1Universal playback
WebM.webmVP8, VP9, AV1Web streaming
MKV (Matroska).mkvAny codecArchival, multi-track
MOV (QuickTime).movH.264, ProResApple ecosystem, editing
AVI.aviVariousLegacy format
OGG.ogvTheoraOpen source (legacy)
FLV.flvH.264, VP6Legacy Flash video
3GP.3gpH.263, H.264Mobile (legacy)
TS (MPEG-TS).tsH.264, H.265Broadcast, HLS streaming
FMP4.mp4 (fragmented)H.264, H.265Adaptive streaming (DASH)

Video Codecs Comparison

CodecQualityCompressionSpeed (encode)Browser SupportLicense
H.264 (AVC)GoodGoodFastUniversalLicensed (free for web)
H.265 (HEVC)Very good~50% better than H.264ModerateSafari, partial othersLicensed (royalties)
VP9Very good~30-50% better than H.264SlowChrome, Firefox, EdgeRoyalty-free
AV1Excellent~30% better than VP9Very slowChrome, Firefox, Edge, Safari 17+Royalty-free
VP8GoodSimilar to H.264FastChrome, Firefox, EdgeRoyalty-free
ProResExcellentLow (editing codec)FastSafari, macOSApple proprietary
H.266 (VVC)Best~50% better than H.265Very slowNot yetLicensed

Browser Support

FormatChromeFirefoxSafariEdge
MP4 + H.264YesYesYesYes
MP4 + H.265Hardware onlyNoYesHardware only
WebM + VP9YesYesYes (14+)Yes
WebM + AV1YesYesYes (17+)Yes
OGG + TheoraYesYesNoYes

Streaming Protocols

ProtocolFormatUse Case
HLSTS or fMP4 segmentsApple ecosystem, broad support
DASHfMP4 segmentsAdaptive bitrate streaming
CMAFfMP4Unified HLS/DASH
RTMPFLVLive ingest (legacy)
WebRTCVP8/VP9/H.264Real-time communication
SRTTSSecure reliable transport

Resolution Reference

NameResolutionAspect RatioCommon Use
480p (SD)854x48016:9Mobile, low bandwidth
720p (HD)1280x72016:9Standard web
1080p (Full HD)1920x108016:9Standard quality
1440p (2K)2560x144016:9High quality
2160p (4K UHD)3840x216016:9Ultra high quality
4320p (8K)7680x432016:9Maximum quality

Web Video Best Practices

  1. Primary format: MP4 with H.264 for maximum compatibility
  2. Modern browsers: WebM with VP9 or AV1 for better compression
  3. Adaptive streaming: Use HLS or DASH for varying network conditions
  4. 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>

Encoding Tools

ToolTypeStrengths
FFmpegCLIUniversal, all formats and codecs
HandBrakeGUI/CLIUser-friendly transcoding
x264/x265CLI libraryHigh-quality H.264/H.265
libaom / SVT-AV1CLI libraryAV1 encoding
libvpxCLI libraryVP8/VP9 encoding
MediaInfoCLI/GUIFormat inspection