5953 Commits

Author SHA1 Message Date
517a805565 fftools/resources: Add resource manager files with build-time compression
Compression requires zlib to be available, otherwise resources will
be included uncompressed - in either case via BIN2C.

It can also be disabled via

./configure --disable-resource-compression

Size figures:

graph.css         7752
graph.css.min     6655 (css is always minified)
graph.html        2153

No Compression

graph.css.c      40026
graph.css.o       9344 (6688)
graph.html.c     13016
graph.html.o      4848 (2186)

With Compression

graph.css.c      10206
graph.css.o       4368 (1718)
graph.html.c      5725
graph.html.o      3632 (971)

Numbers in brackets: .rodata size from 'size -Ax -d *.o'

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-15 23:08:05 +02:00
8c920c4c39 Remove libpostproc
Libpostproc will be available as source plugin at
https://github.com/michaelni/FFmpeg/tree/sourceplugin-libpostproc
OR
https://github.com/michaelni/libpostproc

whatever turns out more convenient to maintain

For the upcoming 8.0 release, libpostproc will be included, so as not to
cause delays or inconveniences

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-07 15:35:47 +02:00
f4e72eb5a3 configure: Enable -fno-common for Darwin targets, avoid linker warnings
Since GCC 10 and llvm.org Clang 11, -fno-common is the default.
However Apple's Xcode Clang hasn't followed suit yet, and still
defaults to -fcommon.

Compiling with -fcommon causes uninitialized global variables to
be treated as "common" (which allows multiple object files to have
similar definitions).

Common variables seem to have the issue that their intended alignment
isn't signaled, so the linker assumes that they may need alignment
according to their full size.

With large global tables, this can lead to linker warnings like
this, with Xcode 16.3:

    ld: warning: reducing alignment of section __DATA,__common from 0x8000 to 0x4000 because it exceeds segment maximum alignment

This can be reproduced with a small snippet like this:

    char table[16385];
    int main(int argc, char* argv[]) { return 0; }

Compiling with -fno-common avoids this issue and warning, and
matches the default behaviour of other compilers. (Compiling with
-fno-common also avoids the risk of accidentally accepting
duplicate definitions of global variables, as long as they are
uninitialized.)

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-05-05 11:35:11 +03:00
fab691edaf avcodec: add APV encoder using liboapv
Co-authored-by: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-04 16:21:35 -03:00
33d0d1c672 avformat/apvdec: don't fill container level fields with codec level info
This is a raw demuxer, it should not read codec level information and export it
as container level information.
The generic demux code will use the recently introduced parser to take care of
that.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-01 22:42:41 -03:00
c4ea4abec2 avcodec: add an APV parser
Signed-off-by: James Almer <jamrial@gmail.com>
2025-05-01 22:42:34 -03:00
483cadf8d7 lavc: APV decoder 2025-04-27 15:52:30 +01:00
821717c3fe lavc/cbs: APV support 2025-04-27 15:52:30 +01:00
979608dde7 configure: Clearer documentation for "disable-safe-bitstream-reader"
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-16 13:09:03 +02:00
890b8da1ce configure: Allow mixing declarations and statements
This C90 rule forces us to use a too big scope and should
therefore be dropped. Given that we already require C11,
all supported compilers can handle mixed declarations
and statements just fine.

Reviewed-by: Zhao Zhili <quinkblack-at-foxmail.com@ffmpeg.org>
Reviewed-by: Marvin Scholz <epirat07@gmail.com>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-09 11:45:21 +02:00
8284ba2a21 configure: Check for AVCaptureSession as dependency to avfoundation
This class is unavailable on tvOS before 17.0 (and macOS before 10.7
and iOS before 4.0, but those are fairly ancient). This makes sure
that we don't try to build the avfoundation indevice for such
OSes.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-04-04 17:12:34 +03:00
d8ae11365c configure: Check for an actual function in VideoToolbox
This makes sure to disable VideoToolbox if building with an SDK
that does contain VideoToolbox, but targeting an older version of
the OS where it is unavailable. Previously, we would enable
VideoToolbox as long as the framework itself was found, which only
require the framework to exist in the SDK.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-04-01 18:28:31 +03:00
1129957ae2 configure: Add a dependency for the audiotoolbox outdev
The audiotoolbox outdev uses APIs that only are available on macOS,
not on iOS or tvOS. Check for them in configure, and make sure the
outdev is disabled otherwise.

