1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-11-23 21:54:53 +02:00
Commit Graph

121072 Commits

Author SHA1 Message Date
James Almer
74e430202d avformat/mov: make items referencing items generic
Signed-off-by: James Almer <jamrial@gmail.com>
2025-09-01 12:07:14 -03:00
James Almer
6a115e2066 avformat/mov: reduce code duplication when setting tile group properties
Signed-off-by: James Almer <jamrial@gmail.com>
2025-09-01 12:07:14 -03:00
James Almer
11d9d7b8f3 avformat/dump: print side data type names generically
Based on vf_showinfo behavior.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-09-01 12:07:14 -03:00
James Almer
e62f9a071b ffprobe: print EXIF packet side data size
Signed-off-by: James Almer <jamrial@gmail.com>
2025-09-01 12:07:14 -03:00
James Almer
4ffd621523 avcodec/packet: add an Exif side data type
Signed-off-by: James Almer <jamrial@gmail.com>
2025-09-01 12:07:07 -03:00
James Almer
45dcfb2d60 avcodec/version_major: remove unnecessary define for an internal function
It being avpriv and not public, it can be removed in the next bump regardless of when it
happens.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-09-01 11:00:44 -03:00
Henrik Gramner
a66a260ae9 vp9: Add 8bpc intra prediction AVX2 asm 2025-09-01 13:54:52 +00:00
Zhao Zhili
9a34ddc345 avformat/movenc: remove mvex from final mp4 in hybrid_fragmented mode
In hybrid_fragmented mode, the first moov at start should contain
mvex tag, since it's fmp4. When writing the moov at the second time,
it's not fmp4 any more, so mvex should be skipped.
2025-09-01 12:41:38 +00:00
Cameron Gutman
126671e730 avcodec/mfenc: add AVLowLatencyMode support
Set CODECAPI_AVLowLatencyMode when AV_CODEC_FLAG_LOW_DELAY is enabled on
the AVCodecContext. AVLowLatencyMode can acheive lower latency encoding
that may not be accessible using eAVScenarioInfo options alone.

Signed-off-by: Cameron Gutman <aicommander@gmail.com>
2025-09-01 12:40:36 +00:00
Zhao Zhili
f2414fb1aa .forgejo/CODEOWNERS: add myself for various files
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-09-01 11:14:30 +00:00
Martin Storsjö
3ea6c2fe25 aacencdsp: Improve consistency with assembly, for x87 math
Currently, the aacencdsp checkasm tests fails for many seeds,
if the C code has been built with x87 math. This happens because
the excess precision of x87 math can make it end up rounding
to a different integer, and the checkasm tests checks that the
output integers match exactly between C and assembly.

One such failing case is "tests/checkasm/checkasm --test=aacencdsp
41" when compiled with GCC. When compiled with Clang, the test
seed 21 produces a failure.

To avoid the issue, we need to limit the precision of intermediates
to their nominal float range, matching the assembly implementations.

This can be achieved when compiling with GCC, by just adding a single
cast.

To observe the effect of this cast, compile the following
snippet,

    int cast(float a, float b) {
        return (int)
    #ifdef CAST
            (float)
    #endif
            (a + b);
    }

with "gcc -m32 -std=c17 -O2", with/without -DCAST. For x86_64
cases (without the "-m32"), the cast doesn't make any difference
on the generated code.

This cast would seem to not have any effect, as a binary expression
with float inputs also would have the type float.

However, if compiling with GCC with -fexcess-precision=standard,
the cast forces limiting the precision according to the language
standard here - according to the GCC docs [1]:

> When compiling C or C++, if -fexcess-precision=standard is
> specified then excess precision follows the rules specified in
> ISO C99 or C++; in particular, both casts and assignments cause
> values to be rounded to their semantic types (whereas -ffloat-store
> only affects assignments). This option is enabled by default for
> C or C++ if a strict conformance option such as -std=c99 or
> -std=c++17 is used.

