1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-10-06 05:47:18 +02:00

121335 Commits

Author SHA1 Message Date
Marton Balint
2762ae74c5 avformat/tls: use ff_parse_opts_from_query_string() to set URL parameters
Note that this changes the code to work the same way as other protocols where
an URL parameter can override an AVOption.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-10-01 00:34:19 +02:00
Marton Balint
3166e3b539 avformat/rtpproto: use ff_parse_opts_from_query_string() to set URL parameters
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-10-01 00:34:19 +02:00
Marton Balint
f231439ee7 avformat/sctp: use ff_parse_opts_from_query_string() to set URL parameters
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-10-01 00:34:19 +02:00
Marton Balint
49c6e6cc44 avformat/tcp: use ff_parse_opts_from_query_string() to set URL parameters
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-10-01 00:34:19 +02:00
Marton Balint
7e58fff9d0 avformat/udp: use ff_parse_opts_from_query_string() to set URL parameters
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-10-01 00:34:19 +02:00
Marton Balint
2d06ed9308 avformat/libsrt: use ff_parse_opts_from_query_string() to set URL parameters
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-10-01 00:34:19 +02:00
Marton Balint
70e0e3e257 avformat/utils: add helper function to set opts from query string
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-10-01 00:34:18 +02:00
Marton Balint
c5be4b7075 avformat: compile urldecode unconditionally
It will be used by the generic helper function to set options from URLs.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-09-30 23:48:14 +02:00
Marton Balint
6f17053e6c avformat/urldecode: add ff_urldecode_len function
This will be used later to decode partial strings.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-09-30 23:48:14 +02:00
Michael Niedermayer
8cb1ff78ac avformat/dhav: Factorize some code in get_duration()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-09-30 21:13:56 +00:00
Niklas Haas
b80f28fcbc avfilter/vf_libplacebo: introduce fit_sense option
This allows choosing whether the `fit_mode` merely controls the placement
of the image within the output resolution, or whether the output resolution
is also adjusted according to the given `fit_mode`.
2025-09-30 15:39:39 +00:00
Niklas Haas
12d696cff4 avfilter/vf_libplacebo: introduce fit_mode option
The semantics of these keywords are well-defined by the CSS 'object-fit'
property. This is arguably more user-friendly and less obtuse than the
existing `normalize_sar` and `pad_crop_ratio` options. Additionally, this
comes with two new (useful) behaviors, `none` and `scale_down`, neither of
which map elegantly to the existing options.

One additional benefit of this option is that, unlike `normalize_sar`, it
does *not* also imply `reset_sar`; meaning that users can now choose to
have an anamorphic base layer and still have the overlay images scaled to fit
on top of it according to the chosen strategy.

See-Also: https://drafts.csswg.org/css-images/#the-object-fit
2025-09-30 15:39:39 +00:00
Niklas Haas
6ad839ff2e avfilter/vf_scale_*: add enum names for force_oar magic values 2025-09-30 15:39:39 +00:00
Gyan Doshi
74115b017c doc: indicate libmpeghdec is non-free 2025-09-30 11:55:02 +00:00
Niklas Haas
fd1fd5850d fftools/ffmpeg_sched: unchoke upstream nodes on recv-closed filter inputs
This allows upstream filters to observe EOF on their corresponding outputs
and terminate early, which is particularly useful for decoders and demuxers
that may then gracefully release their resources.

Prevents "leaking" memory for previously used, but now unused, filter inputs.
2025-09-30 13:16:59 +02:00
Niklas Haas
d43fd5b332 fftools/ffmpeg_sched: close stream when sch_filter_send receives EOF
THis is currently done by sch_demux_send() (via demux_stream_send_to_dst()),
sch_enc_send() (via enc_send_to_dst()), and sch_dec_send() (via
dec_send_to_dst()), but not by sch_filter_send().

Implement the same queue-closing logic for them. The main benefit here is that
this will allow them to mark downstream inputs as send-done (in addition
to received-done), which is useful for a following commit.
2025-09-30 13:16:59 +02:00
Niklas Haas
56d9ca69d7 fftools/ffmpeg_dec: free decoder ctx after EOF
The codec context is no longer used after the decoder thread exits, but
still idly sticks around until program exit, wasting memory.
2025-09-30 13:16:59 +02:00
Niklas Haas
9d0b88feb1 fftools/ffmpeg_sched: forward demuxer choke status to dst queues
Cut off a choked demuxer's output codec/filter queues, effectively preventing
them from processing packets while the demuxer is choked. Avoids downstream
nodes from piling up extra input that a demuxer shouldn't currently be
sending.

