Video Bitrates & Compression
H.264 vs H.265 compression, CRF targets, and mobile bitrate optimization.
Understanding Video Bitrates, Resolutions, and Mobile Codec Efficiencies
Video files are inherently large, making video compression critical for mobile delivery. This guide explains the relationship between resolutions, bitrates, frame rates, and codec efficiencies for web playback.
1. The Relationship Between Resolution and Bitrate
Video resolution refers to the pixel grid dimensions (e.g. 1920x1080 for Full HD, 3840x2160 for 4K). Bitrate, measured in Megabits per second (Mbps), defines the amount of data processed per second. While higher resolutions require higher bitrates to maintain visual quality, setting the bitrate too high leads to buffering on mobile connections. Understanding the ideal bitrate-to-resolution ratio prevents bandwidth waste.
2. Temporal and Spatial Compression Principles
Video compression codecs (like H.264, H.265/HEVC, and AV1) compress video using spatial and temporal compression. Spatial compression compresses individual frames (intra-frame), similar to JPEG. Temporal compression (inter-frame) analyzes shifts between consecutive frames, storing only the motion changes (vectors) rather than rendering every pixel in every frame. This explains why static video scenes compress far better than high-motion action scenes.
3. H.264 vs. H.265 HEVC and Next-Gen AV1 Codecs
H.264 (AVC) is the most widely compatible video codec on the web. H.265 (HEVC) provides up to 50% better compression efficiency than H.264, allowing high-quality 4K streaming. However, HEVC has licensing royalty fees. AV1 is an open-source, royalty-free codec developed by the Alliance for Open Media that yields 30% better compression than HEVC. Implementing AV1 on web portals reduces hosting bandwidth significantly, though it requires more CPU power to encode.
4. Mobile Responsiveness and Adaptive Bitrate Streaming
On mobile devices, screen resolutions and network speeds vary constantly. Static video source files can cause buffering or display pixelation. Modern web video systems use Adaptive Bitrate Streaming (ABS) protocols like HLS or DASH. ABS splits video files into short segments and encodes them at different resolutions and bitrates. The player dynamically switches to the highest resolution that the user's connection can handle in real-time, preventing playback stops.
5. Client-Side Video Transcoding and Compression
Using WebAssembly, full FFmpeg libraries can now run directly in browser tabs. This allows users to transcode video formats (like Apple MOV to standard MP4) and adjust video bitrates client-side. The processing takes place locally on the user's computer, eliminating the massive server infrastructure cost and data privacy issues typically associated with video hosting and cloud-based file transcoding platforms.