This allows building for iOS without explicitly having to disable
the audiotoolbox outdev.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-04-01 18:28:23 +03:00
64087171f6 configure: add option to select use of response files 2025-03-30 17:22:10 +05:30
17b31065f0 avdevice: remove deprecated FF_API_SDL2_DEVICE
Deprecated since 2024-02-28.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:07 -03:00
9283c5251f avdevice: remove deprecated FF_API_OPENGL_DEVICE
Deprecated since 2024-02-28.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:07 -03:00
a5064a72ff avdevice: remove deprecated FF_API_BKTR_DEVICE
Deprecated since 2024-02-02.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-03-28 14:33:07 -03:00
fc44ccd981 configure: Add EXR decoder->bswapdsp dependency
Needed on BE systems.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-03-23 14:14:43 +01:00
b75b568b3d configure: improve ar test for response files 2025-03-19 15:41:52 +05:30
740d400965 ffbuild: use response files only if ar accepts them 2025-03-18 15:35:30 +05:30
6bad55eb17 ffv1: add a Vulkan-based decoder
This patch adds a fully-featured level 3 and 4 decoder for FFv1,
supporting Golomb and all Range coding variants, all pixel formats,
and all features, except for the newly added floating-point formats.

On a 6000 Ada, for 3840x2160 bgr0 content at 50Mbps (standard desktop
recording), it is able to do 400fps.
An Alder Lake with 24 threads can barely do 100fps.
2025-03-17 08:51:23 +01:00
81ca85a087 configure: allow mixed declarations and code for Objective-C
Mixing declarations and code is quite common in Objective-C (as can be
seen by the number of warnings we have for this in Objective-C files)
and forcing to not do it usually results in worse code, with unnecessary
widely scoped variables, which in turn makes variable shadowing and
accidentally using the wrong variable more common and harder to notice.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-03-17 10:59:26 +08:00
163e5fd84d configure: fix passing Objective-C flags
Passing Objective-C flags from configure to the Makefiles was broken, as
configure incorrectly used the OBJCCFLAGS instead of OBJCFLAGS variable
which was then later overwritten in the common.mak:

  OBJCCFLAGS  = $(CPPFLAGS) $(CFLAGS) $(OBJCFLAGS)

The fix for this is simple, analogous to how it is handled for CFLAGS,
use OBJCFLAGS here so that the flags are properly included in the
aforementioned OBJCCFLAGS definition.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-03-17 10:57:29 +08:00
49c8f33262 lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang v2
v2: test for function if AltiVec is enabled instead of with AltiVec and without VSX
2025-03-11 00:31:47 -04:00
30a8641465 lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang
Add a check for the existence of the vec_xl() function. Clang provides
the function even with VSX not enabled.
2025-03-06 14:21:38 +01:00
58875417af configure: align libplacebo version check with reality
This filter already failed to compile on older versions, because of an
unconditional use of an API introduced in API version 220. Nobody noticed
this, so I conclude that it's safe to bump the required version by now.
2025-02-27 18:55:33 +01:00
4dc2ae69e7 avfilter/interlace_vulkan: add interlace_vulkan filter
This is a Vulkan-accelerated version of the existing interlace filter.
2025-02-17 17:16:25 +01:00
78ff3782af lavc/videotoolboxenc: Add spatial_aq option
Added in macOS 15 "Sequoia".

