What Is CRF (Constant Rate Factor)?
CRF is the primary quality control in modern video encoders like x264 (H.264) and x265 (H.265). It's a single number that tells the encoder: "I want this level of quality — use whatever bitrate is needed to achieve it."
Unlike fixed-bitrate encoding, CRF dynamically adjusts the bitrate for each frame based on scene complexity. High-motion action scenes receive more bits (larger data). Static talking-head scenes receive fewer bits (smaller data). The result is optimal quality-to-size ratio without manual bitrate tuning.
How CRF Works
The encoder processes each frame and asks: "How many bits do I need to achieve CRF X quality for this specific frame?" The answer varies dramatically:
- A frame of fast-paced action with explosions might need 500 KB
- A frame of a static title card might need 5 KB
- A frame of talking heads with a blurred background might need 50 KB
CRF produces variable bitrate (VBR) output — the bitrate fluctuates throughout the video. This is fundamentally more efficient than constant bitrate (CBR), which wastes bits on simple scenes and starves complex ones.
CRF Scale for H.264 / H.265
For H.264 (libx264), CRF ranges from 0 to 51. Lower values mean higher quality and larger files:
| CRF Value | Quality Level | Typical Use Case | File Size (1 min 1080p) |
|---|---|---|---|
| 0 | Lossless (mathematically perfect) | Intermediate editing, archival masters | ~2–5 GB |
| 18 | Visually transparent | High-quality archival, source preservation | ~120 MB |
| 23 | Excellent (default) | General use, web, sharing | ~60 MB |
| 28 | Good (some visible loss) | Smaller files, mobile, email | ~30 MB |
| 33 | Acceptable (noticeable artifacts) | Previews, thumbnails, low-priority | ~15 MB |
| 40+ | Poor (heavy compression) | Not recommended | <10 MB |
For H.265 (libx265), the scale is the same (0–51) but equivalent quality requires higher CRF values. H.264 CRF 23 roughly equals H.265 CRF 28.
Rule of thumb: Every +6 CRF roughly doubles file size (or halves it). Going from CRF 23 to CRF 17 approximately doubles the file, while going from CRF 23 to CRF 29 approximately halves it.
CRF Scale for VP9
VP9 (libvpx-vp9) uses a different CRF range: 0 to 63. The principle is the same (lower = better), but the numbers are not directly comparable to H.264:
- CRF 15–20: High quality, large files
- CRF 30: Good quality, our default (roughly equivalent to H.264 CRF 23)
- CRF 35–45: Smaller files, some quality loss
VP9 at CRF 30 typically produces files 30–50% smaller than H.264 at CRF 23 with equivalent visual quality. This is because VP9 is a more efficient codec, not because of the CRF number.
CRF vs CBR vs VBR
Three main approaches to controlling video bitrate:
| Method | How It Works | Best For | Drawback |
|---|---|---|---|
| CRF | Constant quality, variable bitrate | File conversion, archival, general use | Unpredictable file size |
| CBR | Constant bitrate, variable quality | Live streaming, strict bandwidth | Wastes bits on simple scenes |
| VBR | Target bitrate, variable around it | Two-pass encoding, predictable size | Needs target bitrate estimation |
For file conversion (MKV to MP4, MOV to MP4, etc.), CRF is always the best choice. It produces the optimal quality-to-size ratio without requiring you to guess at a target bitrate.
Practical File Size Examples
The same 1-minute 1080p video at different CRF values (H.264, medium preset):
- CRF 18: ~120 MB — visually perfect, 2x the default size
- CRF 20: ~85 MB — excellent quality, slightly above default
- CRF 23: ~60 MB — our default, imperceptible quality loss
- CRF 26: ~40 MB — still very good, noticeable only in demanding scenes
- CRF 28: ~30 MB — good quality, visible loss in gradients and fine detail
- CRF 33: ~15 MB — acceptable, artifacts visible in motion
These numbers vary significantly based on content complexity. Action movies produce larger files than screencasts at any CRF level.
Our Converter Settings
Our converter uses these quality settings:
- MP4 output: H.264, CRF 23, medium preset, AAC 192k audio
- WebM output: VP9, CRF 30, cpu-used 3, Opus 128k audio
CRF 23 was chosen because it provides the optimal balance: visually indistinguishable from the original for 99% of content, with reasonable file sizes suitable for sharing, uploading, and streaming.
Below CRF 18: You're storing bits that no human eye can perceive. File size grows exponentially while visual quality flatlines. CRF 0 (lossless) is 10–50x larger than CRF 23 — reserved for professional editing masters, never for delivery.