Ffmpeg's configure scripts enables -std=c17 by default.

This only helps with GCC though - the cast doesn't make any
difference for Clang. (Although, upstream Clang seems to default
to SSE math, while Ubuntu provided Clang defaults to x87 math.)
Limiting the precision with Clang would require casting to volatile
float for both intermediates here - and that does have a code
generation effect on all architectures.

[1] https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
2025-09-01 09:22:39 +00:00
Timo Rothenpieler
883162d5b4 forgejo/workflows: make autolabel workflow always use token from secrets
Using the built-in token seems to only partially work.
And in the latest Forgejo release the issue forcing the use of the
built-in token was fixed with:

https://codeberg.org/forgejo/forgejo/pulls/9025
2025-09-01 03:02:51 +02:00
Cameron Gutman
b2910ec92e avcodec/mfenc: fix memory leak with D3D11 input surfaces
Fixes: d56522c6eb ("avcodec/mfenc: add support for D3D11 input surfaces")
Signed-off-by: Cameron Gutman <aicommander@gmail.com>
2025-08-31 14:36:20 -05:00
YiboFang
ae448e00af avcodec/pcm: use compile-time guards for PCM table init
Change the PCM table init to use compile-time #if instead of a runtime
`if (CONFIG_...)`. This makes sure code for disabled encoders never gets
built, without depending on compiler dead-code elimination.

Signed-off-by: YiboFang <fangyibo@xiaomi.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-08-31 21:40:29 +08:00
Gyan Doshi
f317b6c052 lavc/codec_desc: add lossless flags for hevc and av1
Both codecs support a lossless mode akin to H.264/AVC
2025-08-31 16:48:03 +05:30
Tong Wu
9893d66add avcodec/d3d12va_encode: add max_frame_size option
Add the max_frame_size option to support setting max frame size in
bytes. Max frame size is the maximum cap in the bitrate algorithm per
each encoded frame.

Signed-off-by: Tong Wu <wutong1208@outlook.com>
2025-08-31 10:46:11 +00:00
Marton Balint
2296a9c1bc avutil/bprint: fix av_bprint_strftime with %p format string reporting truncated output
strftime returns 0 in case of an empty output (e.g. %p format string with some
locales), there is no way to distinguish this from a buffer-too-small error
condition. So we must use some heuristics to handle this case, and not consume
INT_MAX RAM and falsely report a truncated output.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-08-31 09:37:59 +02:00
Marton Balint
50e94aadb2 avutil/bprint: make av_bprintf use av_vbprintf
No reason to duplicate the code.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-08-31 09:37:59 +02:00
Peter Ross
16d32a1c1d libavcodec/dpxenc: map AVCodecContext color transfer and color primaries fields 2025-08-31 07:05:36 +00:00
Peter Ross
6d7daaab0a avcodec/dpx: move enum DPX_TRC and DPX_COL_SPEC to dpx.h 2025-08-31 07:05:36 +00:00
Marton Balint
7a774829f9 avutil/opt: also print option names on parse error
It is more user-friendly to print which option caused the parse error.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-08-30 18:46:15 +00:00
Vittorio Palmisano
73d411c399 avfilter/af_whisper: fix srt file format
The SRT file format requires commas in the time string, not periods.
2025-08-30 14:30:51 +00:00
Leo Izen
3a0e324ab9 .forge/CODEOWNERS: add myself to EXIF code
Now that the major EXIF overhaul has been merged, I should be suggested
to review patches that modify it.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2025-08-30 08:34:34 -04:00
James Almer
2fffa01ddb avcodec/x86/vp9dsp_init: remove preprocessor checks for some prototypes
Fixes compilation with --disable-avx512icl

Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-29 14:02:49 -03:00
Nicolas Gaullier
7252f6c0bf avcodec/version: update the codec_ids
The counters should be incremented for each new codec.
Catch-up to be in sync with codec_id.h again.

Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
2025-08-29 17:32:52 +02:00
Niklas Haas
4ede75b5f4 swscale/graph: fix double-free when legacy pass fails initializing
If this function returns an error after ff_sws_graph_add_pass() has been
called, and the pass->free callback is therefore already set up to free the
context, the graph will end up freed twice: once by the pass->free callback
(during ff_sws_graph_free()), and once before that by failure path of the
caller (e.g. add_legacy_sws_pass(), or init_legacy_subpass() itself for
cascaded contexts.)

