[FFmpeg-devel] [PATCH 13/22] fftools/ffmpeg_filter: stop disregarding user-specified pixel format

Michael Niedermayer michael at niedermayer.cc
Sun Jul 9 01:15:30 EEST 2023


On Fri, Jul 07, 2023 at 11:48:38AM +0200, Anton Khirnov wrote:
> When the user explicitly specifies a pixel format that is not supported
> by the encoder, ffmpeg CLI will currently use some heuristics to pick
> another supported format. This is wrong and the correct action here is
> to fail.
> 
> Surprisingly, a number of FATE tests are affected by this and actually
> use a different pixel format than is specified in the makefiles.
> ---
>  fftools/ffmpeg_filter.c                       | 36 ++-----------------
>  tests/fate/fits.mak                           |  6 ++--
>  tests/fate/lavf-video.mak                     |  2 +-
>  tests/fate/vcodec.mak                         |  4 +--
>  .../{fitsdec-gbrap16le => fitsdec-gbrap16be}  |  4 +--
>  .../fate/{fitsdec-gbrp16 => fitsdec-gbrp16be} |  4 +--
>  tests/ref/lavf/gif                            |  2 +-
>  7 files changed, 13 insertions(+), 45 deletions(-)
>  rename tests/ref/fate/{fitsdec-gbrap16le => fitsdec-gbrap16be} (79%)
>  rename tests/ref/fate/{fitsdec-gbrp16 => fitsdec-gbrp16be} (79%)

breaks png

./ffmpeg -y  -i lena.pnm -s 696x300 -pix_fmt rgb48 -y out2.png

Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height.
Conversion failed!

before
./ffprobe out2.png
...
Stream #0:0: Video: png, rgb48be(pc, gbr/unknown/unknown), 696x300, 25 fps, 25 tbr, 25 tbn

Yes internally its BE vs LE but thats not what the user wrote on the command line

thx


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20230709/92f4299a/attachment.sig>


More information about the ffmpeg-devel mailing list