Tool

HandBrake Preset JSON Builder

So you don’t have to guess “what RF should I use?”, choose a target quality (VMAF) and the tool reads the RF from data we measured ourselves and turns it into a preset file you can import into HandBrake. All processing happens only inside this browser.

1. Purpose (target VMAF)

A middle value for small screens or normal viewing distance. The target score is a reference value chosen by this tool; how it actually looks differs from video to video.

2. Resolution

Loading…

4. Preset version of your HandBrake

HandBrake may reject a preset file whose version doesn’t match. Export any preset from your HandBrake, paste the file below, and the tool reads VersionMajor, VersionMinor and VersionMicro near the end of the file. What you paste never leaves this browser.

The default 53·0·0 is an unverified example value. Reading the version from an exported file is safer.

How were the RF values chosen?

In our CRF sweep measurement, we encoded four 10-second 1080p25 clips with x264 and x265 (preset medium) and SVT-AV1 (preset 6) at six CRF values each, and measured VMAF. For each clip, this tool reads the CRF that reaches the target VMAF by connecting the measured points, takes the lowest of those values (the most demanding clip), and rounds it down to an integer to use as the RF. That way the hardest clip still reaches the target, and the easier clips score higher than the target. HandBrake’s RF is known to be passed straight through to the encoder’s CRF for x264 and x265, so we read it on the same scale. The reasoning behind the conversion is in the HandBrake RF ↔ FFmpeg CRF conversion table.

The target VMAF values of 95, 90 and 80 are reference values chosen by this tool. To see how a score looks on an actual screen, read the VMAF Score Interpreter together with our measurement of VMAF worst frames.

How to import it into HandBrake

  1. On this page, choose a purpose and a resolution, then click “Download JSON”.
  2. In HandBrake’s Presets menu, choose Import and open the downloaded file. The imported preset appears under your custom presets in the preset list.
  3. Select the preset, then check once on the Video tab that the encoder and the Constant Quality slider value are what you intended, and encode.

The file contains only the container (MP4), the video encoder, the encoder speed preset, the Constant Quality value (RF) and, if you chose one, a maximum size. Audio, subtitles and filters are not written, so check for yourself that HandBrake’s defaults apply to them.

If the import fails

  • Version mismatch: There are forum reports of imports failing with “outdated” because the version didn’t match. Enter the version of a file exported from your own HandBrake in step 4 above and build the file again.
  • Field errors: The keys that are accepted differ by HandBrake version. Forum reports also name the audio dither entry (AudioDitherMethod) as the cause of an error. This tool does not write such entries at all, but if the import still fails, compare the keys with a preset exported from your own HandBrake.
  • SVT-AV1 speed value: This file writes the SVT-AV1 preset value as 6. If your version doesn’t recognize it, pick the value on the slider yourself after importing.

How to use it

Download the presets for the same purpose in all three codecs, run the same video through each, and compare size and speed. If you want a different RF, use the RF in this file as a starting point and adjust from there. If you work on the command line, there is the FFmpeg Command Builder, and to see the CRF and file size for a target VMAF directly, there is the CRF Recommender.

Limitations worth knowing

  • We could not verify the import in HandBrake itself. The key names and values in the preset JSON were built to match the format HandBrake exports, and we don’t guarantee that it imports in every version. We handled this by letting you set the version in the field above.
  • The RF was read from values measured with FFmpeg; we did not encode with HandBrake and compare. If HandBrake’s speed preset differs from the measurement conditions (x264 and x265 medium, SVT-AV1 6), the results may differ.
  • The results come from four 10-second clips, 1080p25 8-bit, on one PC. Scaling down, turning on filters, and 10-bit or HDR were not measured.
  • Clips whose measured range doesn’t cover the target VMAF are left out of the calculation and listed. For those clips we can’t tell whether the RF fits.
  • VMAF is a score that imitates the human eye, so it does not match how every video actually looks.