Video Compression Masterclass: HandBrake & FFmpeg Settings for Flawless Web Playback
High-quality video production often outputs enormous master files—a 10-minute 4K video exported from Adobe Premiere or Final Cut Pro can easily exceed 4 gigabytes. Uploading and streaming raw uncompressed files wastes bandwidth and causes viewer buffering.
In this masterclass, we share the exact FFmpeg commands and HandBrake presets used by professional video engineers to reduce file sizes by up to 80% with zero noticeable loss in visual clarity.
1. Optimal FFmpeg Command for Web Streaming
The following FFmpeg command produces a perfectly balanced, web-optimized MP4 file:
ffmpeg -i input.mov -c:v libx264 -preset slow -crf 22 -c:a aac -b:a 192k -movflags +faststart output.mp4
Parameter Breakdown:
-c:v libx264: Uses the industry-standard H.264 video encoder for universal compatibility.-preset slow: Provides higher compression efficiency for a given file size.-crf 22: Constant Rate Factor. Values between 20 and 23 deliver visually lossless quality while shrinking file size.-movflags +faststart: Moves the MP4 index metadata (moov atom) to the very beginning of the file, allowing playback to start instantly before the entire video finishes downloading.
2. HandBrake Presets for Fast Desktop Compression
If you prefer a graphical user interface, download the free open-source tool HandBrake:
- Format: Select MP4.
- Web Optimized: Check the Web Optimized checkbox (enables
+faststart). - Video Codec: H.264 (x264).
- Framerate: Same as source (Peak Framerate).
- Quality: Set Constant Quality to RF 21–23.
- Audio: AAC Stereo, 192 kbps.