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

Paul B Mahol onemda at gmail.com
Wed Sep 14 18:01:39 EEST 2022


On 9/14/22, Michael Koch <astroelectronic at t-online.de> wrote:
> Am 14.09.2022 um 11:21 schrieb Dan:
>> Using the latest 5.1.1 "essentials build" by www.gyan.dev.
>>
>> Hi all, I'm a beginner to ffmpeg so I'm having a hard time believing
>> that a utility so old and so widely used has such a fundamental bug,
>> but the evidence is staring me in the face and leads me to no other
>> conclusion.
>>
>> It's incredibly easy to replicate thankfully. I want to convert
>> numerous frames to make an animation, but thankfully, I've simplified
>> the problem to even using a single image to make a '1 frame video' for
>> the purposes of debugging.
>>
>> Simply perform this command line:
>>
>> ffmpeg.exe -i original.png -crf 0 -vcodec libx264 output.mp4
>>
>> ...With this "original.png" ("fC2Tj") image:
>> https://i.stack.imgur.com/5jkct.png
>>
>> And this command line:
>>
>> ffmpeg.exe -i doubleHeight.png -crf 0 -vcodec libx264 output.mp4
>>
>> ...On this "doubleHeight" ("RGIvA") image:
>> https://i.stack.imgur.com/PLdsb.png
>>
>> The double height version is darker than it should be. I've checked
>> the resulting video in both Media Player Classic and Chrome.
>
> The issue can be reproduced without input images as follows:
>
> ffmpeg -f lavfi -i color=0x19be0f:s=400x576 -crf 0 -vcodec libx264 -t 5
> -y out1.mp4
> ffmpeg -f lavfi -i color=0x19be0f:s=400x578 -crf 0 -vcodec libx264 -t 5
> -y out2.mp4
>
> The color seems to be brighter if the height is 576 or smaller, and
> darker if the height is 578 or larger.
> It's clearly visible if you play both videos side by side. I did test
> with VLC Player and FFplay. I don't see how zscale could fix this issue.
>

Zscale is not scale filter, Next time be more constructive and try it
before pointlesly commenting here in so bold and arrogant fashion.

The reason of scale behavior is known and legacy.
If you do not want it you need to specify more options to filter.

Like specify colorspace and similar.

> Michael
>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
>


More information about the ffmpeg-user mailing list