Signed-off-by: Dennis Sädtler <dennis@obsproject.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2025-02-11 11:33:27 +02:00
e504247db6 avcodec: add a ffv1 parser
Only setting frame and stream properties. No packetization is performed.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-06 13:48:47 -03:00
4b77a0a681 avfilter/scale_amf: Add AMF VPP & super resolution filters
This commit adds two AMF filters: vpp_amf & sr_amf.
Both filters are using AMF hardware acceleration.
vpp_amf supports simple scaling algorithms & color conversion.
sr_amf supports advanced scaling algorithms such as FSR & can
be used for upscaling only.
2025-02-04 00:14:14 +01:00
fbfde33230 avcodec: add amfdec.
Added AMF based h264, hevc, av1 decoders.
Co-authored-by: Dmitrii Ovchinnikov <ovchinnikov.dmitrii@gmail.com>
v2: added encoder reinitialisation
v3: use AMF_SURFACE_UNKNOWN to int decoder(ctx->output_format before)
2025-02-04 00:14:14 +01:00
3cd4e8470a configure: Improve the check for the rsync --contimeout option
Traditionally, macOS has shipped an old version of rsync that lacked
support for this option, hence this check (added in
a8b3f0c5cf548f654e30c981988bb71981a3f8d3).

However, in macOS 15.x, Apple have switched to providing rsync as a
different tool, openrsync. The version of openrsync in at least
macOS 15.2 does include "[--contimeout]" (note the lack of "=" after
the option), in the output of "rsync --help", but when used, the tool
errors out with "rsync: --contimeout=60: unknown option". So apparently
the tool erroenously lists the option as supported, while it really
isn't.

The original rsync tool (with a new enough version) prints
"--contimeout=SECONDS" in the output of "rsync --help".

It is unclear which version of openrsync Apple are shipping; the latest
upstream openrsync from OpenBSD does support the option and includes
"[--contimeout=seconds]" in the output of "--help", and older versions
don't seem to include the option as listed at all.

Therefore, check for "--conntimeout=" with the "=", this should
properly detect both new enough rsync and openrsync.

This fixes running "fate-rsync" on macOS 15.x.

Signed-off-by: Martin Storsjö <martin@martin.st>
2025-01-28 19:55:45 +02:00
7ab7d9c3c0 avfilter/avfilter: Add FFFilter, hide internals of AVFilter
This patch is analogous to 20f972701806be20a77f808db332d9489343bb78:
It hides the internal part of AVFilter by adding a new internal
structure FFFilter (declared in filters.h) that has an AVFilter
as its first member; the internal part of AVFilter is moved to
this new structure.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-01-12 15:41:40 +01:00
f3c4082645 avcodec/libjxl: add animated JPEG XL encoder
libjxl supports animated encoding, so we add a wrapper to the
library using the receive_packet callback method.

This code was based largely on a patch sent by Zsolt Vadász,
although it was updated to use more recent coding practices
and many of the leaks and issues were fixed.

Reviewed-by: Marth64 <marth64@proxyid.net>
Co-authored-by: Zsolt Vadász <zsolt_vadasz@protonmail.com>
Signed-off-by: Leo Izen <leo.izen@gmail.com>
2025-01-03 19:37:28 -05:00
0457aaf0d3 configure: Include quotes around pkg_version
In some MSYS environments it can happen that the 3 argument syntax
for pkg-config library specifications fails because somehow the
expansion of pkg_version ends up with a redirection we guess.

To avoid failures like in the referenced build[2], we quote it
so the whole module including operators will be expanded into
a single shell word and the single argument syntax for specifying
the library for pkg-config will be used.

The single argument syntax seems to be supported by the original
pkg-config from the beginning more than 20 years[3].

In the pkgconf implementation single argument syntax was supported
pretty much from the beginning as well. The multiple argument syntax
we used until this change, was not supported until a change[4] more
than 10 years ago.

References
----------

1. Build passing with quotes:
   https://github.com/JoeSchiff/pyav-ffmpeg/actions/runs/12358403929
2. Build failing without quotes:
   https://github.com/JoeSchiff/pyav-ffmpeg/actions/runs/12360472377
3. Earliest commit of the current pkg-config Git repo already mentions the single argument syntax:
   2ac96cbcc7 (124c0becfe68b1ef671f49ed2b9d24779ace126f_0_162)
4. pkgconf gets support for 3 argument syntax (pkgconf --exists liba = 1.2.3):
   793de6a06c

