Configure HDR Metadata in FFmpeg libsvtav1
This guide explains how to configure High Dynamic Range (HDR)
metadata when encoding video with the libsvtav1 encoder in
FFmpeg. You will learn how to set the correct color space parameters and
pass HDR10 metadata—specifically mastering display color volume and
content light levels—directly to the SVT-AV1 encoder to ensure your
output files trigger HDR mode on compatible displays.
Step 1: Set the 10-bit Color Space and Primaries
For HDR10 video, you must use a 10-bit pixel format and specify the BT.2020 color space alongside the SMPTE 2084 (PQ) transfer characteristics.
Add these standard FFmpeg flag inputs to your command: *
-pix_fmt yuv420p10le: Forces 10-bit encoding. *
-color_primaries bt2020: Sets the color primaries to
BT.2020. * -color_trc smpte2084: Sets the transfer
characteristics to SMPTE 2084 (PQ curve). *
-colorspace bt2020nc: Sets the color matrix to BT.2020
non-constant luminance.
Step 2:
Configure HDR10 Metadata via -svtav1-params
To pass static HDR metadata, use the -svtav1-params
option. You need to define two main properties:
mastering-display and content-light.
1. Mastering
Display Metadata (mastering-display)
This specifies the color primaries, white point, and luminance range
of the monitor used to master the video. The values are written in the
format: G(x,y)B(x,y)R(x,y)WP(x,y)L(max,min)
The coordinate values (x and y) must be multiplied by 50,000. The luminance values (max and min) must be multiplied by 10,000.
For a standard BT.2020 mastering display with D65 white point, a maximum luminance of 1000 nits, and a minimum luminance of 0.05 nits, the coordinates calculate to: * Green: x = 0.265 (13250), y = 0.690 (34500) * Blue: x = 0.150 (7500), y = 0.060 (3000) * Red: x = 0.708 (35400), y = 0.292 (14600) * White Point: x = 0.3127 (15635), y = 0.3290 (16450) * Luminance: Max = 1000 nits (10000000), Min = 0.05 nits (500)
This translates to the following parameter string:
mastering-display=G(13250,34500)B(7500,3000)R(35400,14600)WP(15635,16450)L(10000000,500)
2. Content Light Level
(content-light)
This specifies the Maximum Content Light Level (MaxCLL) and Maximum Frame-Average Light Level (MaxFALL) in nits.
For a video with a MaxCLL of 1000 nits and a MaxFALL of 400 nits, the
parameter is: content-light=1000,400
Complete FFmpeg Command Example
Combine these elements into your FFmpeg command. Separate multiple
parameters inside -svtav1-params using colons
(:).
ffmpeg -i input_hdr.mkv -c:v libsvtav1 -preset 4 -crf 24 \
-pix_fmt yuv420p10le \
-color_primaries bt2020 \
-color_trc smpte2084 \
-colorspace bt2020nc \
-svtav1-params "mastering-display=G(13250,34500)B(7500,3000)R(35400,14600)WP(15635,16450)L(10000000,500):content-light=1000,400" \
-c:a copy output_hdr.mkv