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

Andy Furniss adf.lists at gmail.com
Tue Dec 13 14:32:59 EET 2016


Carl Eugen Hoyos wrote:
> 2016-12-13 1:35 GMT+01:00 Andy Furniss <adf.lists at gmail.com>:
>> 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 -
>
> (Thank you!)

Ugh, seems my ffmpeg was a day too old = the strict check is removed in
master now, so ffmpeg -i will show the info.

> So this means that the following does not produce HDR output?
> $ ffmpeg -i input.mkv -vcodec vp9 out.mkv

It doesn't seem to in the sense that  ffmpeg -i out.mkv doesn't show the 
mastering info or the transfer info.

andy [377]$ ffmpeg -i The\ World\ in\ HDR-tO01J-M3g0U.webm -vcodec vp9 
out.mkv
ffmpeg version N-82844-g265d451 Copyright (c) 2000-2016 the FFmpeg 
developers
   built with gcc 5.3.0 (GCC)
   configuration: --prefix=/usr --disable-doc --enable-gpl --enable-omx 
--enable-opencl --enable-libvpx --enable-libx265 --enable-libmp3lame 
--enable-libx264 --enable-gnutls
   libavutil      55. 43.100 / 55. 43.100
   libavcodec     57. 67.100 / 57. 67.100
   libavformat    57. 59.100 / 57. 59.100
   libavdevice    57.  2.100 / 57.  2.100
   libavfilter     6. 68.100 /  6. 68.100
   libswscale      4.  3.101 /  4.  3.101
   libswresample   2.  4.100 /  2.  4.100
   libpostproc    54.  2.100 / 54.  2.100
Input #0, matroska,webm, from 'The World in HDR-tO01J-M3g0U.webm':
   Metadata:
     encoder         : google
   Duration: 00:02:34.54, start: 0.000000, bitrate: 18208 kb/s
     Stream #0:0(eng): Video: vp9 (Profile 2), yuv420p10le(tv, 
bt2020nc/bt2020/smpte2084), 3840x2160, SAR 1:1 DAR 16:9, 59.94 fps, 
59.94 tbr, 1k tbn, 1k tbc (default)
     Side data:
       Mastering Display Metadata, has_primaries:1 has_luminance:1 
r(0.6800,0.3200) g(0.2649,0.6900) b(0.1500 0.0600) wp(0.3127, 0.3290) 
min_luminance=0.001000, max_luminance=1000.000000
File 'out.mkv' already exists. Overwrite ? [y/N] y
[libvpx-vp9 @ 0x20b2240] v1.6.0-815-g5d4aa32
Output #0, matroska, to 'out.mkv':
   Metadata:
     encoder         : Lavf57.59.100
     Stream #0:0(eng): Video: vp9 (libvpx-vp9) (VP90 / 0x30395056), 
yuv420p10le, 3840x2160 [SAR 1:1 DAR 16:9], q=-1--1, 200 kb/s, 59.94 fps, 
1k tbn, 59.94 tbc (default)
     Metadata:
       encoder         : Lavc57.67.100 libvpx-vp9
     Side data:
       cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Stream mapping:
   Stream #0:0 -> #0:0 (vp9 (native) -> vp9 (libvpx-vp9))
Press [q] to stop, [?] for help
frame=   46 fps=0.4 q=0.0 Lsize=      32kB time=00:00:00.75 bitrate= 
350.3kbits/s speed=0.00686x
video:31kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB 
muxing overhead: 3.280642%

andy [377]$ ffmpeg -i out.mkv
ffmpeg version N-82844-g265d451 Copyright (c) 2000-2016 the FFmpeg 
developers
   built with gcc 5.3.0 (GCC)
   configuration: --prefix=/usr --disable-doc --enable-gpl --enable-omx 
--enable-opencl --enable-libvpx --enable-libx265 --enable-libmp3lame 
--enable-libx264 --enable-gnutls
   libavutil      55. 43.100 / 55. 43.100
   libavcodec     57. 67.100 / 57. 67.100
   libavformat    57. 59.100 / 57. 59.100
   libavdevice    57.  2.100 / 57.  2.100
   libavfilter     6. 68.100 /  6. 68.100
   libswscale      4.  3.101 /  4.  3.101
   libswresample   2.  4.100 /  2.  4.100
   libpostproc    54.  2.100 / 54.  2.100
Input #0, matroska,webm, from 'out.mkv':
   Metadata:
     ENCODER         : Lavf57.59.100
   Duration: 00:00:00.77, start: 0.000000, bitrate: 343 kb/s
     Stream #0:0(eng): Video: vp9 (Profile 2), yuv420p10le(tv, 
progressive), 3840x2160, SAR 1:1 DAR 16:9, 59.94 fps, 59.94 tbr, 1k tbn, 
1k tbc (default)
     Metadata:
       ENCODER         : Lavc57.67.100 libvpx-vp9
       DURATION        : 00:00:00.768000000
At least one output file must be specified





More information about the ffmpeg-user mailing list