Guide
The right CRF depends on the video. Using this site's measurements, we look at how CRF relates to VMAF for each codec and how static and complex footage differ, then lay out a start, preview, adjust routine for finding the CRF for your own video.
CRF is a target-quality setting you give the encoder: lower means higher quality and a bigger file. The quality you actually get depends on the content. At the same x264 CRF 26, riverbed came out at 14,654.1 kbps (VMAF 95.24) and rush_hour at 2,954.7 kbps (VMAF 88.42). The bitrates differ by 4.96x, yet riverbed had the higher quality (file size and quality by content type).
Raising CRF shrinks the file, but how fast quality drops also varies by video. Going from x264 CRF 26 to 30, a step of 4, cut the bitrate to 1/1.59–1/1.73 of the original (about 58–63%) on all four clips. The VMAF drop, though, varied widely: 1.7 points for blue_sky, 7.9 for rush_hour, 8.3 for pedestrian_area and 13.9 for riverbed. The same 4-step increase can be nearly free on one video and visibly worse on another.
The table below shows the CRF at which the encode reaches VMAF 95 and 90. The measured CRFs are 4–6 apart, so these are estimates interpolated linearly between them (the method is in the measurement write-up). blue_sky is a simple scene of sky and tree branches, while riverbed is a complex scene with ripples constantly moving.
| Clip (95 / 90) | x264 medium | x265 medium | SVT-AV1 preset 8 |
|---|---|---|---|
| blue_sky | 31.5 / 33.9 | 32.4 / 34.8 | 57.0 / 59.9 |
| pedestrian_area | 24.0 / 27.2 | 24.9 / 28.4 | 36.1 / 43.1 |
| riverbed | 26.1 / 27.5 | 24.8 / 26.6 | 37.6 / 41.1 |
| rush_hour | 20.5 / 24.8 | 20.5 / 25.1 | 25.0 / 33.7 |
We took the most conservative value that kept all four clips at VMAF 90 or above as the starting point. These are directly measured values, not interpolated. For these clips that was x264 22, x265 24 and SVT-AV1 (preset 8) 30. FFmpeg’s defaults are known to be x264 23 and x265 28, but in this site’s measurements x265 at 28 gave VMAF 86.40 on riverbed and 85.76 on rush_hour.
| Codec · starting CRF | blue_sky | pedestrian_area | riverbed | rush_hour |
|---|---|---|---|---|
| x264 medium · 22 | 99.976 | 97.507 | 99.945 | 93.692 |
| x265 medium · 24 | 99.973 | 96.268 | 97.005 | 91.635 |
| SVT-AV1 8 · 30 | 99.978 | 97.815 | 99.951 | 92.748 |
The numbers in the table are mean VMAF. The starting point errs on the safe side, keeping even the hardest clip above 90, so easy footage ends up with bytes to spare. How much higher you can go from here depends on the video. In the measured range, the highest CRF that still held VMAF 90 was 26–30 for x264 (22 for rush_hour) and 30–58 for SVT-AV1. That range is not necessarily the value for your video.
ffmpeg -ss 60 -t 20 -i input.mp4 -c:v libx264 -preset medium -crf 22 -an test22.mp4No single number fits every video. In this site's measurements, the most conservative values that kept all four clips at VMAF 90 or above were x264 22, x265 24 and SVT-AV1 (preset 8) 30, and we use those as starting points. We suggest previewing a short section of your own video, then raising CRF in steps of about 4 and adjusting.
No. At the same x264 CRF 26, riverbed came out at 14,654.1 kbps (VMAF 95.24) and rush_hour at 2,954.7 kbps (VMAF 88.42). The bitrates differ by 4.96x, yet riverbed had the higher quality. CRF is not a quality score; it is a target-quality setting you give the encoder.
No. Each codec has its own CRF scale. The estimated CRF that reaches VMAF 95 was 20.5–31.5 for x264 medium and 25.0–57.0 for SVT-AV1 preset 8, so SVT-AV1's numbers are much larger and spread more widely across clips. Using x264's 22 on SVT-AV1 means something different.
Treat it as a rough guide only. For x264 and x265, a +6 step left about 40–47% of the size on average across the whole range, but individual steps ranged from 26% to 58%. For SVT-AV1 and VP9, the same +6 converted to only about 57–67%.
Not on easy footage. blue_sky scored VMAF 99.9 or higher at every x264 CRF from 18 to 26, yet the file size differed by about 4.1x, from 17,217,871 B to 4,152,541 B. In that range, lowering CRF left the score unchanged and only made the file bigger.