The main benefit of this is to avoid queuing up excess packets that don't want
to be decoded yet, reducing memory consumption for idle inputs by preventing
them from being read earlier than needed.
2025-09-30 13:16:59 +02:00
Niklas Haas
59a847a237 fftools/thread_queue: allow choking thread queues directly
Currently, when a demuxer thread is choked, it will avoid queuing more
packets, but any packets already present on the thread queue will still be
processed.

This can be quite wasteful if the choke is due to e.g. decoder not being
needed yet, such as in a filter graph involving concatenation-style filters.
Adding the ability to propagate the choke status to the thread queue directly
allows downstream decoders and filter graphs to avoid unnecessary work and
buffering.

Reduces the effective latency between scheduler updates and changes in the
thread workfload.
2025-09-30 13:16:59 +02:00
Niklas Haas
5f4cbb5617 fftools/ffmpeg_sched: choke inputs during filtergraph configuration
Currently, while the filter graph is being initially created, the scheduler
continues demuxing frames on the last input that happened to be active before
the filter graph was complete.

This can lead to an excess number of decoded frames "piling" up on this input,
regardless of whether or not it will actually be requested by the configured
filter graph. Suspending the filter graph during this initialization phase
reduces the amount of wasted memory.
2025-09-30 13:16:59 +02:00
Niklas Haas
23f1f094f8 fftools/ffmpeg_sched: get rid of src_sched
This field is just saving (typically) a single pointer indirection; and IMO
makes the logic and graph relations unnecessarily complicated. I am also
considering adding choking logic to decoders and encoders as well, which this
field would get in the way of.

Apart from the unchoking logic in unchoke_for_input(), the only other place
that uses this field is the (cold) function check_acyclic(), which can be
served just as well with a simple function to do the graph traversal there.
2025-09-30 13:16:59 +02:00
Niklas Haas
fd4b5b24ce fftools/ffmpeg_sched: lower default frame queue size
I tested this extensively under different conditions and could not come up
with any scenario where using a larger queue size was actually beneficial.
Moreover, having such a large default queue is very wasteful especially
for larger frame sizes; and can in the worst case lead to an extra ~50% memory
footprint per input (with the default 16 threads), regardless of whether that
input is currently in use or not.

My methodology was to add logging in the event of a queue underrun/overrun,
and then observe and then observe the frequency of such events in practice,
as well as the impact on performance. I came up with an example filter graph
involving decoding, filtering and encoding with several input files and
various changes to move the bottleneck around.

I found that, in all configurations I tested, with all thread counts and
bottlenecks, using a queue size of 2 frames yielded practically identical
performance to a queue size of 8 frames. I was only able to consistently
measure a slowdown when restricting the queue to a single frame, where the
underruns ended up making up almost 1.1% of frame events in the worst case.

A summary of my test log follows:

= Bottleneck in decoder =

ffmpeg -i A -i B -i C -filter_complex "concat=n=3" -f null -

== 16 threads ==

=== Queue statistics (dec -> filtergraph) ===
- 8 frames = 91355 underruns, 1 overrun
- 4 frames = 91381 underruns, 2 overruns
- 2 frames = 91326 underruns, 21 overruns
- 1 frame  = 91284 underruns, 102 overruns

=== Time elapsed ===
- 8 frames = 14.37s
- 4 frames = 14.28s
- 2 frames = 14.27s
- 1 frame  = 14.35s

== 1 thread ==

=== Queue statistics (dec -> filtergraph) ===
- 8 frames = 91801 underruns, 0 overruns
- 4 frames = 91929 underruns, 1 overrun
- 2 frames = 91854 underruns, 7 overruns
- 1 frame  = 91745 underrons, 83 overruns

=== Time elapsed ===
- 8 frames = 39.51s
- 4 frames = 39.94s
- 2 frames = 39.91s
- 1 frame  = 41.69s

= Bottleneck in filter graph: =

ffmpeg -i A -i B -i C -filter_complex "concat=n=3,scale=3840x2160" -f null -

== 16 threads ==

=== Queue statistics (dec -> filtergraph) ===
- 8 frames =  277 underruns, 84673 overruns
- 4 frames =  640 underruns, 86523 overruns
- 2 frames =  850 underruns, 88751 overruns
- 1 frame  = 1028 underruns, 89957 overruns

