How do I convert from iec61966-2-1/srgb to bt709 transfer function in ffmpeg, while keeping the look of the content the same?

I’m trying to convert a gbrp16le(pc, gbr/bt709/iec61966-2-1, progressive) video into yuv420p10le(tv, bt709, progressive).

I am able to get as far as a yuv420p10le(tv, bt709/bt709/iec61966-2-1, progressive) that looks visually identical.

The command I used for this is:

ffmpeg -i sample_original.mkv -colorspace bt709 -color_range limited -color_primaries bt709 -color_trc bt709 -pix_fmt yuv420p10le -qp 0 -preset ultrafast out.mkv

However, as you may have noticed, the transfer function remains srgb/iec61966-2-1, which is something I do not want.

I have read through documentation on, and tried various color conversion filters such as zscale, scale and colorspace but no matter what I do with them, they seem to change the colors significantly after a conversion to the bt709 transfer function. I have also tried help from LLM’s but to no avail.

For example, with the command:

ffmpeg -i sample_original.mkv -vf zscale=min=gbr:tin=iec61966-2-1:pin=bt709:rin=full:m=bt709:t=bt709:p=bt709:r=limited -pix_fmt yuv420p10le -qp 0 -preset ultrafast out_zscale.mkv

the transfer function gets converted to bt709, but the overall image gets noticably brighter. (See attached) If I omit the transfer function conversion part from the zscale command, the image stays visually identical. However srgb/iec61966-2-1 transfer function is kept.

Original video decoded and downscaled to 1920×804

zscale with transfer conversion decoded and downscaled to 1920×804

I have also attached google drive links for the sample_original.mkv file which contains the frame I’m trying to convert in video form, losslessly remuxed. As well as the “original-original” png frame as rendered by Blender foundation, which is the undisputed and untouched source. Both were too big to upload to superuser directly.

https://drive.google.com/file/d/14qKAybyEFAEXalC3ycxF56xiHYgHNgN8/view?usp=sharing (original frame from Blender)

https://drive.google.com/file/d/128YsWifhyKhRCT4Ofgp92iugj7iYhEOu/view?usp=sharing (video sample I’m trying to convert)

My dearest gratitude if anyone can help me with this.


I am using Arch Linux with up-to-date packages as of writing, this means ffmpeg version n9.0.2 packaged by Arch.

I use mpv to play back video, but I can confirm the same problem persists by converting to png directly in ffmpeg, or using ffplay or vlc to play back.

Attached images have been downscaled to 1920×804 to comply with upload size.