1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00
Commit Graph

120218 Commits

Author SHA1 Message Date
8087777e66 avcodec/liboapvenc: set the encoder output to OAPV_CFG_VAL_AU_BS_FMT_NONE format
The only AU without bitstream format.

Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-06-17 10:03:10 -03:00
5d380e4431 configure: Update liboapv version requirement
Changed the minimum required version of liboapv from 0.1.13 to 0.1.13.1

Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-06-17 10:02:44 -03:00
53da090ab7 configure: fix Microsoft tools detection
LLVM tools print installation path upon execution. If one uses LLVM
tools bundled with Microsoft Visual Studio installation, they would be
incorrectly detected as Microsoft's ones.

Microsoft tools can have localized names, so a more specific string
check is not feasible, but luckily we can test if "Microsoft" is at the
beginning of the line, as it is always the case.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2025-06-17 11:51:33 +03:00
38073187bd avcodec/tests/dct: add CONFIG_PRORES_DECODER guard
Only enable the proresdsp check when the prores decoder is enabled.

This fixes fate when configuring with --disable-everything
2025-06-17 16:41:14 +10:00
2663d97336 configure: add celp_math component
libavcodec/tests/celp_math depends on libavcodec/celp_math.o

This fixes fate when configuring with --disable-everything
2025-06-17 16:39:36 +10:00
e5bb448543 vulkan: maintain compatibility with old headers
Previous patch to fix these issues was incomplete.
2025-06-17 13:26:13 +09:00
d71c863132 fate/video: Add media100 test
Tests both the Media 100 decoder (using the media100_to_mjpegb BSF
implicitly) as well as using said BSF, followed by the MJPEGB decoder.

