[FFmpeg-user] Converting BT2020 HVEC Videos to H.264 without Color Washout

Pavel Koshevoy pkoshevoy at gmail.com
Fri Mar 26 02:14:10 EET 2021


On Thu, Mar 25, 2021 at 5:59 PM Pavel Koshevoy <pkoshevoy at gmail.com> wrote:

>
>
> On Thu, Mar 25, 2021, 16:34 Craig L. <ffmpeg at trafficality.com> wrote:
>
>> I think I tried exactly that based upon this stackoverflow question:
>>
>>
>> https://stackoverflow.com/questions/64981984/ffmpeg-transcode-uhd-h265-to-sdr-h264-without-color-loss
>>
>> The example in that post uses this command:
>>
>> |ffmpeg -i 4K.ts -vf
>> zscale=t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=hable:desat=0,zscale=t=bt709:m=bt709:r=tv,format=yuv420p
>>
>> -c:v h264 -crf 19 -preset ultrafast output.mp4 |
>>
>
>
> I think tonemap should be upstream from the 2nd zscale filter
>
>
>

Also, you may still need to specify the input color_trc, primaries,
colorspace, range  for the 1st zscale filter ... in case your source
doesn't signal those.

something like this:

zscale=tin=smpte2084:pin=2020:min=2020_ncl:rin=limited:t=linear:npl=100,format=gbrpf32le,tonemap=tonemap=hable:desat=0,zscale=p=bt709,m=bt709:t=bt709:r=limited,format=yuv420p


More information about the ffmpeg-user mailing list