Tool
If you re-encoded HDR video with x265 and it now looks washed out in a player, or the HDR badge is gone, the HDR information inside the video probably did not carry over. Paste the source’s ffprobe output or MediaInfo text and this tool builds the master-display and max-cll strings and the commands. After encoding, it compares the result file to show whether the information survived.
Pasted text is not sent to a server; it is analyzed only inside this browser. The examples only show the format; they were not read from a real file.
2. Check and edit the values (color coordinates as decimals from 0 to 1, luminance in cd/m²)
3. Generated options
x265 master-display
– (color coordinates and luminance are both required)
Color coordinates are converted to integers in 0.00002 steps, and luminance to integers in 0.0001 cd/m² steps.
x265 max-cll
– (both MaxCLL and MaxFALL are required)
x265 (HEVC) command
ffmpeg -i input.mkv -map 0:v:0 -map 0:a? -c:v libx265 -preset medium -crf <CRF> -pix_fmt yuv420p10le -x265-params "hdr10=1:repeat-headers=1:colorprim=bt2020:transfer=smpte2084:colormatrix=bt2020nc" -c:a copy output.mkv
x265-params must be wrapped in quotes so the parentheses are not broken by the shell. Audio is copied as-is, and subtitles are not included.
SVT-AV1 command
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" -c:a copy output.mkv
SVT-AV1's HDR option names and notation can differ by version. Be sure to check the result with the step 4 verification below.
4. Verify after encoding
Run the command below on the output file, then paste its output to compare it item by item with the values above.
ffprobe command for verification
ffprobe -v error -select_streams v:0 -read_intervals "%+#1" -show_streams -show_frames -of json output.mkv
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. Mastering display values come out as fractions such as red_x=34000/50000, and this tool converts them to integers and decimals.Display P3 instead of numbers. In that case the tool fills in the standard coordinates for that name and marks that it did so. If there is neither a name nor coordinates, the fields stay empty, so use ffprobe output instead.master-display=G(x,y)B(x,y)R(x,y)WP(x,y)L(max,min): the color primaries, white point and maximum/minimum luminance of the monitor the video was graded (mastered) on. x265 takes color coordinates in units of 0.00002 and luminance in units of 0.0001 cd/m², as integers. For example, 0.265 becomes 13250 and 1000 cd/m² becomes 10000000.max-cll=MaxCLL,MaxFALL: the brightest single pixel in the whole video (MaxCLL) and the highest frame-average brightness (MaxFALL), both in cd/m².hdr10=1 and repeat-headers=1: write the HDR information into the bitstream and repeat the headers at every keyframe, so the information is present even when playback starts in the middle.colorprim, transfer and colormatrix: the color tags. When they are missing, a player may interpret HDR (PQ) video as SDR, and the colors look washed out. This is explained in Why colors look washed out and gamma, transfer function and HDR.-pix_fmt yuv420p10le: HDR10 assumes 10-bit. Exporting 8-bit makes the gradations coarser and reduces the point of HDR.enable-hdr, mastering-display and content-light can vary from build to build, and some users have reported that the metadata was not written in some versions. Use the command only as a starting point.