The brightening is not a bug: it is what a genuine sRGB-to-BT.709 transfer conversion does to display-referred material. If your goal is an output that is tagged BT.709 but looks identical to the source, do not convert the transfer at all. Convert only the matrix and range with zscale, then overwrite the transfer tag with setparams placed at the end of the filter chain. Command-line flags such as -color_trc bt709 will not work here, because the decoded frames carry their own color properties and those take precedence.
Why converting the transfer brightens the picture
sRGB (IEC 61966-2-1) and BT.709 share the same color primaries and white point, so the only real difference between the two tags is the transfer function. The catch is that the two curves are meant to be used differently. zscale treats t=bt709 as a scene-referred camera curve with an effective gamma of roughly 1.95, while a Blender sRGB export is display-referred data encoded near gamma 2.2. Re-encoding 2.2 display values through the BT.709 camera curve raises shadows and midtones, which is exactly the brightness lift you observed.
Nothing in the playback chain undoes this. mpv, ffplay, vlc and a straight PNG export all treat bt709 as display-referred as well, so the raised code values go straight to an sRGB screen unchanged. That is why every viewer you tested agrees on the brighter image.
Why the command-line flags did not take effect
Two separate mechanisms are at play:
- Frame metadata outranks CLI options. The input frames carry
iec61966-2-1as a frame property. Output options such as-color_trccannot override what the decoder attaches to each frame, so the sRGB tag survives into the output. - swscale ignores the transfer function. The default scaler only remaps matrix and range, which is why your first command produced visually identical output that was still tagged
iec61966-2-1.
The working recipe: matrix and range only, then re-tag
Strip tin and t from the zscale invocation so it performs no transfer conversion, and append setparams after the pixel format conversion:
ffmpeg -i sample_original.mkv \
-vf "zscale=min=gbr:rin=full:m=bt709:r=limited,format=yuv420p10le,setparams=colorspace=bt709:color_primaries=bt709:color_trc=bt709" \
-c:v libx264 -qp 0 -preset ultrafast out.mkv
What each stage does:
zscale=min=gbr:rin=full:m=bt709:r=limitedconverts GBR full-range input to BT.709 limited-range YUV without touching the gamma-encoded values.format=yuv420p10lefinalizes the target pixel format.setparams=...rewrites the frame properties so the output is tagged bt709/bt709/bt709. It changes metadata only, which is precisely why the picture stays the same.
Because this pipeline reduces 16-bit RGB to 10-bit YUV, consider adding d=error_diffusion to zscale to keep banding out of smooth gradients.
Verify the result
Check the stream properties rather than trusting the command you ran:
ffprobe -v error -select_streams v:0 -show_entries stream=pix_fmt,color_space,color_transfer,color_primaries,color_range -of default=noprint_wrappers=1 out.mkv
Also export the same frame from the input and the output as PNG and compare them. The images should match; only the tags differ.
Metadata re-tag vs. real conversion: which do you need?
Re-tagging is the right call when the content was mastered as sRGB, as with a Blender render, and must look identical in ordinary players. It is also widespread practice: the sRGB and BT.709 curves are close enough that virtually all playback pipelines treat them interchangeably, and labeling sRGB-like material as BT.709 is common in distribution.
A pixel-level conversion is only needed when a downstream tool requires files to be genuinely BT.709-encoded, or when the material will be mixed with true BT.709 camera footage in one pipeline. In that case use tin=iec61966-2-1 and t=bt709 on zscale, accept the brightness change, and compensate downstream if needed. There is no setting that gives you a true transfer conversion and an unchanged look at the same time; for this pair of curves the two goals are mathematically in conflict.
Frequently Asked Questions
Does setparams modify pixel values?
No. It rewrites the color metadata attached to frames. Confirm with ffprobe and by comparing a PNG export before and after; the picture should be unchanged.
Why did -color_trc bt709 not appear in my output?
Decoded frames carry their own color properties, and those beat output flags such as -color_trc. Change the property inside the filter graph with setparams instead.
Why is the zscale result brighter when I set tin and t?
Because that performs a real transfer conversion. The BT.709 camera curve, with an effective gamma around 1.95, applied to display-referred sRGB data near 2.2 lifts shadows and midtones.
Is it incorrect to label sRGB-encoded pixels as bt709?
Strictly speaking the label no longer describes the exact encoding, but the primaries match, the curves are close, and players treat both as display-referred. For general playback this is standard practice; for measurement-critical pipelines, do a real conversion instead.
Can I use the scale filter instead of zscale?
swscale can remap matrix and range, but zscale offers higher-quality processing and explicit dithering control when reducing depth. Either way you still need setparams for the transfer tag, since swscale never touches the transfer function.
Why do ffplay, mpv, VLC and PNG export all show the same brighter image?
None of them compensates for a transfer difference; they pass display-referred code values to the screen as-is, so the brightness lift from a real conversion is visible everywhere.