[FFmpeg-user] VP9 to HEVC hdr demo conversion?

Andy Furniss adf.lists at gmail.com
Tue Dec 13 02:35:03 EET 2016


Carl Eugen Hoyos wrote:
> 2016-12-11 23:25 GMT+01:00 traycold <traycold at gmail.com>:
>> hi,
>> I tried the same (convert a vp9.2 hdr video to hevc to watch it on a samsung
>> smart tv).
>> So far, I tried this command (input.mkv contains both VP9.2 video stream and
>> audio stream):
>>
>> ffmpeg -i input.mkv -vf
>> scale=out_color_matrix=bt2020:out_h_chr_pos=0:out_v_chr_pos=0,format=yuv420p10
>> -pix_fmt yuv420p10le -c:v libx265 -x265-params
>> "colorprim=bt2020:transfer=smpte-st-2084:colormatrix=bt2020nc" -crf 22 -c:a
>> copy output.mkv
>
> Did you also try the following?
> $ ffmpeg -i input.mkv -vcodec hevc output.mkv

I did a bit of digging into this and ffmpeg doesn't read the mastering 
data in the webm due to the test -

if (s->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL)

in libavformat/matroskadec.c roughly line 2438 (or less I have printfs 
sprinkled around)

removing the check + printfs reveals the mastering meta =

ADF has_mastering_primaries = 1
ADF has_mastering_luminance = 1
ADF mastering_meta->r_x = 0.680000
ADF mastering_meta->r_y = 0.319960
ADF mastering_meta->g_x = 0.264940
ADF mastering_meta->g_y = 0.689960
ADF mastering_meta->b_x = 0.150000
ADF mastering_meta->b_y = 0.059980
ADF mastering_meta->white_x = 0.312700
ADF mastering_meta->white_y = 0.328960
ADF mastering_meta->max_luminance = 1000.000000
ADF mastering_meta->min_luminance = 0.001000
Input #0, matroska,webm, from 'The World in HDR-tO01J-M3g0U.webm':

Though a quick test shows they do not get written using your command.
Probably need to look in enc as well.





More information about the ffmpeg-user mailing list