Tool
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.
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
| Key | Value | Meaning |
|---|---|---|
| enable-hdr | 1 | Switch that writes HDR metadata into the bitstream (default 0 per the official Parameters.md) |
| color-primaries | 9 | BT.2020 (H.273 number 9) |
| transfer-characteristics | 16 | PQ (H.273 number 16) |
| matrix-coefficients | 9 | BT.2020 non-constant (H.273 number 9) |
Notes for Mainline SVT-AV1
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
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.
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.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_primaries, -color_trc and -colorspace, and if you choose, it also puts the same values as numbers inside -svtav1-params.-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.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.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.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.