(We currently hit a bug when remuxing: The demuxer treats compressorname
as encoded in a Mac character encoding (Mac OS Roman?) and converts
it to UTF-8, yet the muxer just writes it.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-17 00:35:13 +02:00
ecd7c9244d avcodec/amfdec,rkmppdec: Use correct extradata with BSFs
Otherwise the extradata used would be ISOBMFF if the input is
even though we use the *_mp4toannexb BSFs to convert it to
annex B to feed it to the actual decoder.

(The mediacodec decoders also use said BSFs, yet they process
the extradata in a way that works even when using the ISOBMFF
extradata; in fact, using the converted extradata would break
their check for whether to warn for missing extradata for
the ISOBMFF without-in-band-header profiles.

Furthermore, there are several users of the *_mp4toannexb BSFs
that don't ever touch extradata. They have not been touched.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-17 00:35:13 +02:00
9102a90a95 Revert "avcodec/decode: Fix avcodec parameters when bsfs are enable by decoder"
This reverts commit 1c17061397.

The commit intended to provide certain codecs using *_mp4toannexb
bitstream filters with updated (annex B) extradata (even when
the user-supplied one was ISOBMFF), yet BSFs are allowed to change
way more. The media100_to_mjpegb BSF used by the media100 decoder
changes the codec id; the commit being reverted therefore changed
AVCodecContext.codec_id which is an API violation and broke
media100 decoding with the FFmpeg cli tool.

This commit also made changes from the internal BSF externally
visible. extradata is documented to be "owned by the codec and
freed in avcodec_free_context()" which does not include replacing
it with something else in avcodec_open2() and may surprise users
who think that AVCodecContext.extradata is immutable before
avcodec_free_context(). It also incurred a memdup which is completely
unnecessary for most decoders.

Therefore this commit is reverted. The problem it tried to solve
will be solved differently in the next commit.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-17 00:35:13 +02:00
730ffc5d35 avfilter/vf_overlay: Hoist calculations out of loop
Also use const where appropriate.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-17 00:33:09 +02:00
a4b3474de6 avfilter/vf_overlay: Keep dst_step in bytes
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-17 00:33:09 +02:00
48427b012d avfilter/vf_overlay: Use correct alpha when > 8 bits
When chroma subsampling is in use, the filter averages
the corresponding (non subsampled) alpha values to get
the actual alpha value. When vertical subsampling is
in use, the next line is accessed via a[src->linesize[3]],
yet a is an uint16_t* for >8 bit formats and linesize
is always in bytes, so that this actually uses the second
line below the current one. This is fixed in this commit.

No FATE test needed updates, because the filter-overlay-yuv420p10
and filter-overlay-yuv444p10 tests use a yuv420p test file
that has constant opacity after conversion to yuva.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-17 00:33:09 +02:00
b3edc84872 avfilter/vf_overlay: Pass variable type directly in macro
Improves readability.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-17 00:33:09 +02:00
ca51a0fef7 avfilter/vf_overlay: Avoid converting stride to uint16_t and back
Just keep the pointers for the beginning of a line uint8_t*
and use uint16_t* to do the actual processing.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-17 00:33:09 +02:00
eeb82a4406 avfilter/vf_overlay: Don't perform UB pointer arithmetic
This happens when the pixel format of the output does not
have an alpha channel. It leads to FATE failures with
the ffmpeg-filter_colorkey, filter-overlay-dvdsub-2397
filter-overlay,
filter-overlay_{gbrp_gbrap,nv12,nv21,yuv420,yuv420_yuva420,
yuv420p10,yuv422_yuva422,yuv422p10,yuv444_yuva444,yuv444p10}
and sub2video tests when using Clang UBSan.

Fix this by only performing the pointer arithmetic when
it is going to be used. This can be checked via variables
that compile-time constants due to inlining, so that the
checks are free. Given that the pointer is potentially
used as a function argument, the compiler could elide
the calculation, but not it can. The size of .text decreased
by 1632B with GCC 14 and by 1392B with Clang 19 (both -O3).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-17 00:33:09 +02:00
0ae55affa3 avformat/dhav: Check reading data
Prevents potential use of uninitialized data.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-17 00:30:30 +02:00
e3ba364c5e avformat/dhav: Fix check for seekability
AVIOContext.seekable is a bitfield. Also check for seekability
earlier.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-06-17 00:30:30 +02:00
93987c03ec avfilter/vf_libplacebo: Use new vulkan queue API
Fixes deprecation warning.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-06-16 20:46:10 +02:00
04ceabe2ba avfilter/vf_scale: set correct AVFrame SAR if reset_sar=1
This otherwise generates an inconsistency between the frame state and the
link state, since the link state is set to 1:1 explicitly when `reset_sar`
is enabled, but this line of code unconditionally overwrote the output
frame SAR with the value that would be computed in the absence of `reset_sar`.

cf. vf_scale_cuda, which does this correctly
2025-06-16 20:44:52 +02:00
e6fb8f373e doc/encoders: Document mediacodec wrapper
Reviewed-by: Marth64 <marth64@proxyid.net>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-06-16 10:57:06 +08:00
808c6853e1 avcodec/mediacodecenc: Fix typo in VP9 option description
Reviewed-by: Marth64 <marth64@proxyid.net>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-06-16 10:55:59 +08:00
920071355d avformat/movenc: Fix editlist with hybrid_fragmented
The segment_duration must not be set to zero when writing the moov
atom for the second time. This is related to edit lists in standard
MP4 files.

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-06-16 10:55:04 +08:00
98c281152c avcodec/mediacodecdec: replace memset with direct zero init
Reviewed-by: Matthieu Bouron <matthieu.bouron@gmail.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-06-16 10:53:09 +08:00
b65fece0aa avformat/rtmpproto: fix rmtp packet leak in gen_connect()
In libavformat/rtmpproto.c:gen_connect(), if check on string length
or check on codec fourcc failed, ff_rtmp_packet_create() allocated
data in pkt would leak. Add ff_rtmp_packet_destory before return error
code.

Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
Reviewed-by: Zhao Zhili <quinkblack@foxmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-06-16 01:31:45 +02:00
0d9f680b69 checkasm: h264dsp: test luma_dc_dequant
Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-06-16 01:31:45 +02:00
5ea3adfcf9 checkasm: add checkasm_check_dctcoef
This is useful for tests that compare dctcoefs which will be either 2 bytes or
4 bytes, depending on bitdepth.

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-06-16 01:31:44 +02:00
8fc91ea936 avformat/hls: fix typo in Range header comment (chore)
Signed-off-by: Marth64 <marth64@proxyid.net>
2025-06-15 12:23:37 -05:00
f8c8e1f39d avformat/dvdvideodec: fix seeking on multi-angle discs
When seeking on multi-angle titles, libdvdnav does not lock on
to the correct sectors initially as it seeks to find the right NAV packet.

This manifests itself as two bugs:
(1) When seeking on the first angle in a multi-angle segment,
frames from another angle will appear (for example in intro
or credits scenes). This issue is present in VLC also.

(2) When seeking during a segment on angle n+1, the demuxer
cannot deduce the right position from dvdnav and does not allow
seeking within the segment (due to it maintaining a strict state).

Correct the issue by switching to angle 1 before doing the seek
operation, and skipping 3 VOBUs (NAV packet led segments) ahead
where dvdnav will have positioned itself correctly.

Reported-by: Kacper Michajlow <kasper93@gmail.com>
Signed-off-by: Marth64 <marth64@proxyid.net>
2025-06-15 12:22:23 -05:00
693703bcdb avformat/dvdvideodec: remove unused has_cc field
Signed-off-by: Marth64 <marth64@proxyid.net>
2025-06-15 12:22:17 -05:00
f66ae1ba24 avformat/dump: lowercase 'Start' prefix for start offset
Just applying some UX polish.
This is to match the lowercase trend of attributes in
the dump string (and similar to chapters).

Signed-off-by: Marth64 <marth64@proxyid.net>
2025-06-15 12:22:10 -05:00
90424a4475 various: fix typos
usefull -> useful
seperately -> separately
reciever -> receiver

Signed-off-by: Clément Péron <peron.clem@gmail.com>
2025-06-15 21:00:38 +05:30
52441bd4cd avformat/rtpdec: explicit timestamp wraparound handling
Change delta_timestamp to int32_t and add explicit cast to handle
RTP timestamp wraparound correctly. This fixes implementation-defined
behavior when computing negative timestamp differences due to 32-bit
wraparound.

Signed-off-by: Clément Péron <peron.clem@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-06-14 23:41:38 +02:00
3f1f9db7f5 avfilter/vf_mcdeint: add yuv444p support to mcdeint
Signed-off-by: Ethan Halsall <ethanhalsall11@augustana.edu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-06-14 23:41:38 +02:00
fb65ecbc9b avutil: Fix linking x86 asm constants with Clang in MSVC mode
This fixes building with Clang in MSVC mode, for x86, which was
broken in 6e49b86996 (in Nov 2024);
previously it failed with undefined symbols for the constants
defined with DECLARE_ASM_CONST, accessed via inline assembly.

Before 57861911a3, there was an
    #elif defined(__GNUC__) || defined(__clang__)
case before the
    #elif defined(_MSC_VER)
case for defining DECLARE_ASM_CONST, which included av_used.
(This case included the explicit "defined(__clang__)" since
f637046d3134a331e4b5a7243ac3dfb92735b8a5.)

After 57861911a3, it used the
generic definition of DECLARE_ASM_CONST that also included
av_used - which also worked for Clang in MSVC mode. But after
6e49b86996, Clang in MSVC mode
ended up using the MSVC specific variant which lacked the
av_used declaration, causing linker errors due to undefined
symbols.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-06-13 11:36:20 +03:00
58f3d8a461 avutil/hwcontext_videotoolbox: fix color primaries check
Fix incorrect enum value used in color primaries check by replacing
AVCOL_SPC_UNSPECIFIED with AVCOL_PRI_UNSPECIFIED.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2025-06-13 08:41:53 +08:00
f3bf535696 avcodec/libx264: Remove unnecessary include
eval is for av_strtod, which wasn't been used by libx264 now.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-06-12 23:07:13 +08:00
9ad6dca28c avcodec/vvc: parse all SEI messages
While the current code iterated over the messages, it always returned
in the first iteration. Instead keep iterating and warn for failure to
parse. At time of writing, none of the parsing functions seems to
actually return an error, ever.

Fix CID 1648348
2025-06-12 21:17:07 +08:00
3d7668dae1 avcodec/vvc/dec: fix possible null-pointer dereference
When checking for filmgrain here, needs_fg can be true even when
film_grain_characteristics is NULL (when aom_film_grain.enable is true),
therefore this check could end up dereferencing film_grain_characteristics
even though it is NULL.

Fix CID 1648347
2025-06-12 21:16:46 +08:00
26807592e1 avformat/internal: add missing __clang__ check
Clang x86_64-pc-windows-msvc doesn't define __GNUC__.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2025-06-12 14:17:38 +03:00
43dc443446 avutil/intmath: use AV_HAS_BUILTIN to detect builtin availability
Fixes use of bultins on clang x86_64-pc-windows-msvc which does not
define any __GNUC__. Also on other targets __GNUC__ is defined to 4 by
default, so any feature testing based on version is not really valid.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2025-06-12 14:17:37 +03:00
f019dd69f0 ffmpeg_demux: init resume_warn variable
Fixes an uninitialized read introduced with
6232f416b1

Fix CID 1643162 Uninitialized scalar variable
2025-06-11 19:32:05 +02:00
089e69dfe4 lavfi/f_sendcmd: clear Command on alloc failure
If the command array failed to allocate, the current parsed
Command has to be cleared, else memory allocated for it
would be leaked.

Fix CID 1638635
2025-06-11 19:26:22 +02:00
2c3ac6e0fa lavfi/f_sendcmd: add helper to clear Command
Makes clearing the Command more explicit and
consistent.
2025-06-11 19:26:22 +02:00
93255f1c48 avformat/sdp: add framerate entry
This also updates fate-lavf-mov_rtphint as there the SDP
is included in the muxed file.
2025-06-11 19:19:50 +02:00
e8199f95d6 avformat/rtpdec_jpeg: Set width and heigh codec parameters
Signed-off-by: Marvin Scholz <epirat07@gmail.com>
2025-06-11 19:19:50 +02:00
c917f28c49 avformat/rtsp: parse framerate in sdp
Co-authored-by: Marvin Scholz <epirat07@gmail.com>
Signed-off-by: Marvin Scholz <epirat07@gmail.com>
2025-06-11 19:19:50 +02:00
2dcd9c5aac doc: use av_dict_iterate in documentation example 2025-06-11 19:19:50 +02:00
922a1ca989 vulkan: maintain compatibility with older headers 2025-06-12 00:17:29 +09:00
3ac7d70291 hwcontext_vulkan: fix image copy
The patch was applied by mistake in an unfinished form.
This fixes the build and lets the code run.
2025-06-11 14:33:01 +09:00
9e93163268 vulkan/ffv1dec: fix FFVkSPIRVCompiler leak 2025-06-11 13:30:07 +09:00