Log in

View Full Version : HDR10+ not showing


jriker1
8th October 2023, 13:12
I have a MKV with HDR10 and HDR10+ in it. I have extracted the HDR10+ info with:

ffmpeg -i input.mkv -map 0:v:0 -c copy -vbsf hevc_mp4toannexb -f hevc - | hdr10plus_tool extract -o metadata.json -

I then use the dhdr10-info command to put it back but when I put the HEVC output into an MKV container and look at it with mediainfo just HDR10 no HDR10+. Example command I'm doing:

ffmpeg -i input.mkv -sn -an -f yuv4mpegpipe -strict -1 -pix_fmt yuv420p10le - | x265-10b - --input-depth 10 --output-depth 10 --y4m --preset slow --hdr10 --hdr10-opt --high-tier --repeat-headers --crf 17 --master-display "G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(40000000,50)" --max-cll "1000,401" --chromaloc 2 --no-sao --range limited --keyint 24 --colormatrix bt2020nc --colorprim bt2020 --transfer smpte2084 --dhdr10-info=metadata.json --vbv-bufsize 160000 --vbv-maxrate 160000 <output>.hevc

Note during encode don't see much around HDR10+ but do see a reference to this:

x265 [info]: tools: deblock dhdr10-info


Also if I look at the metadata.json file it does start with HDR10+ info:

{
"JSONInfo": {
"HDR10plusProfile": "B",
"Version": "1.0"
},
"SceneInfo": [
{
"BezierCurveData": {
"Anchors": [
...

My ffmpeg is a nightly from about a month ago. My x265 executables in Windows is from May.

Any thoughts?

-QfG-
8th October 2023, 14:03
Use quietvoids hdr10plus_tool to inject HDR10+ metadata after encoding into stream.

Remove this code from your encoder settings:

--dhdr10-info=metadata.json

then after encoding:

hdr10plus_tool inject -i video.hevc -j metadata.json -o injected_output.hevc

jriker1
8th October 2023, 14:13
Thanks I can do that but isn't dhdr10-info supposed to inject it in the file vs a second loop?

What is interesting even though I see no reference to HDR10+ info and ffprobe doesn't show it either, hdr10plus_tool reports back this:

Parsing JSON file...
Processing input video for frame order info...

Warning: Input file already has HDR10+ SEIs, they will be replaced.

-QfG-
8th October 2023, 14:37
I never use the included functions for injecting DV / HDR10+ during encoding. It is better to do this after encoding.
For example if u encode and include DV and the target video is cropped, sometimes you have wrong cropping values in the injected RPU.

quietvoid
8th October 2023, 15:31
MediaInfo should definitely be seeing it, so something is not being done correctly.
Same for ffprobe -show_frames.

There's no reason to avoid x265 adding either of HDR10+ or/and Dolby Vision. It avoids extra steps.

jriker1
8th October 2023, 19:07
MediaInfo should definitely be seeing it, so something is not being done correctly.
Same for ffprobe -show_frames.

There's no reason to avoid x265 adding either of HDR10+ or/and Dolby Vision. It avoids extra steps.

Yeah shared the details I think everything of what I did. Dolby Vision I have no issues with using:

dovi_tool -m 2 extract-rpu

and applying with these flags in a command similar to my original ffmpeg command minus the dhdr10-info piece:

--dolby-vision-rpu rpu.bin --dolby-vision-profile 8.1

-QfG-
9th October 2023, 06:32
You must check the cropping infos inside the RPU. For example, the RPU was included in a 3840 x 2160 video and the AR is letterboxed, the RPU often has cropping infos inside. If u encode now and you crop the picture to 3840 x 1600 and the RPU has cropping values 0,280,0,280 you have black borders inside the movie. Check the cropping values before injecting, you can use this toolset for injecting, the most steps will made automatically: https://forum.doom9.org/showthread.php?t=183479

https://i.imgur.com/43gjTC0l.png

Or, if you crop the video you can extract the RPU with this switch:

dovi_tool -c -m 2 extract-rpu

This extract the RPU with all cropping values 0, the correct cropping values for videos without black borders.