=== Time elapsed ===
- 8 frames = 26.35s
- 4 frames = 26.31s
- 2 frames = 26.38s
- 1 frame  = 26.55s

== 1 thread ==

=== Queue statistics (dec -> filtergraph) ===
- 8 frames = 29746 underruns, 57033 overruns
- 4 frames = 29940 underruns, 58948 overruns
- 2 frames = 30160 underruns, 60185 overruns
- 1 frame  = 30259 underruns, 61126 overruns

=== Time elapsed ===
- 8 frames = 52.08s
- 4 frames = 52.49s
- 2 frames = 52.25s
- 1 frame  = 52.69s

= Bottleneck in encoder: =

ffmpeg -i A -i B -i C -filter_complex "concat=n=3" -c:v libx264 -preset veryfast -f null -

== 1 thread ==

== Queue statistics (filtergraph -> enc) ==
- 8 frames = 26763 underruns, 63535 overruns
- 4 frames = 26863 underruns, 63810 overruns
- 2 frames = 27243 underruns, 63839 overruns
- 1 frame  = 27670 underruns, 63953 overruns

== Time elapsed ==
- 8 frames = 89.45s
- 4 frames = 89.04s
- 2 frames = 89.24s
- 1 frame  = 90.26s
2025-09-30 13:16:59 +02:00
Niklas Haas
15407cf90b fftools/ffmpeg_sched: relax queue size assertion
The code in the decoder just cares about allocating enough extra hw frames
to cover the size of the queue; but there's no reason we actually *have* to
use this many. We can safely relax the assertion to a <= check.
2025-09-30 13:16:59 +02:00
Nikolay Aleksandrov
1608aa38a2 doc/infra: More details about hosting and security
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>

I have redacted the exact location of the FFmpeg server as writing
that in public seems just a bad idea
2025-09-30 13:14:03 +02:00
Koushik Dutta via ffmpeg-devel
fd136a4d82 ffv1enc_vulkan: fix empty struct build error on msvc
Signed-off-by: Koushik Dutta <koushd@gmail.com>
2025-09-30 19:36:56 +09:00
Jack Lau
bc561013c9 avformat/whip: add RTX initial support
Refer to RFC 4588.

Add and set the basic param of RTX like
ssrc, payload_type, srtp.

Modify the SDP to add RTX info so that
the peer be able to parse the RTX packet.

There are more pateches to make RTX really
work.

Signed-off-by: Jack Lau <jacklau1222@qq.com>
2025-09-30 05:42:40 +00:00
Gyan Doshi
f1e9032a20 configure: unbreak glslang build
Don't unconditionally link to libSPVRemapper which was removed in 16.0 in 3a7f787
2025-09-30 04:26:18 +00:00
James Almer
d975dbd7b7 avcodec/libdav1d: bump minimum supported version to 1.0.0
This allows us to remove old deprecated options.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-09-28 23:53:27 -03:00
Kaarle Ritvanen
0fdb5829e3 avformat/rtsp: set AVFMTCTX_UNSEEKABLE flag
for live RTP streams. Some external applications, such as Qt Multimedia,
depend on this flag being set correctly.

Signed-off-by: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
2025-09-28 13:37:43 +00:00
Rémi Denis-Courmont
dd977adcfe Add myself to CODEOWNERS 2025-09-28 12:35:14 +00:00
Andreas Rheinhardt
635cb4543f avcodec/bsf/ahx_to_mp2: Don't output uninitialized data
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-27 17:57:15 +02:00
Andreas Rheinhardt
8a34faa250 swscale/ppc/swscale_ppc_template: Fix av_unused placement
Forgotten in d6cb0d2c2b.

