Video Optimization for Web Delivery
Beginnerv1.0.0
Optimize video files for web delivery with FFmpeg — H.264/H.265 encoding, CRF quality tuning, faststart for progressive download, and multi-resolution adaptive streaming.
Content
Overview
Web video must balance quality, file size, and compatibility. FFmpeg provides precise control over encoding parameters to produce videos that load fast, play smoothly, and look great across all browsers and devices.
Why This Matters
- -Load time — optimized video starts playing 2-5x faster
- -Bandwidth — CRF encoding reduces file size 30-60% vs default
- -Compatibility — correct settings ensure playback on all devices
- -SEO — Google Core Web Vitals penalize slow-loading media
How It Works
Step 1: Basic Web-Ready Encoding
Step 2: Resolution Variants for Responsive Video
Step 3: HLS Streaming (Adaptive Bitrate)
Step 4: Two-Pass Encoding (Maximum Quality)
CRF Quality Guide
| CRF Value | Quality | Use Case |
|---|---|---|
| 18 | Visually lossless | Archive, source masters |
| 20 | Excellent | Portfolio, hero videos |
| 23 | Good (default) | General web content |
| 26 | Acceptable | Background video, thumbnails |
| 28+ | Noticeable loss | Preview, low-bandwidth |
Best Practices
- -Always use
-movflags +faststartfor web video (enables progressive download) - -Use
-pix_fmt yuv420pfor maximum browser compatibility - -Set
-profile:v high -level 4.1for broad device support - -Test on mobile devices — they have the tightest constraints
- -Use CRF encoding unless you need a specific file size
Common Mistakes
- -Missing
-movflags +faststart(video must fully download before playing) - -Wrong pixel format (
yuv444pdoesn't play in most browsers) - -Using CBR for non-streaming content (wastes bandwidth on static scenes)
- -Encoding at source resolution without downscaling (unnecessary for web)
- -Not testing on Safari/iOS (strictest codec requirements)
FAQ
Discussion
Loading comments...