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

Paul B Mahol onemda at gmail.com
Thu Sep 15 01:30:34 EEST 2022


On 9/15/22, Dan <twinbee42 at skytopia.com> wrote:
>> zscale=...,format=yuv420p
>
> Ohhhh.... okay. I tried that before (except using two -vf commands), because
> I
> suspected you might've meant that.
>
> Just tried it again, still no luck. Let me know if I need to tweak
> anything:
>
> ffmpeg.exe -f lavfi -i color=0x19be0f:s=400x578 -crf 0 -vcodec libx264 -vf
> zscale=w=-1:h=-1,format=yuv420p -t 5 -y "578.mp4"
>
> I'm using Media Player Classic to test the colours, which breaks the pic
> using the 578 pixel
> height. Chrome actually works with both the 576 and 578 pixel height, but as
> soon as I
> change the height to 984, then both Media Player Classic AND Chrome show it
> broken.
>
> Datascope shows the strange and seemingly unrelated 78,4C,44 values for all
> three sizes,
> but it does that even without using zscale at all.

Good, we move forward, that are real values encoded in bitstream.

Anything RGB values you complain about have nothing directly related
about ffmpeg.

Also make sure that all software are reinterpreting your files correctly.
The files need to signal correct encoded colorspace/primaries/range/etc so
it can be correctly displayed on screen.

-vf showinfo will show it for encoded files.

If it shows bunch of unknown/unknown it explains why every player
display it in different/own/special way.

ffmpeg also have options to set/signal video parameters(colorspace/range/etc)
but not all codecs or containers store such info.


>
> Dan
>
>>
>> Here both zscale/scale gives same output pixel values.
>> I use datascope filter to inspect it.
>>
>> ffplay input.file -vf datascope
>> _______________________________________________
>> 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".
> _______________________________________________
> 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