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

Dan twinbee42 at skytopia.com
Thu Sep 15 00:21:31 EEST 2022


On Wed, 14 Sep 2022 21:26:59 +0100, Carl Zwanzig <cpz at tuunq.com> wrote:

> On 9/14/2022 8:01 AM, Paul B Mahol wrote:
>> The reason of scale behavior is known and legacy.
>
> Is it documented with the filter? I don't see anything obvious about it at
> https://ffmpeg.org/ffmpeg-filters.html#toc-scale-1, where can a person find
> about this otherwise-known behavior?

To be fair, Paul did suggest the use of the zscale filter instead of using scale.
I actually managed to get the line to run in the end. I just needed to put the
"zscale=w=-1:h=-1" bit at the end like this:

ffmpeg.exe -i "input.bmp" -crf 0 -vcodec libx264 -t 5 -y "output.mp4" -vf zscale=w=-1:h=-1

Unfortunately, I'm still getting the same darkening problem. The second mp4 is darker
than the first.

Even tried using Michael's direct colour technique combined with zscale:

ffmpeg.exe -f lavfi -i color=0x19be0f:s=400x576 -crf 0 -vcodec libx264 -vf zscale=w=-1:h=-1 -t 5 -y "576.mp4"
ffmpeg.exe -f lavfi -i color=0x19be0f:s=400x578 -crf 0 -vcodec libx264 -vf zscale=w=-1:h=-1 -t 5 -y "578.mp4"

Again, no luck. Second is darker.

Unless I'm somehow misusing zscale (which is a possibility), it would seem as if the
problem lies elsewhere.

Dan


More information about the ffmpeg-user mailing list