[FFmpeg-user] ffmpeg MP4/x264 output colours change when input source is different resolution (bug?)

Erik Dobberkau erik.dobberkau at gmail.com
Sat Sep 17 14:22:43 EEST 2022


>
> Is colorspace and color matrix not the same? If not, how can color
> matrix be specified in the command line?
> How can white point be specified in the command line?
>

No, it's not the same. Personally, I prefer to use color representation
instead. But that wouldn't help in this discussion. :)

The doc at https://ffmpeg.org/ffmpeg-filters.html#colormatrix says:
colormatrix={in}:{out}
is to be used as part of a filter chain.

I didn't see any specific option / filter parameter for defining the white
point (it is rarely needed for 99.99% of the jobs ffmpeg is used for, in my
experience, so it can't be considered a missing feature).
What comes closest is to be found at:
https://ffmpeg.org/ffmpeg-filters.html#colorspace


> I did specify -pix_fmt, -colorspace, -color_trc, -color_primaries and
> -color_range. But that seems to be not sufficient. The color in VLC
> player is different for height=576 and height=720.
>

I am not sure if all of the "dash-parameters" map to the respective filters
on a 1:1 basis.
They may also interact in some way, depending on their position in the
command parameter chain (vs. usage in the filter graph).
Maybe Paul can tell us more.

There is also a chance that VLC has some defaults set for "better default
compatibility" (ahem) with files satisfying certain (legacy) criteria,
which may lead to "surprising" results.
The same would apply for any other given decoder.
What matters, and I think this is what Paul was mentioning earlier, is
whether the encoding on ffmpeg's side is consistent and (ideally) correct
for the parameters supplied by the user and used as defaults (as defined by
one or more standards, or plain and simple logic). What visual result a
decoder is producing is a different question.

Erik


More information about the ffmpeg-user mailing list