Log in

View Full Version : Incompatible HDR10+ Injection


Loomes
12th October 2025, 10:16
For my source mkv file, MediaInfo shows the follwing video info:


ID : 1
Format : HEVC
Format/Info : High Efficiency Video Coding
Format profile : Main 10@L5.1@Main
HDR format : SMPTE ST 2094 App 4, Version 1, HDR10+ Profile B compatible
Codec ID : V_MPEGH/ISO/HEVC
Duration : 55 min 49 s
Bit rate : 3 644 kb/s
Width : 3 840 pixels
Height : 2 160 pixels
Display aspect ratio : 16:9
Frame rate mode : Variable
Frame rate : 23.976 (24000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0 (Type 2)
Bit depth : 10 bits
Bits/(Pixel*Frame) : 0.018
Stream size : 1.42 GiB (89%)
Language : English
Default : Yes
Forced : No
Color range : Limited
Color primaries : BT.2020
Transfer characteristics : PQ
Matrix coefficients : BT.2020 non-constant
Mastering display color primaries : Display P3
Mastering display luminance : min: 0.0001 cd/m2, max: 1000 cd/m2
Maximum Content Light Level : 1 170 cd/m2
Maximum Frame-Average Light Level : 320 cd/m2


Now I'm using hdr10plus_tool to extract the HDR10+ info:

hdr10plus_tool extract source.mkv -o source_hdrinfo.json


I inject the JSON into the target, which has no HDR info yet:

hdr10plus_tool.exe inject -i target.hevc -j source_hdrinfo.json -o target_injected.hevc


After muxing to MKV, the target file shows the following:

Format : HEVC
Format/Info : High Efficiency Video Coding
Format profile : Main 10@L5.1@Main
HDR format : SMPTE ST 2094 App 4, Version 1
Codec ID : V_MPEGH/ISO/HEVC
Duration : 55 min 49 s
Bit rate : 12.5 Mb/s
Width : 3 840 pixels
Height : 2 160 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 23.976 (24000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 10 bits
Bits/(Pixel*Frame) : 0.063
Stream size : 4.86 GiB (100%)
Default : Yes
Forced : No


...which now has a "HDR format" but is obviously missing Mastering infos etc. The JSON file has about 78.000 kb and 4.338.417 lines, looks okay afaik, but the resulting file is not recognized as HDR by my TV and shows no difference to the original target file (without HDR).

How can I do a proper injection here?

Z2697
12th October 2025, 17:21
Mastering display and content light level info is located in the SEI, I'm not sure how hdr10plus_tool handles that, but from the result I assume it's not handling that.
(And the matrix transfer primaries chromaloc are located in VUI in SPS, your result seems not containing that as well)
(Which actually, is probably the real reason why it's not recognized, not the lack of mastering and cll info)

Loomes
12th October 2025, 20:44
Are there other cli tools to do HDR10+ injection?

Z2697
12th October 2025, 22:29
IDK but it doesn't matter. Fix your base bitstream.
You can use FFmpeg bitstream filter hevc_metadata to fix the VUI info, don't really have a good idea about the mastering and cll SEI but that's just a little bonus.

ffmpeg -i a.265 -bsf:v hevc_metadata=colour_primaries=9:transfer_characteristics=16:matrix_coefficients=9:video_full_range_flag=0 -c copy b.265

Loomes
12th October 2025, 23:18
Thanks, but meanwhile the author of the tool told me that the target file needs to be already HDR, not SDR, like mine is.