Guide

How to Pick a CRF Value: Starting Points and Adjustments for x264, x265 and SVT-AV1

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.

The short answer

  • No single CRF value fits every video. In this site’s measurements, the x264 CRF that reaches VMAF 95 was about 20.5 for rush_hour and about 31.5 for blue_sky, a gap of nearly 11.
  • So we suggest this order: pick a generous starting point (x264 22, x265 24, SVT-AV1 30), preview a short section of your own video, then raise CRF in steps of about 4 and adjust.
  • CRF scales differ between codecs, so don’t carry a number from one codec to another. The numbers below come from four 10-second 1080p clips, 8-bit, on one PC. They are not recommended values, just examples of how far things can spread.

CRF is not a quality score

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.

How CRF varies with content

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 mediumx265 mediumSVT-AV1 preset 8
blue_sky31.5 / 33.932.4 / 34.857.0 / 59.9
pedestrian_area24.0 / 27.224.9 / 28.436.1 / 43.1
riverbed26.1 / 27.524.8 / 26.637.6 / 41.1
rush_hour20.5 / 24.820.5 / 25.125.0 / 33.7
  • Each codec has its own scale. For the same target, SVT-AV1’s CRF numbers are much larger (25.0–57.0) and spread more widely across clips. Using x264’s 22 on SVT-AV1 means something different.
  • A more complex video doesn’t necessarily need a lower CRF. For riverbed, the clip with the largest files, the x264 CRF for VMAF 95 (26.1) was higher than for pedestrian_area (24.0) and rush_hour (20.5). This data can’t tell us why, so rather than guessing from what the scene looks like, it’s safer to run the encode.
  • On easy footage, the score saturates at low CRF. 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.

Where to set the starting point

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 CRFblue_skypedestrian_areariverbedrush_hour
x264 medium · 2299.97697.50799.94593.692
x265 medium · 2499.97396.26897.00591.635
SVT-AV1 8 · 3099.97897.81599.95192.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.

Start, preview, adjust

  • 1. Cut a section. Use just 10–30 seconds that include the most complex scene. An average hides the hard scenes, so judging only from an easy section tends to push CRF too high.
  • 2. Encode at the starting point. The command below is for x264. For the other codecs, see the FFmpeg cheat sheet.
ffmpeg -ss 60 -t 20 -i input.mp4 -c:v libx264 -preset medium -crf 22 -an test22.mp4
  • 3. Check by eye, and measure the score if you can. Zoom in on high-motion scenes and dark areas. If you ran VMAF, use the VMAF score interpreter to see what the number means. A high average can still hide some low frames (the bottom 5% and minimum VMAF measurement).
  • 4. Raise CRF by 4 and encode again. If you’re happy with the quality, keep going; if it bothers you, go back to the previous value. As seen above, the quality drop from a 4-step increase ranged from 1.7 to 13.9 points depending on the video, so it’s safer not to jump too far at once.
  • 5. Reuse the value you found for similar videos, but check again for videos with very different content. Applying a CRF chosen on one clip to another video can miss the target or produce an unnecessarily large file.

What the later measurements add

  • Treat “CRF +6 halves the file” 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% (size and VMAF change per CRF step).
  • The CRF that matches YouTube’s recommended 8 Mbps isn’t one number either. The x264 slow CRF that averages 8 Mbps was about 20.1–20.7 on three clips and about 31.2 on riverbed, where VMAF at that point was about 76.8 (CRF vs. bitrate for YouTube uploads).
  • Changing the preset means the same CRF no longer gives the same result. At the same VMAF 90 in x264, the size needed was 106–155% for veryfast and 95–98% for slow, with medium as 100%. Don’t carry a CRF number across presets; adjust it within one preset (x264 preset measurement).

Saving time with tools

  • If you’ve chosen a target quality (VMAF), the CRF recommender reads the CRF and expected file size for each codec from the public measurements. As with the table above, it is based on this site’s measured clips, so use it only as a starting point.
  • If you’re moving from HandBrake to FFmpeg or switching codecs, the HandBrake RF to FFmpeg CRF conversion table helps you find the value that gives the same VMAF.
  • The full curves are in the file size and quality by CRF measurement (x264 and x265 medium, SVT-AV1 preset 6) and the measurement by content type. In the earlier measurement (preset 6), the highest measured CRF at which SVT-AV1 held VMAF 90 was 60 for blue_sky, 42 for pedestrian_area, 36 for riverbed and 30 for rush_hour.

Limits of this guide

  • The clips are four 10-second, 8-bit videos. Animation, screen recordings, dark footage, 10-bit, HDR and 4K were not measured, and the CRF values in the tables are not recommendations by genre.
  • An equal mean VMAF doesn’t guarantee the quality looks equal to the human eye. Make the final call by watching your own video.
  • SVT-AV1 results differ by preset. The table above is preset 8, and slower presets may give different results.

Frequently asked questions

What CRF should I start with?

No 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.

Does the same CRF give the same quality?

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.

Can I reuse a CRF number when I switch codecs?

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.

Is it true that "CRF +6 halves the file"?

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%.

Does a lower CRF always look better?

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.