The solution is to redefine the ownership of SwsGraph to pass clearly from
the caller of add_legacy_sws_pass() to init_legacy_subpass(), which can then
deal with appropriately freeing the context conditional on whether or not the
pass was already registered in the pass list.

Reported-by: 김영민 <kunshim@naver.com>
Signed-off-by: Niklas Haas <git@haasn.dev>
2025-08-29 13:22:03 +00:00
Daniil Cherednik
0828a3b636 avcodec/atrac3: fix inconsistent band num calculation
'decode_spectrum' reads 5 bits from bitstream to get
number of encoded subbands – so 31 means all 32
subbands are encoded. This value also is used to
determinate the number of used band in the hybrid
filterbank.

'subband_tab' array contains 33 values of MDCT spec
line positions started from 0 line and used to map
subband number in to the range of mdct lines.

Since the subband_num returned by decode_spectrum
actually is number – 1 and subband_tab started from 0
we need to add 1 to make num_bands calculation correct.
2025-08-29 12:29:52 +00:00
Timo Rothenpieler
e3f01682d7 forgejo/labeler: react to 'labeled' action as well 2025-08-29 01:12:20 +02:00
Henrik Gramner
10a061ba99 vp9: Add AVX-512ICL asm for 8bpc subpel mc 2025-08-28 12:45:52 +00:00
Michael Niedermayer
76645e096f avcodec/exif: also copy zero termination for AV_TIFF_STRING
Fixes: out of array read
Fixes: 441131173/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_DEC_fuzzer-6700429212975104

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-27 15:46:35 +00:00
Leo Izen
041651841a avcodec/libjxlenc: fix leaked EXIF ifd
We're missing a call to av_exif_free here. We leak the internal heap-
allocated objects when &ifd goes out of scope.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2025-08-27 05:28:31 -04:00
Leo Izen
a8d6b87a44 avcodec/libjxldec: fix leaked EXIF ifd
We're missing a call to av_exif_free here. We leak the internal heap-
allocated objects when &ifd goes out of scope.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2025-08-27 05:26:03 -04:00
Levi Zim
c2d17c4db8 avutil/riscv: avoid redefinition of _GNU_SOURCE
Add #ifndef to avoid potential redefinition of _GNU_SOURCE macro.

Signed-off-by: Levi Zim <rsworktech@outlook.com>
2025-08-26 15:08:52 +00:00
James Almer
70a6ad6c74 fftools/ffmpeg_demux: ensure the display_rotation option is honored
If requested, it should have priotity over any coded value.
Fixes ticket #11649.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-26 11:44:09 -03:00
Raphaël Zumer
ae14930176 avcodec/webp: simplify special-case handling when building Huffman reader
Signed-off-by: Raphaël Zumer <rzumer@tebako.net>
2025-08-26 14:42:47 +00:00
Raphaël Zumer
d1a7a20cb1 avcodec/webp: fix incorrectly returning AVERROR_INVALIDDATA when building Huffman reader
This corrects an error in commit c33f16d.

Signed-off-by: Raphaël Zumer <rzumer@tebako.net>
2025-08-26 14:42:47 +00:00
Marton Balint
a8097d32ae avformat/img2dec: remove deprecated glob_sequence pattern type
"glob_sequence" was deprecated since 2012. This also changes the default pattern
to "sequence", because "glob_sequence" was also the default.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-08-26 14:41:44 +00:00
Jack Lau
4811518143 avformat/whip: set the first sequence number for video and audio
simply whip->audio_first_seq + 1 for video could be
faster than generating a new one.