Reviewed-by: Sean McGovern <gseanmcg@gmail.com>
Reviewed-by: Niklas Haas <ffmpeg@haasn.dev>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 22:38:13 +02:00
Andreas Rheinhardt
0f1f345c37 avcodec/x86/qpeldsp_init: Fix compilation without external assembly
Broken in 2cf9e733c6.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 18:30:53 +02:00
Kacper Michajłow
941eae01b1 avutil/attributes: prefer clang attributes even in non-gnu builds
In MSVC mode Clang doesn't define __GNUC__, but we can still attributes.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-09-26 16:15:46 +00:00
Kacper Michajłow
b7ab357db4 avutil/attributes: use standard attributes when they are available
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-09-26 16:15:46 +00:00
Kacper Michajłow
a7f0377a3d avutil/attributes: add AV_HAS_STD_ATTRIBUTE
For testing language standard attributes, for both C++ and C.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-09-26 16:15:46 +00:00
Kacper Michajłow
d6cb0d2c2b ALL: move av_unused to conform with standard requirement
This is required placement by standard [[maybe_unused]] attribute, works
the same for __attribute__((unused)).

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-09-26 16:15:46 +00:00
James Almer
b9cc8e3210 avfilter/vf_scale: don't attempt to rescale AV_NOPTS_VALUE
Finishes fixing issue #20589.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-09-26 12:24:04 -03:00
James Almer
5614672d1b avfilter/framesync: don't attempt to rescale AV_NOPTS_VALUE
Part of a fix for issue #20589.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-09-26 12:24:04 -03:00
Sean McGovern
c605d2a7ae MAINTAINERS: add me for Linux / PowerPC architecture 2025-09-26 13:16:53 +00:00
Sean McGovern
9ed6503b62 MAINTAINERS: add my OpenPGP key
My key is available at:

https://keys.openpgp.org/vks/v1/by-fingerprint/6D03BC603A33E6156E2E06AD8C0681756F598684

and

https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x6d03bc603a33e6156e2e06ad8c0681756f598684
2025-09-26 13:16:53 +00:00
Timo Rothenpieler
994a368451 configure: deprecate support for libnpp 2025-09-26 12:31:39 +00:00
Andreas Rheinhardt
a54d6b1d91 avcodec/x86/rnd_template: Merge into hpeldsp_init.c
It is now only included exactly once.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 06:21:58 +02:00
Andreas Rheinhardt
43fe9554cc avcodec/x86/hpeldsp_init: Avoid complicating macro
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 06:21:55 +02:00
Andreas Rheinhardt
00e046df13 avcodec/x86/hpeldsp_init: Remove MMX(EXT) funcs overridden by SSE2
This affects the {avg,put}_no_rnd_pixels16_{x,y}2 MMX and
(put-only) MMXEXT versions. Removing these functions saved
1184B here.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 06:21:53 +02:00
Andreas Rheinhardt
30c4007c65 avcodec/x86/hpeldsp: Add SSE2 avg_no_rnd size 16 versions
These currently only exist as MMX versions.
The added functions occupy 320B here. So far, they are only for
the x2 and y2 (i.e. right and down, not down-right) directions.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 06:21:49 +02:00
Andreas Rheinhardt
1e677e6964 avcodec/x86/hpeldsp: Add SSE2 put_no_rnd size 16 versions
These currently only exist as MMX and (not bitexact) MMXEXT versions.
The added functions occupy 288B here. So far, they are only for
the x2 and y2 (i.e. right and down, not down-right) directions.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 06:21:46 +02:00
Andreas Rheinhardt
262791b8d8 avcodec/hpeldsp: Make put_no_rnd_pixels_tab smaller
Only the blocksizes 16 and 8 are implemented, yet the motion estimation
code touches the blocksize 4 entries. But really nothing touches
the blocksize 2 entries, so that we can reduce the put_no_rnd_pixels_tab
array size to [3][4].

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 06:21:43 +02:00
Andreas Rheinhardt
c7161befb4 avcodec/x86/h264_qpel: Remove MMX(EXT) funcs overridden by SSSE3
SSSE3 is already quite old (introduced 2006 for Intel, 2011 for AMD),
so that the overwhelming majority of our users (particularly those
that actually update their FFmpeg) will be using the SSSE3 versions.
This commit therefore removes the MMX(EXT) functions overridden
by them (which don't abide by the ABI) to get closer to a removal
of emms_c.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 06:21:39 +02:00
Andreas Rheinhardt
4fc05c28f4 avfilter/x86/vf_gradfun: Remove MMXEXT func overridden by SSSE3
SSSE3 is already quite old (introduced 2006 for Intel, 2011 for AMD),
so that the overwhelming majority of our users (particularly those
that actually update their FFmpeg) will be using the SSSE3 version
of filter_line.
This commit therefore removes the overridden MMXEXT version
(which didn't abide by the ABI) which allows us to remove
an emms_c() from vf_gradfun.c, so that users with SSSE3 no longer
pay a price for the mere existence of an MMXEXT version.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-26 06:21:35 +02:00