Tool

HDR10 to AV1: Build SVT-AV1 HDR Options

If you re-encode HDR10 video with SVT-AV1 without any extra options, the result file may lose its HDR information or the colors may look different. Paste the source’s ffprobe output and this tool builds a command with the mastering-display and content-light options and the color tags. After encoding, it compares the result file item by item to show whether the information survived. Your input is processed only inside this browser.

Format example:

Pasted text is read only inside this browser and is not sent anywhere. If the output contains a file path, remove it first. The example only illustrates the format; its values are not from a real file.

2. Check and edit the values read

3. Generated SVT-AV1 options

KeyValueMeaning
enable-hdr1Switch that writes HDR metadata into the bitstream (default 0 per the official Parameters.md)
color-primaries9BT.2020 (H.273 number 9)
transfer-characteristics16PQ (H.273 number 16)
matrix-coefficients9BT.2020 non-constant (H.273 number 9)

Notes for Mainline SVT-AV1

  • enable-hdr, mastering-display and content-light are options listed in the official Parameters.md.
  • FFmpeg follows the version of the build linked to libsvtav1. Some users have reported that older builds did not write the metadata into the result, so verifying after encoding is essential.

ffmpeg (libsvtav1)

ffmpeg -i input.mkv -map 0:v:0 -map 0:a? -c:v libsvtav1 -preset 6 -crf <CRF> -pix_fmt yuv420p10le -color_primaries bt2020 -color_trc smpte2084 -colorspace bt2020nc -svtav1-params "enable-hdr=1:color-primaries=9:transfer-characteristics=16:matrix-coefficients=9" -c:a copy output.mkv

-svtav1-params is known to be available from FFmpeg 5.1. -crf and -preset are starting examples, not values chosen by this tool. Because the output is 10-bit, -pix_fmt yuv420p10le is included.

SvtAv1EncApp standalone (when your ffmpeg is not linked to the fork)

ffmpeg -i input.mkv -an -strict -1 -pix_fmt yuv420p10le -f yuv4mpegpipe - | SvtAv1EncApp -i stdin --preset 6 --crf <CRF> --input-depth 10 --enable-hdr 1 --color-primaries 9 --transfer-characteristics 16 --matrix-coefficients 9 -b video.ivf

This keeps the fork's SvtAv1EncApp separate and pipes y4m to it from ffmpeg. In Windows PowerShell 5.1, pipes are known to corrupt binary data, so run it in cmd.exe. Check the option names against --help of the build you use.

Merge the video (IVF) with the source audio (when you used the standalone command above)

ffmpeg -i video.ivf -i input.mkv -map 0:v -map 1:a? -c copy output.mkv

4. Verify after encoding

Whether the options you built were actually written into the result file can differ by build. Run the command below on the result file and paste the output, and it is compared with the values above item by item.

Command to inspect the result file

ffprobe -v error -select_streams v:0 -read_intervals "%+#1" -show_streams -show_frames -of json output.mkv

How is this different from the x265 tool?

Turning the same source information into x265 options is done by the HDR10 Metadata Preservation Helper. On the AV1 side, the notation and option names are different.

  • Coordinate notation: x265’s master-display takes color coordinates in units of 0.00002 and luminance in units of 0.0001 cd/m², as integers. SVT-AV1’s mastering-display has the same format (G(..)B(..)R(..)WP(..)L(max,min)), but you write the coordinates as decimals from 0 to 1 and the luminance in cd/m². This tool converts ffprobe’s fractions (34000/50000) to decimals.
  • Names: SVT-AV1’s content-light corresponds to x265’s max-cll, and its value is MaxCLL,MaxFALL. The switch that records the HDR information is hdr10=1 in x265 and enable-hdr=1 in SVT-AV1.
  • Color tags: AV1 writes color information as H.273 numbers (BT.2020 = 9, PQ = 16, HLG = 18). This tool first sets them with FFmpeg’s -color_primaries, -color_trc and -colorspace, and if you choose, it also puts the same values as numbers inside -svtav1-params.
  • 10-bit: -pix_fmt yuv420p10le is always included. HDR10 assumes 10-bit, and this site’s CRF and VMAF measurements are based on 8-bit clips, so you cannot say that the same CRF means the same quality for 10-bit HDR.

