Teraflop4096 wrote:_Shorty wrote:edit: Well, maybe not. An example file I have would need these parameters:
X265 Parameters:
hdr10=1
hdr10-opt=1
repeat-headers=1
colorprim=bt2020
range=limited
transfer=smpte2084
colormatrix=bt2020nc
master-display=G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(40000000,50)
max-cll=1655,117
But when you try to add those manually to the x265 parameters the dialog box doesn't let you enter the last two lines properly. It interprets the commas as new-line characters and you get a bunch of new lines added that are nonsensical as a result, like this:
I can confirm this would indeed work, if SVP didn't mess up those commas. Because, if you reencode the transcoded SVP file again, using the exact same arguments, the HDR works correctly.
Therefore, to get HDR to work properly in SVP transcodes, you first need to transcode the files to some intermediate format (without or with incorrect HDR tags), and then transcode them again using the correct HDR arguments. So, it's possible, but it seems like a really silly bug in SVP.
Correction: This double-encoding approach apparently does not actually work correctly... but it does seem to be a part of the solution, as far as I can tell, so perhaps with some additional steps this might work.
Hmm, ok, been a while since I looked in on this topic. After reading what you just said here I gave this a try:
1. Took a 1-minute clip of the 4k Blade Runner: The Final Cut and ran it through SVP using FFV1 for the codec, so I have the original blade.mkv and blade.SVP.mkv now.
2. ffprobe -loglevel quiet -read_intervals %+#1 -select_streams v:0 -show_entries side_data blade.mkv
[PACKET]
[/PACKET]
[FRAME]
[SIDE_DATA]
side_data_type=H.26[45] User Data Unregistered SEI message
[/SIDE_DATA]
[SIDE_DATA]
side_data_type=H.26[45] User Data Unregistered SEI message
[/SIDE_DATA]
[SIDE_DATA]
side_data_type=Mastering display metadata
red_x=34000/50000
red_y=16000/50000
green_x=13250/50000
green_y=34500/50000
blue_x=7500/50000
blue_y=3000/50000
white_point_x=15635/50000
white_point_y=16450/50000
min_luminance=50/10000
max_luminance=40000000/10000
[/SIDE_DATA]
[SIDE_DATA]
side_data_type=Content light level metadata
max_content=1655
max_average=117
[/SIDE_DATA]
[/FRAME]
[STREAM]
[/STREAM]
3. ffmpeg -i blade.SVP.mkv -an -sn -c:v libx265 -pix_fmt yuv420p10le -profile:v main10 -preset superfast -crf 17 -x265-params "hdr10=1:hdr10-opt=1:repeat-headers=1:colorprim=bt2020:transfer=smpte2084:colormatrix=bt2020nc:master-display=G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(40000000,50):max-cll=1655,117" -y blade.SVP.HDR.mkv
And as far as I can tell this worked just fine for this HDR10 clip, other than the umbrella/outdoor restaurant scene near the beginning being an absolute horror show for RIFE 4.26 v2, haha. But as far as the HDR side of things goes, I think this worked correctly. I guess it isn't going to be that simple for HDR10+, or especially for DoVi content, but for straight HDR10 I think that's all that's required.