ffmpeg/fftools
Andreas Rheinhardt 4e39cd67b7 fftools/ffmpeg_filter: Fix check for mjpeg encoder
The MJPEG encoder supports some pixel format/color range combinations
only when strictness is set to unofficial or less. Before commit
059fc2d9da said encoder's pix_fmts array
only included the pixel formats supported with default strictness.
When strictness was <= unofficial, fftools/ffmpeg_filter.c used
an extended list of pixel formats instead of the encoder's including
the pixel formats only supported when strictness <= unofficial.

Said commit turned the logic around: The encoder's pix_fmts array now
included all pixel formats and fftools/ffmpeg_filter.c instead used
a small list of all pixel formats supported when strictness is >
unofficial and the encoder's pixel formats instead. In particular,
the codec's pix_fmt is not used when strictness is normal.

This works for the mjpeg encoder; yet it did not work for other
(hardware-based) mjpeg encoders, because the check for whether one is
using the MJPEG encoder is wrong: It just checks the codec id.
So if one used strict unofficial with a hardware-accelerated MJPEG
encoder before commit 059fc2d9da, the unofficial (non-hardware)
pixel formats of the MJPEG encoder would be used; since said commit
the codec's pixel formats are overridden at ordinary strictness
by the ordinary MJPEG pixel formats. This leads to format conversion
errors lateron which were reported in #9186.

The solution to this is to check AVCodec.name instead of its id.

Fixes ticket #9186.

Tested-by: Eoff, Ullysses A <ullysses.a.eoff@intel.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-13 21:58:25 +02:00
..
cmdutils.c cmdutils: replace strncpy() with direct assignment 2021-03-16 10:41:01 +01:00
cmdutils.h fftools: Switch to const AVCodec * where possible 2021-03-02 08:20:10 +01:00
ffmpeg_filter.c fftools/ffmpeg_filter: Fix check for mjpeg encoder 2021-04-13 21:58:25 +02:00
ffmpeg_hw.c ffmpeg: Don't require a known device to pass a frames context to an encoder 2020-05-03 16:04:27 +01:00
ffmpeg_opt.c fftools/ffmpeg: use av_packet_alloc() to allocate packets 2021-03-17 15:19:38 -03:00
ffmpeg_qsv.c ffmpeg: Remove the hw_device_ctx global 2020-04-26 18:38:25 +01:00
ffmpeg_videotoolbox.c Stop hardcoding align=32 in av_frame_get_buffer() calls. 2020-05-22 14:38:57 +02:00
ffmpeg.c fftools/ffmpeg: copy average framerate for streamcopy, when known 2021-04-08 11:03:15 +02:00
ffmpeg.h fftools/ffmpeg: use av_packet_alloc() to allocate packets 2021-03-17 15:19:38 -03:00
ffplay.c fftools/ffplay: do not write out of rdft visualization texture 2021-03-10 20:01:03 +01:00
ffprobe.c fftools/ffprobe: Add missing dispositions 2021-03-31 11:51:58 +02:00
Makefile ffmpeg: remove superfluous custom cuvid hwaccel 2020-03-03 18:11:28 -03:00