Where do I get the source information?

  • ffprobe (recommended): ffprobe -v error -select_streams v:0 -read_intervals "%+#1" -show_streams -show_frames -of json input.mkv. It reads only the first frame, so it is fast. This tool reads the mastering display and content light level from the first frame’s side data.
  • MediaInfo: copy the entire ‘Text’ view. If MediaInfo shows the color primaries only as a name such as Display P3 instead of numbers, this tool fills in the standard coordinates for that name and marks that it did so. If you need exact values, use ffprobe.
  • Many files contain no MaxCLL or MaxFALL at all. If they are missing, they are left out of the options, and it is safer not to put in made-up values.

How to use it

  1. Run the ffprobe command above on the source and paste the output into box 1. The values it read are filled into box 2, and you can correct any that are wrong or missing. A warning appears if the source is 8-bit or if Dolby Vision or HDR10+ is detected.
  2. Choose whether your SVT-AV1 is mainline or a fork (only the notes change; the three HDR options stay the same), set the CRF and preset, then copy the command from step 3 and run it. If you are not sure which SVT-AV1 you have, follow the checking steps in the SVT-AV1 fork guide (Korean).
  3. Use this site’s 8-bit SDR measurements only as a rough guide for CRF. See SVT-AV1 efficiency by preset, libaom to SVT-AV1 CRF conversion and the CRF Recommender, but we have never measured values for 10-bit HDR, so test on a short segment first. The Representative Segment Picker can help.
  4. If the options string has grown long, scan it with the svtav1-params validator before encoding to catch key typos.
  5. Run the verification command from step 4 on the result file, paste the output, and check that the tags, bit depth, mastering display and MaxCLL all show ‘Match’. If any shows a mismatch, suspect your build, as explained under the limitations below.
  6. If the problem is on the playback side, check the screen with the Browser HDR Checker and the AV1 decoder with the Codec Support Checker. If you are not even sure the source is HDR10, start with the HDR10 / HLG / Dolby Vision Identifier.

Why do the colors look different?

If PQ video has no color tags, a player may interpret it as SDR, and the colors look washed out. This is explained in Why colors look washed out and gamma, transfer function and HDR. However, whether the complaint that ‘SVT-AV1 output looks cold’ comes from missing tags, from the encoder’s quality characteristics or from the player’s tone mapping differs from case to case, and this site has not been able to tell them apart. What this tool can do is match the tags and metadata to the source and check whether the result file really ended up that way.

Limitations worth knowing

  • This tool only builds and compares strings. It does not contain results from encoding and verifying files on this site. The option names follow the descriptions in the official Parameters.md, but whether a generated command records the values as-is in your build of FFmpeg and SVT-AV1 is something you have to confirm yourself with the step 4 verification.
  • Metadata can be lost depending on the build. Some users have reported that with older FFmpeg and SVT-AV1 combinations the result had no HDR information even when the options were given, or that MediaInfo’s mastering display values differed from the ones specified. This site could not reproduce it, and you can only find out how your current build behaves through the verification. If the result has no information, adding it to the container separately with a tool such as mkvmerge is known to be used, but this tool does not cover it.
  • Differences between forks were not checked. We only confirmed that the three keys are in the mainline documentation. We did not test whether the PSY, PSYEX and HDR forks accept them under the same names or whether a fork has its own HDR options. The fork selection only changes the notes.
  • Dynamic metadata for Dolby Vision and HDR10+ is not preserved this way. If the tool detects it, it only shows a warning.
  • SVT-AV1 is known to accept only 4:2:0. A 4:2:2 or 4:4:4 source is converted to 4:2:0, which reduces the chroma information.
  • File size, quality and speed are not calculated. We did not measure how many VMAF points a given AV1 CRF gives on the same HDR video, and 10-bit and HDR are not included in this site’s measurements (8-bit SDR).
  • Converting HDR down to SDR (tone mapping) is not covered. For the steps, see HDR to SDR tone mapping.
  • Pasted text is not sent to a server. If the output contains a file path, remove it before pasting.