Constant Rate Factor (CRF)
Also known as: crf encoding, x264 crf, constant rate factor, crf quality
Constant Rate Factor (CRF) is a quality-based encoding mode in **x264**, **x265**, and similar encoders. You set a single quality number and the encoder varies the bitrate to hold that quality, letting the final file size float instead of targeting it directly.
- CRF sets a quality target and lets the encoder vary bitrate to meet it; size is a result, not a target.
- On the x264/x265 0-51 scale, lower is higher quality; defaults are 23 (x264) and 28 (x265).
- Raising CRF by about 6 roughly halves the output file size.
How the CRF scale works
Instead of asking for a bitrate, CRF asks for a perceptual quality target. In x264 and x265 the scale runs 0 to 51, where lower means higher quality and larger files. Roughly 18 is visually near-lossless, the default is 23 (28 for x265), and values in the high 20s and above trade visible quality for much smaller files. Each step of about +6 roughly halves the resulting size.
CRF is a form of variable bitrate: the encoder spends whatever bits each scene needs to meet the quality target, so a still scene stays small and a busy one grows. The key difference from a bitrate target is that you fix quality and let size vary, rather than fixing size and letting quality vary.
Using CRF to control file size
Because CRF sets quality rather than size, the practical workflow for shrinking a video is to nudge the CRF value up a few points and re-encode. Going from 23 to 28, for example, typically cuts a clip's size substantially while keeping it perfectly watchable on a phone screen. This is the quality knob behind most one-tap video compressors.
A tool like Cleanor's video compressor leans on exactly this: it re-encodes large recordings at a higher CRF (and optionally lower resolution) so big camera-roll clips reclaim storage without the blockiness of a hard low-bitrate cap. CRF gives a more consistent look than chasing a fixed megabyte target.