Video Codecs, Bitrate Allocation & Streaming Compression Runbook
Comprehensive engineering guide to modern video compression codecs (H.264 AVC, H.265 HEVC, VP9, AV1), rate control modes (CRF, VBR, CBR), audio encoding overhead, and optimal upload bitrate formulas for streaming platforms and social media.
1. Codec Generations: AVC, HEVC, VP9 & AV1 Compared
ffprobe -v error -select_streams v:0 -show_entries stream=codec_name,profile,width,height,bit_rate,r_frame_rate -of json input.mp4Extracts video codec name, compression profile, dimensions, target bitrate, and framerate in structured JSON.
| Codec / Standard | Efficiency vs H.264 | Primary Adoption & Platform Support | Hardware Decoding Support | Copy |
|---|---|---|---|---|
| H.264 / AVC (x264) | Baseline (0% reduction). Highest compatibility across all legacy browsers, game consoles, and smart TVs. | Universal Legacy Standard | 100% universal hardware support across all modern CPU/GPUs. | |
| H.265 / HEVC (x265) | ~40-45% bitrate reduction vs H.264 at equivalent visual quality. Royalty-encumbered. | Apple iOS / 4K Broadcast | Native Apple Silicon, Intel Gen 7+, NVIDIA GTX 960+. Limited browser support on Chrome/Firefox. | |
| VP9 (libvpx-vp9) | ~35-40% bitrate reduction vs H.264. Open-source Google standard used across YouTube 1440p/4K. | Web & YouTube Ingestion | Universal support across modern Chromium browsers, Android, and Apple Safari (macOS/iOS 14+). | |
| AV1 (libsvtav1) | ~50-55% bitrate reduction vs H.264, ~20-25% vs HEVC. Royalty-free Alliance for Open Media standard. | Next-Gen Streaming Standard | NVIDIA RTX 30/40, AMD RDNA2+, Apple M3+, Intel Arc, Android 14+ flagships. |
2. Rate Control Modes: CRF vs 2-Pass VBR vs CBR
ffmpeg -i master_input.mov -c:v libsvtav1 -preset 5 -crf 26 -g 120 -c:a libopus -b:a 128k -movflags +faststart output_av1.mp4Encodes visually lossless AV1 video with keyframe intervals tuned for web seeking (g=120) and Opus audio.
# Pass 1 (Generate statistics log)
ffmpeg -y -i input.mp4 -c:v libx264 -b:v 4500k -pass 1 -an -f null /dev/null
# Pass 2 (Execute optimal allocation)
ffmpeg -i input.mp4 -c:v libx264 -b:v 4500k -pass 2 -c:a aac -b:a 192k -movflags +faststart output.mp4Precisely controls maximum output file size to satisfy strict email, Discord, or platform upload limits.
3. Video Bitrate Allocation & File Size Mathematics
| Target Resolution & Framerate | Platform Recommended Bitrate (H.264) | Recommended Bitrate (AV1 / HEVC) | File Size (10-Minute Video) | Copy |
|---|---|---|---|---|
| 4K UHD (2160p, 60fps) | 45,000 - 68,000 kbps (YouTube recommended) | 25,000 - 35,000 kbps | ~3.4 GB (H.264) / ~1.9 GB (AV1) | |
| 1440p QHD (60fps) | 24,000 - 30,000 kbps | 14,000 - 18,000 kbps | ~1.8 GB (H.264) / ~1.1 GB (AV1) | |
| 1080p FHD (60fps High-Motion) | 12,000 - 15,000 kbps (Twitch/YouTube) | 6,000 - 8,000 kbps | ~900 MB (H.264) / ~480 MB (AV1) | |
| 1080p FHD (30fps Standard) | 8,000 - 10,000 kbps (TikTok / Reels) | 4,000 - 5,500 kbps | ~600 MB (H.264) / ~320 MB (AV1) | |
| 720p HD (30fps Web/LMS) | 3,000 - 5,000 kbps | 1,500 - 2,500 kbps | ~250 MB (H.264) / ~130 MB (AV1) |
4. Production FFmpeg Compression Recipes
ffmpeg -i input.mov -c:v libx264 -preset slow -crf 20 -filter:a loudnorm=I=-14:LRA=7:tp=-1.5 -c:a aac -b:a 192k -movflags +faststart web_ready.mp4Normalizes dynamic audio range to ITU-R BS.1770 / EBU R128 standards for YouTube and podcast publishing.
ffmpeg -ss 00:01:30 -to 00:04:15 -i source.mp4 -c copy -avoid_negative_ts make_zero trimmed_clip.mp4Cuts video losslessly without generational re-encoding by copying existing stream packets between I-frames.
Related Free Online Tools
Put these techniques into practice immediately with our privacy-first browser utilities:
Calculate optimal video upload bitrates, audio overhead, and file size estimates across resolutions.
Preview vertical 9:16 videos against TikTok, Reels, and Shorts UI overlays.
Generate timestamped share links, short URLs, and responsive privacy-enhanced embeds.