Commit-message-by: Alexander Strasser <eclipse7@gmx.net>
Signed-off-by: Joe Schiffler <joeschiffler3@gmail.com>
Signed-off-by: Alexander Strasser <eclipse7@gmx.net>
2025-01-02 09:23:00 +01:00
d3aa99a4f4 configure: update copyright year
On 01/01/2025 19:05, Peter Ross wrote:
> FFmpeg turns 25 this year.
2025-01-01 20:15:25 +09:00
1b8cd00da6 configure: add option to statically link to libvulkan
This may be useful in weird setups and on platforms where
static linking to libvulkan is supported.

libplacebo also has this fallback.
2024-12-23 04:25:09 +09:00
c037eb8424 amfenc: Update the min version to 1.4.35.0 for AMF SDK. 2024-12-20 00:43:42 +01:00
8272d34377 configure: add iso_writer golomb dependency
since commit fce0622d0b1f69a85fe8ce61e1189dd57a8b0fcc, libavformat/hevc.c
depends on golomb vlc tables.
2024-12-18 16:30:47 +11:00
8cab5bdc69 configure: add leaddec blockdsp dependency 2024-12-11 07:52:25 +11:00
2dc55f5993 configure: Add wasm as a fake arch
And add wasm simd128 flag, so we can add simd128 optimizations.
It can be enabled by put -msimd128 to extra cflags. There is
no runtime detection on simd128 support yet. I think that needs to
be done with JavaScript.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-12-04 16:43:06 +08:00
59057aa807 avutil/mem_internal: local align should always work
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-11-29 12:33:03 +08:00
d89fbfd4df avcodec: deprecate sonic
This is an experimental and research codec of which ffmpeg is the only
encoder and decoder, development has stalled since 2013 and these files
don't exist in the wild.

Deprecate the encoders to be removed next major bump, decoders to be
removed one bump afterwards. We also disable the the encoders by default
in configure, the decoders should be disabled by default next bump.

Signed-off-by: J. Dekker <jdek@itanimul.li>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2024-11-25 14:34:55 -05:00
05e079c948 avcodec/mediacodecenc: add async mode support
It has better performance than poll in a loop.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-11-20 19:23:51 +08:00
ed2391d341 ffv1enc: add a Vulkan encoder
This commit implements a standard, compliant, version 3 and version 4
FFv1 encoder, entirely in Vulkan. The encoder is written in standard
GLSL and requires a Vulkan 1.3 supporting GPU with the BDA extension.

The encoder can use any amount of slices, but nominally, should use
32x32 slices (1024 in total) to maximize parallelism.

All features are supported, as well as all pixel formats.
This includes:
 - Rice
 - Range coding with a custom quantization table
 - PCM encoding

CRC calculation is also massively parallelized on the GPU.

Encoding of unaligned dimensions on subsampled data requires
version 4, or requires oversizing the image to 64-pixel alignment
and cropping out the padding via container flags.

Performance-wise, this makes 1080p real-time screen capture possible
at 60fps on even modest GPUs.
2024-11-18 07:54:22 +01:00
6ccd16dda2 configure: add rv60 decoder golomb dependency
Fixes standalone compilation of the rv60 decoder.
2024-11-16 19:08:39 +11:00
13129f1af4 lavc: deprecate the omx encoders
They have not been relevant for a long time, and support for this API is
also being dropped from other projects.
2024-11-09 02:46:17 +01:00
33802e7c32 avcodec/rv60: RealVideo 6.0 decoder
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Peter Ross <pross@xvid.org>
2024-11-03 10:53:15 +11:00
e726fdeb05 lavc/vaapi_dec: Add VVC decoder
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-11-01 12:13:07 +08:00
38d08f5c45 configure: Only try to use the -no_warn_duplicate_libraries flag on Darwin
While we only add the flag if the linker seems to support it,
it turns out that ld.bfd had a bug where the flag is accidentally
accepted, and the flag produces an output file named
"_warn_duplicate_libraries".

The ld.bfd bug was fixed in binutils 2.36, in
https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=3991c7acb29aa8d7d52150695eb3efa03a08dd50.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-10-15 09:53:14 +03:00