VP9 Encoding Modes
Constant Quality (CRF + b:v 0)
Our recommended approach for file conversion. Set a quality target with CRF and let the encoder decide the bitrate per frame. The -b:v 0 flag is required to enable pure CRF mode (otherwise FFmpeg applies a default bitrate cap).
Command: ffmpeg -i input.mp4 -c:v libvpx-vp9 -crf 30 -b:v 0 output.webm
Constrained Quality (CRF + bitrate cap)
Combines CRF quality targeting with a maximum bitrate. Useful for streaming where you need to stay within bandwidth limits while maintaining quality.
Command: ffmpeg -i input.mp4 -c:v libvpx-vp9 -crf 30 -b:v 2M output.webm
Variable Bitrate (VBR)
Target a specific average bitrate. Used for broadcast and streaming where bandwidth must be predictable.
Command: ffmpeg -i input.mp4 -c:v libvpx-vp9 -b:v 2M output.webm
CRF Values for VP9
VP9's CRF scale ranges from 0 (lossless) to 63 (worst quality). Higher numbers mean more compression and lower quality.
| CRF Range | Quality | Use Case |
|---|---|---|
| 0 | Lossless | Archival (huge files) |
| 15–20 | High quality | Master copies, high-quality delivery |
| 30–35 | Good balance (default) | Web delivery, general use |
| 40–50 | Lower quality | Previews, thumbnails |
| 50–63 | Poor quality | Rarely useful |
Our default is CRF 30, which produces roughly equivalent visual quality to H.264 CRF 23 at 30–50% smaller file sizes.
Speed Settings (cpu-used)
The cpu-used parameter controls encoding speed vs compression efficiency. Range: 0–8.
| cpu-used | Relative Speed | Compression Penalty | Use Case |
|---|---|---|---|
| 0 | 1x (baseline) | None (best) | Offline batch processing |
| 1 | ~2x | ~2% | High-quality encoding |
| 3 | ~8x | ~5% | Online converters (our setting) |
| 5 | ~15x | ~10% | Quick previews |
| 8 | ~30x | ~20% | Real-time / lowest latency |
Multithreading (row-mt)
The -row-mt 1 flag enables row-based multithreading, which can provide 2–4x speedup on multi-core systems with no quality impact. This is a pure speed gain and should always be enabled.
Audio: Opus Settings
WebM pairs VP9 video with Opus audio, which is superior to AAC at equivalent bitrates:
- 64 kbps: good for speech and podcasts
- 128 kbps: transparent for most content (our default)
- 192 kbps: high quality for music
Two-Pass vs Single-Pass
Single-pass CRF (our approach) produces the optimal quality-to-size ratio for file conversion. The encoder adjusts bitrate per frame based on complexity, resulting in the best possible quality at the target CRF.
Two-pass encoding is needed only when you must hit a specific target bitrate (streaming, broadcast). First pass analyzes content, second pass encodes with optimal bit allocation.
Our Converter's VP9 Pipeline
The complete FFmpeg command our converter uses:
ffmpeg -i input.mp4 -c:v libvpx-vp9 -crf 30 -b:v 0 -cpu-used 3 -row-mt 1 -c:a libopus -b:a 128k output.webm
Flag by flag:
-c:v libvpx-vp9— use VP9 video codec-crf 30— quality target (equivalent to H.264 CRF 23)-b:v 0— pure CRF mode, no bitrate cap-cpu-used 3— balanced speed for online conversion-row-mt 1— row-based multithreading for faster encoding-c:a libopus— Opus audio codec-b:a 128k— transparent audio quality
Google's Recommended Settings by Resolution
| Resolution | Suggested CRF | Target Bitrate (VBR) |
|---|---|---|
| 360p | 36–40 | 200–400 kbps |
| 480p | 33–36 | 500–900 kbps |
| 720p | 30–33 | 1–2 Mbps |
| 1080p | 28–32 | 2–4 Mbps |
| 2160p (4K) | 25–30 | 8–16 Mbps |