this patch will make whip be able to get the first
rtp seq easily and compute something sequence-based
(e.g. NACK and RTX handling)

Signed-off-by: Jack Lau <jacklau1222@qq.com>
2025-08-26 02:36:06 +00:00
James Almer
db2af6fd42 configure: support linking to base profile libxev{d,e}
Addresses issue #20328.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-25 18:47:56 +00:00
James Almer
fa23202cc7 configure: bump LCEVCdec minimum required version to 4.0.0
The project introduced API breaking changes to some of their public functions,
and given the library is relatively new, just bump the minimum supported
version instead of adding ifdeffery to the source files.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-25 10:43:23 -03:00
yangsen5
6c07a4f558 avformat/file: add pkt_size option
The min_packet_size/max_packet_size were hardcoded to 256KB for
performance. The new option makes it possible to configure a
smaller packet size on embedded devices with limited memory
resources.

Signed-off-by: yangsen5 <1441923451@qq.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-08-25 18:15:17 +08:00
Robert Nagy
1b62f9d3ae avfilter/vf_scale: add more color_matrix aliases
Add more color_matrix aliases to make vf_scale consistent with e.g. vf_setparams aliases.
2025-08-25 08:12:37 +00:00
Muiz Yusuff
2ffc138e8a mov demuxer: use int64_t for next_ts
d1b96c3808 fixes some hevc seeking issues
but will int overflow when timestamp is >int_max.
2025-08-25 02:25:50 +00:00
James Almer
7df9fae4f7 Changelog: move the latest entries to the correct section
They are not in 8.0

Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-24 23:23:48 -03:00
Leo Izen
ef9fe0fe0b avcodec/exif: avoid allocation failure on empty EXIF metadata
An EXIF IFD with 0 entries is legal, but does not contain metadata. We
should not attempt to allocate a struct with size zero in this case, as
this causes an allocation failure. Instead, we just leave the struct
empty.

Fixes: #20305.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2025-08-24 20:20:10 +00:00
Leo Izen
2398fddf6e avcodec/exif: avoid writing native-endian EXIF buffers
Currently there's platform-dependent behavior where if no endianness
is requested, it writes the buffers in native-endian. This breaks FATE
tests on big-endian architecture. This commit changes the default to
little-endian buffers upon writing.

Fixes: #20291.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2025-08-24 20:20:10 +00:00
James Almer
2298d4d072 doc/APIchanges: add 8.0 cut line
Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-24 12:08:27 -03:00
Damiano Galassi
b2f5bc7fd3 movenc: ensure chapters track extradata is not null and populated
fix a regression introduced in 4eca8df,
writing chapters failed if chapters where
not available before mov_write_header().
2025-08-24 13:31:53 +00:00
James Almer
368b5e0ffc avcodec/exif: make the get and remove helpers take a flags argument as input
This makes the functions extensible, as future behavior change flags can be
introduced.

This is strictly speaking not an API break. Only if a user was setting
recursive to anything other than 1 it would now behave differently, but given
these functions have been in the tree for only a few days, the chances for that
are practically zero.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-24 12:34:15 +00:00
Jack Lau
b3ea558492 avformat/whip: fix ssrc might be same
use audio_ssrc + 1 for video_ssrc to avoid ssrc collision

See RFC 3550 Section 8,
The SSRC identifier carried in the RTP header and in various fields
of RTCP packets is a random 32 bit number that is required to be
globally unique within an RTP session.

simply + 1 also can get an unique ssrc, and faster than generating
new unique ssrc.

Signed-off-by: Jack Lau <jacklau1222@qq.com>
2025-08-23 17:20:32 +08:00