]> git.99rst.org Git - openwrt-packages.git/commitdiff
ffmpeg: update to 9.0.1
authorMirko Vogt <redacted>
Tue, 8 Sep 2026 13:49:21 +0000 (13:49 +0000)
committerMirko Vogt <redacted>
Tue, 15 Sep 2026 20:40:22 +0000 (22:40 +0200)
Rework the package while bumping from 6.1.4.

Variants: libffmpeg is the configurable build (menu "FFmpeg
configuration"; the defaults give a full-featured build), libffmpeg-mini
a fixed small decoder set for playback-only consumers; the two conflict.
The former -full, -custom and -audio-dec variants are folded into
libffmpeg: its menu carries the per-codec/format/protocol selection the
custom variant had, controlled by a "manual component selection"
option that is off by default. libffmpeg provides libffmpeg-full and
libffmpeg-audio-dec as transitional aliases for consumers not yet
updated. libffmpeg-mini no longer provides the libffmpeg virtual
package: its fixed set is too small for the in-tree consumers of that
name (mpd, minidlna), which need the default build; it is for consumers
that depend on it explicitly.

 * deterministic configure: --disable-autodetect plus an explicit
   --disable baseline for everything configure would pick up from the
   environment; each optional library/hwaccel is one config symbol
   driving both the conditional DEPENDS and the configure flag
 * menu: licence, size/speed, programs, hwaccels (libdrm, V4L2 M2M,
   VA-API), TLS backend (default mbedTLS, OpenWrt's default TLS
   library), external libraries, system libraries, component selection.
   Defaults follow what in-tree consumers need: libopus, LAME (shine
   on soft-float) and libx264 on; fdk-aac only for a nonfree, non-GPL
   build. The ALSA input device is dropped (no in-tree consumer).
   libdav1d (FFmpeg has no native software AV1 decoder) and VA-API are
   prepared but commented out until the dav1d and libva packages exist
   in the feeds.
 * BUILD_PATENTED: vvc (H.266) is added to the patented component lists
   next to h264, hevc and vc1; FFmpeg 9 builds its native VVC decoder,
   parser, muxer and demuxer by default and H.266 is licensed through
   the same patent pools as HEVC.

Build fixes for 9.0.1 are part of this commit; feature patches from
LibreELEC and the options they introduce follow in separate commits.

Patches:
  010-pkgconfig: kept unchanged: expresses libdir and includedir
    relative to ${prefix} in the generated .pc files
  020-libavcodec-fix-Wint-conversion-in-vulkan,
  030-avformat-file-guard-fd_dup-by-FD_PROTOCOL-or-PIPE_PR,
  040-vulkan_decode-fix-the-print-format-of-VkDeviceSize,
  050-avcodec-dct-Make-declarations-and-definitions-match,
  060-avutil-tx-fix-GCC-memset-warning,
  080-avcodec-pcm-bluray-dvd-Use-correct-pointer-types-on-,
  090-avcodec-tiff-Suppress-unused-variable-warnings,
  100-avcodec-tableprint_vlc-Unbreak-hardcoded-tables,
  120-avfilter-af_channelsplit-fix-mixed-declaration-and-c:
    dropped: merged upstream
  070-avformat-rawdec-guard-by-CONFIG_DATA_DEMUXER: dropped: only
    silenced an unused-function warning in builds without the data
    demuxer
  160-libavdevice-v4l2-libv4l2-posix-ioctl: new: libv4l2.h only
    declares v4l2_ioctl() with the POSIX "int request" signature when
    the consumer defines a feature macro first; FFmpeg detects that
    signature (HAVE_IOCTL_POSIX) but never tells the header, and GCC 14
    turns the resulting pointer-type mismatch into an error. Define
    both macro spellings (v4l-utils <= 1.30 and >= 1.32). Same approach
    as q66's posix-ioctl.patch in Chimera Linux, also carried by Alpine,
    which defines one of the two names per copy
  170-tls_mbedtls-build-without-version-module: new: OpenWrt's mbedtls
    package disables MBEDTLS_VERSION_C, so mbedtls_version_get_number()
    is not declared; fall back to the compile-time MBEDTLS_VERSION_NUMBER
  180-mips-cabac-no-mips16: re-added: restores the MIPS16 guard for the
    MIPS CABAC inline assembly from Rosen Penev's 030-h264-mips.patch
    (2020), dropped by the 6.1.2 update
  190-configure-hevcparse-select-hevc_sei: new: configure's hevcparse
    component does not select hevc_sei although hevc/parse.c needs it;
    without BUILD_PATENTED the HEVC decoder and parser that used to pull
    it in are off while the default-enabled dovi_split bitstream filter
    still needs hevcparse, leaving ff_hevc_decode_nal_sei undefined

The explicit GPL option and the explicit libdrm dependency follow
Daniel Golle's 7.1.4 update proposal of this package, which was superseded
by this PR/update.

Assisted-By: Claude Fable 5.1 <redacted>
Signed-off-by: Mirko Vogt <redacted>
16 files changed:
multimedia/ffmpeg/Config.in
multimedia/ffmpeg/Makefile
multimedia/ffmpeg/patches/020-libavcodec-fix-Wint-conversion-in-vulkan.patch [deleted file]
multimedia/ffmpeg/patches/030-avformat-file-guard-fd_dup-by-FD_PROTOCOL-or-PIPE_PR.patch [deleted file]
multimedia/ffmpeg/patches/040-vulkan_decode-fix-the-print-format-of-VkDeviceSize.patch [deleted file]
multimedia/ffmpeg/patches/050-avcodec-dct-Make-declarations-and-definitions-match.patch [deleted file]
multimedia/ffmpeg/patches/060-avutil-tx-fix-GCC-memset-warning.patch [deleted file]
multimedia/ffmpeg/patches/070-avformat-rawdec-guard-by-CONFIG_DATA_DEMUXER.patch [deleted file]
multimedia/ffmpeg/patches/080-avcodec-pcm-bluray-dvd-Use-correct-pointer-types-on-.patch [deleted file]
multimedia/ffmpeg/patches/090-avcodec-tiff-Suppress-unused-variable-warnings.patch [deleted file]
multimedia/ffmpeg/patches/100-avcodec-tableprint_vlc-Unbreak-hardcoded-tables.patch [deleted file]
multimedia/ffmpeg/patches/120-avfilter-af_channelsplit-fix-mixed-declaration-and-c.patch [deleted file]
multimedia/ffmpeg/patches/160-libavdevice-v4l2-libv4l2-posix-ioctl.patch [new file with mode: 0644]
multimedia/ffmpeg/patches/170-tls_mbedtls-build-without-version-module.patch [new file with mode: 0644]
multimedia/ffmpeg/patches/180-mips-cabac-no-mips16.patch [new file with mode: 0644]
multimedia/ffmpeg/patches/190-configure-hevcparse-select-hevc_sei.patch [new file with mode: 0644]

index c4a3571437569e82fe86c2706b179b84f1c43536..4eb6e40db3d3e2ca78109d00ebb408d6a040c18d 100644 (file)
+menu "FFmpeg configuration"
+
+comment "Licensing"
+
+config FFMPEG_GPL
+       bool "Include GPL components (GPL filters)"
+       default y
+       help
+         Build libffmpeg with --enable-gpl. This adds the
+         GPL-licensed filters, and the resulting libraries are
+         distributed under the GPL-2.0-or-later.
+
+config FFMPEG_VERSION3
+       bool "Allow (L)GPL v3 components"
+       default n
+       help
+         Sets --enable-version3. Upgrades the licence of the resulting
+         libraries to (L)GPL-3.0-or-later. Selected automatically by the
+         TLS backends that require it (see below).
+
+config FFMPEG_NONFREE
+       bool "Allow non-redistributable components"
+       default n
+       help
+         Sets --enable-nonfree. In almost all cases this prohibits
+         redistribution of the resulting binaries.
+
+comment "Build properties"
+
 config FFMPEG_X86ASM
-       bool "Compile x86 ASM"
+       bool "Compile x86 assembly optimizations"
        depends on (x86_64 || (i386 && !(TARGET_x86_geode || TARGET_x86_legacy)))
+       default y
+       help
+         Not available for CPU_TYPE=pentium targets, where NASM cannot
+         assemble them. This option also applies to libffmpeg-mini, which
+         has no other options.
+
+config FFMPEG_OPTIMIZE_SIZE
+       bool "Optimize for size instead of speed"
+       default n if x86_64
+       default y
+       help
+         Sets --enable-small and uses generated instead of hardcoded
+         tables. When disabled, decoding is faster and the libraries are
+         larger.
+
+config FFMPEG_PROGRAMS
+       bool "Build the command line programs (ffmpeg, ffprobe)"
+       default y
        help
-               This compiles ffmpeg with x86 assembly optimizations. This option is needed as NASM is
-               totally broken with CPU_TYPE=pentium.
+         When disabled only the shared libraries are built and the
+         ffmpeg/ffprobe packages cannot be selected.
+
+comment "Hardware acceleration"
+
+config FFMPEG_LIBDRM
+       bool "DRM support (libdrm, needed for DRM_PRIME zero-copy)"
+       default y
+
+config FFMPEG_V4L2_M2M
+       bool "V4L2 mem2mem (stateful) decoders/encoders"
        default y
 
-if PACKAGE_libffmpeg-custom
+# VA-API support is prepared but disabled until a libva package exists in
+# the feeds; uncomment (and the DEPENDS line in the Makefile) once it does.
+#config FFMPEG_VAAPI
+#      bool "VA-API hardware acceleration"
+#      default n
 
-comment "Build Licensing"
+comment "Transport layer security"
 
-config FFMPEG_CUSTOM_GPL
-       bool "Allow use of GPL code"
+choice
+       prompt "TLS backend"
+       default FFMPEG_TLS_MBEDTLS
        help
-               By default, FFMpeg is licensed under the LGPL. This builds a GPL licensed version.
-               Some software requires this, such as libx264.
+         mbedTLS is the default because it is the TLS library OpenWrt
+         itself ships by default (libustream-mbedtls, hostapd-*-mbedtls).
+         Selecting the backend already present in the image avoids a
+         second TLS library.
+
+         Licence: FFmpeg's configure requires --enable-version3 for
+         mbedTLS, and for OpenSSL 3.x whenever GPL components are
+         enabled. Together with the GPL option this makes the resulting
+         libraries GPL-3.0-or-later. GnuTLS carries no such requirement.
+
+       config FFMPEG_TLS_NONE
+               bool "none (no https/tls protocol)"
+
+       config FFMPEG_TLS_GNUTLS
+               bool "GnuTLS"
+
+       config FFMPEG_TLS_OPENSSL
+               bool "OpenSSL"
+               select FFMPEG_VERSION3 if FFMPEG_GPL
+
+       config FFMPEG_TLS_MBEDTLS
+               bool "mbedTLS"
+               select FFMPEG_VERSION3
+endchoice
+
+comment "External libraries"
+
+# libdav1d support is prepared but disabled until a dav1d package exists
+# in the feeds; uncomment (and the DEPENDS line in the Makefile) once it
+# does. Until then AV1 is only decodable by hardware, see the help text.
+#config FFMPEG_LIBDAV1D
+#      bool "AV1 decoding via libdav1d"
+#      default y
+#      help
+#        FFmpeg has no native software AV1 decoder; its built-in av1
+#        decoder only drives hardware acceleration (V4L2 Request API,
+#        VA-API). Without libdav1d, AV1 can only be decoded by hardware
+#        with an AV1 decoder.
+
+config FFMPEG_LIBOPUS
+       bool "Opus encoding via libopus"
        default y
+       help
+         Opus decoding is always available through FFmpeg's native
+         decoder, which is preferred even when libopus is present.
+         libopus adds a production-quality encoder; the native Opus
+         encoder is marked experimental.
+
+config FFMPEG_LIBVORBIS
+       bool "Vorbis encoding via libvorbis"
+       default n
 
-config FFMPEG_CUSTOM_GPLV3
-       bool "Use (L)GPL v3"
+config FFMPEG_LIBVPX
+       bool "VP8/VP9 encoding via libvpx"
+       default n
        help
-               Uses the LPGL v3 if GPL isn't selected, or GPL v3 if it is.
+         VP8 and VP9 decoding is always available through FFmpeg's
+         native decoders, which are preferred even when libvpx is
+         present. libvpx therefore only adds the encoders.
 
-config FFMPEG_CUSTOM_NONFREE
-       bool "Use code with complex licensing requirements; see help"
+config FFMPEG_LIBWEBP
+       bool "WebP encoding via libwebp"
+       default n
+
+config FFMPEG_LIBSPEEX
+       bool "Speex encoding via libspeex"
+       default n
        help
-               This sets --enable-nonfree, which in almost all cases, will prohibit redistribution of the resulting package.
-               Use this with care.
+         Speex decoding is always available through FFmpeg's native
+         decoder, which is preferred even when libspeex is present.
+         libspeex therefore only adds the encoder.
+
+config FFMPEG_LIBXML2
+       bool "XML parsing via libxml2 (DASH/IMF demuxers)"
+       default n
+       help
+         The DASH and IMF demuxers are the only users of libxml2 and
+         are not built without it; there is no native fallback.
+
+config FFMPEG_LAME
+       bool "MP3 encoding via LAME"
+       default y if !SOFT_FLOAT
        default n
 
-config FFMPEG_CUSTOM_PATENTED
-       bool "Include patented codecs and technologies"
-       default BUILD_PATENTED
+config FFMPEG_SHINE
+       bool "Fixed-point MP3 encoding via libshine"
+       default y if SOFT_FLOAT
+       default n
 
-comment "Build Properties"
+config FFMPEG_LIBX264
+       bool "H.264 encoding via libx264"
+       depends on FFMPEG_GPL && BUILD_PATENTED
+       default y
 
-config FFMPEG_CUSTOM_LARGE
-       bool "Build libffmpeg for performance instead of minimizing size on disk"
-       default y if ( x86_64 )
+config FFMPEG_FDK_AAC
+       bool "AAC encoding via libfdk-aac"
+       depends on FFMPEG_NONFREE && !FFMPEG_GPL
        default n
+       help
+         The FDK licence is incompatible with the GPL, so this is only
+         offered for a non-GPL, nonfree build. The native FFmpeg AAC
+         encoder is always available.
+
+comment "System libraries"
 
-comment "Profiles"
-
-config FFMPEG_CUSTOM_MINIDLNA_SUPPORT
-       bool "Include support for minidlna"
-       select FFMPEG_CUSTOM_DECODER_aac
-       select FFMPEG_CUSTOM_DECODER_ac3
-       select FFMPEG_CUSTOM_DECODER_flac
-       select FFMPEG_CUSTOM_DECODER_h264 if (BUILD_PATENTED)
-       select FFMPEG_CUSTOM_DECODER_hevc if (BUILD_PATENTED)
-       select FFMPEG_CUSTOM_DECODER_jpegls
-       select FFMPEG_CUSTOM_DECODER_mp2
-       select FFMPEG_CUSTOM_DECODER_mp3
-       select FFMPEG_CUSTOM_DECODER_mpeg1video
-       select FFMPEG_CUSTOM_DECODER_mpeg2video
-       select FFMPEG_CUSTOM_DECODER_mpeg4
-       select FFMPEG_CUSTOM_DECODER_mpegvideo
-       select FFMPEG_CUSTOM_DECODER_png
-       select FFMPEG_CUSTOM_DECODER_opus
-       select FFMPEG_CUSTOM_DECODER_vc1 if (BUILD_PATENTED)
-       select FFMPEG_CUSTOM_DECODER_vorbis
-       select FFMPEG_CUSTOM_DECODER_wmav1
-       select FFMPEG_CUSTOM_DECODER_wmav2
-       select FFMPEG_CUSTOM_DEMUXER_avi
-       select FFMPEG_CUSTOM_DEMUXER_flac
-       select FFMPEG_CUSTOM_DEMUXER_matroska
-       select FFMPEG_CUSTOM_DEMUXER_mov
-       select FFMPEG_CUSTOM_DEMUXER_mp3
-       select FFMPEG_CUSTOM_DEMUXER_mpegps
-       select FFMPEG_CUSTOM_DEMUXER_mpegts
-       select FFMPEG_CUSTOM_DEMUXER_mpegvideo
-       select FFMPEG_CUSTOM_DEMUXER_ogg
-       select FFMPEG_CUSTOM_PROTOCOL_file
-
-config FFMPEG_CUSTOM_AUDIO_DEC_SUPPORT
-       bool "Include support for most audio decoding requirements"
-       select FFMPEG_CUSTOM_DECODER_aac
-       select FFMPEG_CUSTOM_DECODER_aac_latm
-       select FFMPEG_CUSTOM_DECODER_ac3
-       select FFMPEG_CUSTOM_SELECT_adpcm
-       select FFMPEG_CUSTOM_DECODER_alac
-       select FFMPEG_CUSTOM_DECODER_amrnb
-       select FFMPEG_CUSTOM_DECODER_amrwb
-       select FFMPEG_CUSTOM_DECODER_ape
-       select FFMPEG_CUSTOM_DECODER_atrac3
-       select FFMPEG_CUSTOM_DECODER_flac
-       select FFMPEG_CUSTOM_DECODER_mp2
-       select FFMPEG_CUSTOM_DECODER_mp3
-       select FFMPEG_CUSTOM_DECODER_mpc7
-       select FFMPEG_CUSTOM_DECODER_mpc8
-       select FFMPEG_CUSTOM_DECODER_opus
-       select FFMPEG_CUSTOM_DECODER_pcm_s16be
-       select FFMPEG_CUSTOM_DECODER_pcm_s16le
-       select FFMPEG_CUSTOM_DECODER_vorbis
-       select FFMPEG_CUSTOM_DECODER_wavpack
-       select FFMPEG_CUSTOM_DECODER_wmav1
-       select FFMPEG_CUSTOM_DECODER_wmav2
-       select FFMPEG_CUSTOM_DECODER_wmalossless
-       select FFMPEG_CUSTOM_DECODER_wmapro
-       select FFMPEG_CUSTOM_DECODER_zlib
-       select FFMPEG_CUSTOM_DEMUXER_aac
-       select FFMPEG_CUSTOM_DEMUXER_ac3
-       select FFMPEG_CUSTOM_DEMUXER_aiff
-       select FFMPEG_CUSTOM_DEMUXER_amr
-       select FFMPEG_CUSTOM_DEMUXER_ape
-       select FFMPEG_CUSTOM_DEMUXER_avi
-       select FFMPEG_CUSTOM_DEMUXER_flac
-       select FFMPEG_CUSTOM_DEMUXER_ffm
-       select FFMPEG_CUSTOM_DEMUXER_matroska
-       select FFMPEG_CUSTOM_DEMUXER_mp3
-       select FFMPEG_CUSTOM_DEMUXER_mov
-       select FFMPEG_CUSTOM_DEMUXER_mpc
-       select FFMPEG_CUSTOM_DEMUXER_mpc8
-       select FFMPEG_CUSTOM_DEMUXER_mpegts
-       select FFMPEG_CUSTOM_DEMUXER_ogg
-       select FFMPEG_CUSTOM_DEMUXER_rm
-       select FFMPEG_CUSTOM_DEMUXER_rtsp
-       select FFMPEG_CUSTOM_DEMUXER_rtp
-       select FFMPEG_CUSTOM_DEMUXER_sdp
-       select FFMPEG_CUSTOM_DEMUXER_wav
-       select FFMPEG_CUSTOM_DEMUXER_wv
-       select FFMPEG_CUSTOM_PROTOCOL_file
-       select FFMPEG_CUSTOM_PROTOCOL_http
-       select FFMPEG_CUSTOM_PROTOCOL_rtp
-       select FFMPEG_CUSTOM_PROTOCOL_tcp
-       select FFMPEG_CUSTOM_PROTOCOL_udp
-
-config FFMPEG_CUSTOM_PROGRAMS
-       bool "Include ffmpeg command-line utilities"
-       select PACKAGE_ffmpeg-custom
-       select PACKAGE_ffprobe-custom
-
-comment "External Libraries"
-
-config FFMPEG_CUSTOM_SELECT_libfdk-aac
-       bool "Fraunhofer FDK AAC encoding library (libfdk-aac)"
-       depends on FFMPEG_CUSTOM_NONFREE
-       depends on PACKAGE_fdk-aac
-
-config FFMPEG_CUSTOM_SELECT_libmp3lame
-       bool "Libmp3lame"
-       depends on PACKAGE_lame-lib
-       select FFMPEG_CUSTOM_DECODER_mp3
-       select FFMPEG_CUSTOM_MUXER_mp3
-       select FFMPEG_CUSTOM_DEMUXER_mp3
-
-config FFMPEG_CUSTOM_SELECT_libopus
-       bool "Libopus"
-
-config FFMPEG_CUSTOM_SELECT_libshine
-       bool "Libshine"
-
-config FFMPEG_CUSTOM_SELECT_libx264
-       bool "Libx264"
-       depends on FFMPEG_CUSTOM_PATENTED
-       depends on FFMPEG_CUSTOM_GPL
-       depends on PACKAGE_libx264
-       select FFMPEG_CUSTOM_DECODER_h264
-       select FFMPEG_CUSTOM_MUXER_h264
-       select FFMPEG_CUSTOM_DEMUXER_h264
+config FFMPEG_LIBV4L2
+       bool "V4L2 capture device via libv4l2 (pixel format conversion)"
+       default n
+       help
+         The V4L2 capture/output devices of libavdevice work without
+         this, using raw ioctls. libv4l2 adds the v4l-utils userspace
+         layer, mainly libv4lconvert for capture devices producing pixel
+         formats FFmpeg does not handle natively. Unrelated to hardware
+         decoding.
+
+config FFMPEG_BZLIB
+       bool "bzip2 support"
+       default y
+       help
+         Only used by the Matroska demuxer for bzip2-compressed tracks.
+         Without it such tracks cannot be read; everything else in
+         Matroska is unaffected.
+
+config FFMPEG_LZMA
+       bool "lzma support"
+       default n
+       help
+         Only used by the TIFF decoder for LZMA-compressed images.
+
+config FFMPEG_ICONV
+       bool "iconv support (subtitle charset conversion)"
+       default y
+       help
+         Uses the iconv implementation of the C library; no additional
+         package is needed on musl.
+
+comment "Components"
+
+config FFMPEG_SELECT_COMPONENTS
+       bool "Manual component selection"
+       default n
+       help
+         Disabled: every native codec, container format, filter,
+         protocol and device is built, subject to the licence options
+         above and BUILD_PATENTED.
+
+         Enabled: the build starts from --disable-everything and only
+         the components selected in the options that appear below are
+         built; every component not selected there is absent from the
+         libraries. The components of the external libraries and
+         hardware accelerations selected above are added automatically,
+         as are the tls and https protocols of the selected TLS backend.
+
+if FFMPEG_SELECT_COMPONENTS
 
 comment "Encoders"
 
-config FFMPEG_CUSTOM_ENCODER_ac3
+config FFMPEG_ENCODER_ac3
        bool "AC3"
 
-config FFMPEG_CUSTOM_ENCODER_jpegls
+config FFMPEG_ENCODER_jpegls
        bool "JPEG-LS"
 
-config FFMPEG_CUSTOM_ENCODER_mpeg1video
+config FFMPEG_ENCODER_mpeg1video
        bool "MPEG-1 Video"
 
-config FFMPEG_CUSTOM_ENCODER_mpeg2video
+config FFMPEG_ENCODER_mpeg2video
        bool "MPEG-2 Video"
 
-config FFMPEG_CUSTOM_ENCODER_mpeg4
+config FFMPEG_ENCODER_mpeg4
        bool "MPEG-4"
 
-config FFMPEG_CUSTOM_ENCODER_pcm_s16be
+config FFMPEG_ENCODER_pcm_s16be
        bool "PCM signed 16-bit big-endian"
 
-config FFMPEG_CUSTOM_ENCODER_pcm_s16le
+config FFMPEG_ENCODER_pcm_s16le
        bool "PCM signed 16-bit little-endian"
 
-config FFMPEG_CUSTOM_ENCODER_png
+config FFMPEG_ENCODER_png
        bool "PNG"
-       select FFMPEG_CUSTOM_ENCODER_zlib
+       select FFMPEG_ENCODER_zlib
 
-config FFMPEG_CUSTOM_ENCODER_vorbis
+config FFMPEG_ENCODER_vorbis
        bool "Vorbis"
 
-config FFMPEG_CUSTOM_ENCODER_zlib
+config FFMPEG_ENCODER_zlib
        bool "Zlib"
 
 comment "Decoders"
 
-config FFMPEG_CUSTOM_DECODER_aac
+config FFMPEG_DECODER_aac
        bool "AAC (Advanced Audio Coding)"
 
-config FFMPEG_CUSTOM_SELECT_adpcm
+config FFMPEG_DECODER_aac_latm
+       bool "AAC LATM"
+
+config FFMPEG_DECODER_adpcm
        bool "ADPCM (multiple types)"
 
-config FFMPEG_CUSTOM_DECODER_ac3
+config FFMPEG_DECODER_ac3
        bool "AC3"
 
-config FFMPEG_CUSTOM_DECODER_alac
+config FFMPEG_DECODER_alac
        bool "ALAC"
 
-config FFMPEG_CUSTOM_DECODER_amrnb
+config FFMPEG_DECODER_amrnb
        bool "AMR-NB"
-       select FFMPEG_CUSTOM_DEMUXER_amr
+       select FFMPEG_DEMUXER_amr
 
-config FFMPEG_CUSTOM_DECODER_amrwb
+config FFMPEG_DECODER_amrwb
        bool "AMR-WB"
-       select FFMPEG_CUSTOM_DEMUXER_amr
+       select FFMPEG_DEMUXER_amr
 
-config FFMPEG_CUSTOM_DECODER_ape
+config FFMPEG_DECODER_ape
        bool "APE"
 
-config FFMPEG_CUSTOM_DECODER_atrac3
+config FFMPEG_DECODER_atrac3
        bool "ATRAC3"
 
-config FFMPEG_CUSTOM_DECODER_flac
+config FFMPEG_DECODER_flac
        bool "FLAC"
 
-config FFMPEG_CUSTOM_DECODER_gif
+config FFMPEG_DECODER_gif
        bool "GIF"
 
-config FFMPEG_CUSTOM_DECODER_h264
+config FFMPEG_DECODER_h264
        bool "H.264"
-       depends on FFMPEG_CUSTOM_PATENTED
+       depends on BUILD_PATENTED
 
-config FFMPEG_CUSTOM_DECODER_hevc
+config FFMPEG_DECODER_hevc
        bool "HEVC / H.265 Video"
-       depends on FFMPEG_CUSTOM_PATENTED
+       depends on BUILD_PATENTED
 
-config FFMPEG_CUSTOM_DECODER_jpegls
+config FFMPEG_DECODER_jpegls
        bool "JPEG-LS"
 
-config FFMPEG_CUSTOM_DECODER_mp2
+config FFMPEG_DECODER_mp2
        bool "MP2 (MPEG Audio Layer 2)"
 
-config FFMPEG_CUSTOM_DECODER_mp3
+config FFMPEG_DECODER_mp3
        bool "MP3 (MPEG Audio Layer 3)"
 
-config FFMPEG_CUSTOM_DECODER_mpegvideo
+config FFMPEG_DECODER_mpegvideo
        bool "MPEG Video"
 
-config FFMPEG_CUSTOM_DECODER_mpeg1video
+config FFMPEG_DECODER_mpeg1video
        bool "MPEG-1 Video"
 
-config FFMPEG_CUSTOM_DECODER_mpeg2video
+config FFMPEG_DECODER_mpeg2video
        bool "MPEG-2 Video"
 
-config FFMPEG_CUSTOM_DECODER_mpeg4
+config FFMPEG_DECODER_mpeg4
        bool "MPEG-4"
 
-config FFMPEG_CUSTOM_DECODER_mpc7
+config FFMPEG_DECODER_mpc7
        bool "Musepack 7"
-       select FFMPEG_CUSTOM_DEMUXER_mpc
+       select FFMPEG_DEMUXER_mpc
 
-config FFMPEG_CUSTOM_DECODER_mpc8
+config FFMPEG_DECODER_mpc8
        bool "Musepack 8"
-       select FFMPEG_CUSTOM_DEMUXER_mpc8
+       select FFMPEG_DEMUXER_mpc8
 
-config FFMPEG_CUSTOM_DECODER_opus
+config FFMPEG_DECODER_opus
        bool "Opus"
 
-config FFMPEG_CUSTOM_DECODER_pcm_s16be
+config FFMPEG_DECODER_pcm_s16be
        bool "PCM signed 16-bit big-endian"
 
-config FFMPEG_CUSTOM_DECODER_pcm_s16le
+config FFMPEG_DECODER_pcm_s16le
        bool "PCM signed 16-bit little-endian"
 
-config FFMPEG_CUSTOM_DECODER_png
+config FFMPEG_DECODER_png
        bool "PNG"
-       select FFMPEG_CUSTOM_DECODER_zlib
+       select FFMPEG_DECODER_zlib
 
-config FFMPEG_CUSTOM_DECODER_vc1
+config FFMPEG_DECODER_vc1
        bool "VC-1 / WMV9"
-       depends on FFMPEG_CUSTOM_PATENTED
+       depends on BUILD_PATENTED
 
-config FFMPEG_CUSTOM_DECODER_vorbis
+config FFMPEG_DECODER_vorbis
        bool "Vorbis"
-       select FFMPEG_CUSTOM_DEMUXER_ogg
+       select FFMPEG_DEMUXER_ogg
 
-config FFMPEG_CUSTOM_DECODER_wavpack
+config FFMPEG_DECODER_wavpack
        bool "Wavpack"
 
-config FFMPEG_CUSTOM_DECODER_wmav1
+config FFMPEG_DECODER_wmav1
        bool "WMAv1"
 
-config FFMPEG_CUSTOM_DECODER_wmav2
+config FFMPEG_DECODER_wmav2
        bool "WMAv2"
 
-config FFMPEG_CUSTOM_DECODER_zlib
+config FFMPEG_DECODER_wmalossless
+       bool "WMA Lossless"
+
+config FFMPEG_DECODER_wmapro
+       bool "WMA Pro"
+
+config FFMPEG_DECODER_zlib
        bool "Zlib"
 
 comment "Muxers"
 
-config FFMPEG_CUSTOM_MUXER_ac3
+config FFMPEG_MUXER_ac3
        bool "AC3"
 
-config FFMPEG_CUSTOM_MUXER_avi
+config FFMPEG_MUXER_avi
        bool "AVI"
 
-config FFMPEG_CUSTOM_MUXER_h264
+config FFMPEG_MUXER_h264
        bool "H.264 Raw Video"
-       depends on FFMPEG_CUSTOM_PATENTED
+       depends on BUILD_PATENTED
 
-config FFMPEG_CUSTOM_MUXER_hevc
+config FFMPEG_MUXER_hevc
        bool "HEVC / H265 Raw Video"
-       depends on FFMPEG_CUSTOM_PATENTED
+       depends on BUILD_PATENTED
 
-config FFMPEG_CUSTOM_MUXER_mp3
+config FFMPEG_MUXER_mp3
        bool "MP3 (MPEG Audio Layer 3)"
 
-config FFMPEG_CUSTOM_MUXER_mp4
+config FFMPEG_MUXER_mp4
        bool "MP4"
 
-config FFMPEG_CUSTOM_MUXER_mpeg1video
+config FFMPEG_MUXER_mpeg1video
        bool "MPEG-1 Video"
 
-config FFMPEG_CUSTOM_MUXER_mpeg2video
+config FFMPEG_MUXER_mpeg2video
        bool "MPEG-2 Video"
 
-config FFMPEG_CUSTOM_MUXER_mpegts
+config FFMPEG_MUXER_mpegts
        bool "MPEG-2 (TS)"
 
-config FFMPEG_CUSTOM_MUXER_ogg
+config FFMPEG_MUXER_ogg
        bool "Ogg"
 
-config FFMPEG_CUSTOM_MUXER_rtp
+config FFMPEG_MUXER_rtp
        bool "RTP"
 
 comment "Demuxers"
 
-config FFMPEG_CUSTOM_DEMUXER_aac
+config FFMPEG_DEMUXER_aac
        bool "AAC"
 
-config FFMPEG_CUSTOM_DEMUXER_avi
+config FFMPEG_DEMUXER_avi
        bool "AVI (Audio Video Interleave)"
 
-config FFMPEG_CUSTOM_DEMUXER_ac3
+config FFMPEG_DEMUXER_ac3
        bool "AC3"
 
-config FFMPEG_CUSTOM_DEMUXER_amr
+config FFMPEG_DEMUXER_aiff
+       bool "AIFF"
+
+config FFMPEG_DEMUXER_amr
        bool "AMR"
 
-config FFMPEG_CUSTOM_DEMUXER_ape
+config FFMPEG_DEMUXER_ape
        bool "APE"
 
-config FFMPEG_CUSTOM_DEMUXER_flac
+config FFMPEG_DEMUXER_flac
        bool "FLAC"
 
-config FFMPEG_CUSTOM_DEMUXER_h264
+config FFMPEG_DEMUXER_h264
        bool "H.264 Raw Video"
-       depends on FFMPEG_CUSTOM_PATENTED
+       depends on BUILD_PATENTED
 
-config FFMPEG_CUSTOM_DEMUXER_hevc
+config FFMPEG_DEMUXER_hevc
        bool "HEVC / H265 Raw Video"
-       depends on FFMPEG_CUSTOM_PATENTED
+       depends on BUILD_PATENTED
 
-config FFMPEG_CUSTOM_DEMUXER_matroska
+config FFMPEG_DEMUXER_matroska
        bool "Matroska (MKA,MKV)"
-       select FFMPEG_CUSTOM_DECODER_zlib
+       select FFMPEG_DECODER_zlib
 
-config FFMPEG_CUSTOM_DEMUXER_mov
+config FFMPEG_DEMUXER_mov
        bool "MOV/MP4/M4A/3GP/3G2/MJ2"
-       select FFMPEG_CUSTOM_DECODER_zlib
+       select FFMPEG_DECODER_zlib
 
-config FFMPEG_CUSTOM_DEMUXER_mp3
+config FFMPEG_DEMUXER_mp3
        bool "MP3 (MPEG Audio Layer 3)"
 
-config FFMPEG_CUSTOM_DEMUXER_mpegvideo
+config FFMPEG_DEMUXER_mpegvideo
        bool "MPEG Video (Raw)"
 
-config FFMPEG_CUSTOM_DEMUXER_mpegps
+config FFMPEG_DEMUXER_mpegps
        bool "MPEG-2 (PS)"
 
-config FFMPEG_CUSTOM_DEMUXER_mpegts
+config FFMPEG_DEMUXER_mpegts
        bool "MPEG-2 (TS)"
 
-config FFMPEG_CUSTOM_DEMUXER_mpc
+config FFMPEG_DEMUXER_mpc
        bool "Musepack"
 
-config FFMPEG_CUSTOM_DEMUXER_mpc8
+config FFMPEG_DEMUXER_mpc8
        bool "Musepack 8"
 
-config FFMPEG_CUSTOM_DEMUXER_ogg
+config FFMPEG_DEMUXER_ogg
        bool "Ogg"
 
-config FFMPEG_CUSTOM_DEMUXER_rm
+config FFMPEG_DEMUXER_rm
        bool "RM"
        help
          RealMedia format demuxer
 
-config FFMPEG_CUSTOM_DEMUXER_rtsp
+config FFMPEG_DEMUXER_rtsp
        bool "RTSP"
-       select FFMPEG_CUSTOM_DEMUXER_rm
-       select FFMPEG_CUSTOM_DEMUXER_sdp
-       select FFMPEG_CUSTOM_DEMUXER_rtp
+       select FFMPEG_DEMUXER_rm
+       select FFMPEG_DEMUXER_sdp
+       select FFMPEG_DEMUXER_rtp
 
-config FFMPEG_CUSTOM_DEMUXER_sdp
+config FFMPEG_DEMUXER_sdp
        bool "SDP"
-       select FFMPEG_CUSTOM_DEMUXER_mpegts
+       select FFMPEG_DEMUXER_mpegts
 
-config FFMPEG_CUSTOM_DEMUXER_rtp
+config FFMPEG_DEMUXER_rtp
        bool "RTP"
 
-config FFMPEG_CUSTOM_DEMUXER_vc1
+config FFMPEG_DEMUXER_vc1
        bool "VC-1 / WMV9 Raw Video"
-       depends on FFMPEG_CUSTOM_PATENTED
+       depends on BUILD_PATENTED
 
-config FFMPEG_CUSTOM_DEMUXER_wav
+config FFMPEG_DEMUXER_wav
        bool "WAV"
 
-config FFMPEG_CUSTOM_DEMUXER_wv
+config FFMPEG_DEMUXER_wv
        bool "WV"
 
 comment "Parsers"
 
-config FFMPEG_CUSTOM_PARSER_aac
+config FFMPEG_PARSER_aac
        bool "AAC (Advanced Audio Coding)"
 
-config FFMPEG_CUSTOM_PARSER_ac3
+config FFMPEG_PARSER_ac3
        bool "AC3"
 
-config FFMPEG_CUSTOM_PARSER_flac
+config FFMPEG_PARSER_flac
        bool "FLAC"
 
-config FFMPEG_CUSTOM_PARSER_h264
+config FFMPEG_PARSER_h264
        bool "H.264"
-       depends on FFMPEG_CUSTOM_PATENTED
-       select FFMPEG_CUSTOM_DECODER_h264
+       depends on BUILD_PATENTED
+       select FFMPEG_DECODER_h264
 
-config FFMPEG_CUSTOM_PARSER_hevc
+config FFMPEG_PARSER_hevc
        bool "HEVC / H265"
-       depends on FFMPEG_CUSTOM_PATENTED
-       select FFMPEG_CUSTOM_DECODER_hevc
+       depends on BUILD_PATENTED
+       select FFMPEG_DECODER_hevc
 
-config FFMPEG_CUSTOM_PARSER_mpegaudio
+config FFMPEG_PARSER_mpegaudio
        bool "MPEG Audio"
 
-config FFMPEG_CUSTOM_PARSER_mpegvideo
+config FFMPEG_PARSER_mpegvideo
        bool "MPEG Video"
 
-config FFMPEG_CUSTOM_PARSER_mpeg4video
+config FFMPEG_PARSER_mpeg4video
        bool "MPEG-4 Video"
 
-config FFMPEG_CUSTOM_PARSER_opus
+config FFMPEG_PARSER_opus
        bool "Opus"
 
-config FFMPEG_CUSTOM_PARSER_vc1
+config FFMPEG_PARSER_vc1
        bool "VC-1 / WMV9"
-       depends on FFMPEG_CUSTOM_PATENTED
-       select FFMPEG_CUSTOM_DECODER_vc1
+       depends on BUILD_PATENTED
+       select FFMPEG_DECODER_vc1
 
 comment "Protocols"
 
-config FFMPEG_CUSTOM_PROTOCOL_file
+config FFMPEG_PROTOCOL_file
        bool "file:"
 
-config FFMPEG_CUSTOM_PROTOCOL_http
+config FFMPEG_PROTOCOL_http
        bool "http:"
 
-config FFMPEG_CUSTOM_PROTOCOL_icecast
+config FFMPEG_PROTOCOL_icecast
        bool "icecast:"
-       select FFMPEG_CUSTOM_PROTOCOL_http
+       select FFMPEG_PROTOCOL_http
 
-config FFMPEG_CUSTOM_PROTOCOL_pipe
+config FFMPEG_PROTOCOL_pipe
        bool "pipe:"
 
-config FFMPEG_CUSTOM_PROTOCOL_rtp
+config FFMPEG_PROTOCOL_rtp
        bool "rtp:"
-       select FFMPEG_CUSTOM_PROTOCOL_udp
+       select FFMPEG_PROTOCOL_udp
 
-config FFMPEG_CUSTOM_PROTOCOL_tcp
+config FFMPEG_PROTOCOL_tcp
        bool "tcp:"
 
-config FFMPEG_CUSTOM_PROTOCOL_udp
+config FFMPEG_PROTOCOL_udp
        bool "udp:"
 
 
 endif
+
+endmenu
index d815299e4a78a6228d6fe6c197e32b6f90ad911a..26844509b048c578959b949a5cb371b824fa802a 100644 (file)
@@ -1,30 +1,45 @@
 #
 # Copyright (C) 2017-2020 Ian Leonard <antonlacon@gmail.com>
 # Copyright (C) 2018 Ted Hess <thess@kitschensync.net>
+# Copyright (C) 2026 Mirko Vogt <mirko-openwrt@nanl.de>
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
+# Packaging principles:
+#
+#  * every build option is set explicitly - the build result only depends
+#    on this package's own config symbols, never on which other packages
+#    happen to be selected in the buildroot (--disable-autodetect plus an
+#    explicit --enable-*/--disable-* for everything configure would
+#    otherwise detect in the environment)
+#  * each optional external library is one config symbol driving both the
+#    conditional DEPENDS and the matching configure flag
+#
+# Two library variants: libffmpeg is the configurable one (menu below,
+# defaults give a full-featured build), libffmpeg-mini a fixed small set of
+# decoders for playback-only consumers. They conflict at install time.
+#
 
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ffmpeg
-PKG_VERSION:=6.1.4
-PKG_RELEASE:=2
+PKG_VERSION:=9.0.1
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://ffmpeg.org/releases/
-PKG_HASH:=a231e3d5742c44b1cdaebfb98ad7b6200d12763e0b6db9e1e2c5891f2c083a18
+PKG_HASH:=cf38e0e28c7e5605942c4a77755349b0145804a397af37eb1fb4c77cb237f635
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>, \
                Ian Leonard <antonlacon@gmail.com>
 
-PKG_LICENSE:=LGPL-2.1-or-later GPL-2.0-or-later LGPL-3.0-or-later
+PKG_LICENSE:=LGPL-2.1-or-later GPL-2.0-or-later LGPL-3.0-or-later GPL-3.0-or-later
 PKG_LICENSE_FILES:=COPYING.GPLv2 COPYING.GPLv3 COPYING.LGPLv2.1 COPYING.LGPLv3
 PKG_CPE_ID:=cpe:/a:ffmpeg:ffmpeg
 
 PKG_BUILD_PARALLEL:=1
 
-FFMPEG_CUSTOM_ENCODERS:= \
+FFMPEG_ENCODERS:= \
        ac3 \
        jpegls \
        mpeg1video \
@@ -36,8 +51,9 @@ FFMPEG_CUSTOM_ENCODERS:= \
        vorbis \
        zlib \
 
-FFMPEG_CUSTOM_DECODERS:= \
+FFMPEG_DECODERS:= \
        aac \
+       aac_latm \
        ac3 \
        alac \
        amrnb \
@@ -57,20 +73,22 @@ FFMPEG_CUSTOM_DECODERS:= \
        mpegvideo \
        mpc7 \
        mpc8 \
+       opus \
        pcm_s16be \
        pcm_s16le \
        png \
        vc1 \
        vorbis \
        wavpack \
+       wmalossless \
+       wmapro \
        wmav1 \
        wmav2 \
        zlib \
 
-FFMPEG_CUSTOM_MUXERS:= \
+FFMPEG_MUXERS:= \
        ac3 \
        avi \
-       ffm \
        h264 \
        hevc \
        mp3 \
@@ -81,14 +99,14 @@ FFMPEG_CUSTOM_MUXERS:= \
        ogg \
        rtp \
 
-FFMPEG_CUSTOM_DEMUXERS:= \
+FFMPEG_DEMUXERS:= \
        aac \
        ac3 \
+       aiff \
        amr \
        ape \
        avi \
        flac \
-       ffm \
        h264 \
        hevc \
        matroska \
@@ -104,23 +122,23 @@ FFMPEG_CUSTOM_DEMUXERS:= \
        rtsp \
        rtp \
        sdp \
-       v4l2 \
        vc1 \
        wav \
        wv \
 
-FFMPEG_CUSTOM_PARSERS:= \
+FFMPEG_PARSERS:= \
        aac \
-       flac \
        ac3 \
+       flac \
        h264 \
        hevc \
        mpegaudio \
        mpeg4video \
        mpegvideo \
+       opus \
        vc1 \
 
-FFMPEG_CUSTOM_PROTOCOLS:= \
+FFMPEG_PROTOCOLS:= \
        file http icecast pipe rtp tcp udp
 
 FFMPEG_MINI_DECODERS:= \
@@ -156,59 +174,17 @@ FFMPEG_MINI_DEMUXERS:= \
 FFMPEG_MINI_PROTOCOLS:= \
        file
 
-FFMPEG_AUDIO_DECODERS:= \
-       ac3 \
-       adpcm_* \
-       alac \
-       amrnb \
-       amrwb \
-       ape \
-       atrac3 \
-       flac \
-       mp2 \
-       mp3* \
-       mpc7 \
-       mpc8 \
-       opus \
-       pcm_* \
-       vorbis \
-       wavpack \
-       zlib \
-
-FFMPEG_AUDIO_DEMUXERS:= \
-       ac3 \
-       aiff \
-       amr \
-       ape \
-       avi \
-       flac \
-       ffm \
-       matroska \
-       mp3 \
-       mov \
-       mpc \
-       mpc8 \
-       mpegts \
-       ogg \
-       rm \
-       rtsp \
-       rtp \
-       sdp \
-       wav \
-       wv \
-
-FFMPEG_AUDIO_PROTOCOLS:= \
-       file http icecast rtp tcp udp
-
 FFMPEG_PATENTED_DECODERS:= \
        h264 \
        hevc \
        vc1 \
+       vvc \
 
 FFMPEG_PATENTED_MUXERS:= \
        h264 \
        hevc \
        vc1 \
+       vvc \
 
 FFMPEG_PATENTED_DEMUXERS:=$(FFMPEG_PATENTED_MUXERS)
 
@@ -216,167 +192,163 @@ FFMPEG_PATENTED_PARSERS:= \
        h264 \
        hevc \
        vc1 \
+       vvc \
 
+# everything that changes the build must be listed here, else a changed
+# option does not trigger a rebuild
 PKG_CONFIG_DEPENDS:= \
-       $(patsubst %,CONFIG_FFMPEG_CUSTOM_ENCODER_%,$(FFMPEG_CUSTOM_ENCODERS)) \
-       $(patsubst %,CONFIG_FFMPEG_CUSTOM_DECODER_%,$(FFMPEG_CUSTOM_DECODERS)) \
-       $(patsubst %,CONFIG_FFMPEG_CUSTOM_MUXER_%,$(FFMPEG_CUSTOM_MUXERS)) \
-       $(patsubst %,CONFIG_FFMPEG_CUSTOM_DEMUXER_%,$(FFMPEG_CUSTOM_DEMUXERS)) \
-       $(patsubst %,CONFIG_FFMPEG_CUSTOM_PARSER_%,$(FFMPEG_CUSTOM_PARSERS)) \
-       $(patsubst %,CONFIG_FFMPEG_CUSTOM_PROTOCOL_%,$(FFMPEG_CUSTOM_PROTOCOLS))
+       CONFIG_BUILD_PATENTED \
+       CONFIG_FFMPEG_X86ASM \
+       CONFIG_FFMPEG_GPL \
+       CONFIG_FFMPEG_VERSION3 \
+       CONFIG_FFMPEG_NONFREE \
+       CONFIG_FFMPEG_OPTIMIZE_SIZE \
+       CONFIG_FFMPEG_PROGRAMS \
+       CONFIG_FFMPEG_LIBDRM \
+       CONFIG_FFMPEG_V4L2_M2M \
+       CONFIG_FFMPEG_VAAPI \
+       CONFIG_FFMPEG_LIBV4L2 \
+       CONFIG_FFMPEG_TLS_NONE \
+       CONFIG_FFMPEG_TLS_GNUTLS \
+       CONFIG_FFMPEG_TLS_OPENSSL \
+       CONFIG_FFMPEG_TLS_MBEDTLS \
+       CONFIG_FFMPEG_BZLIB \
+       CONFIG_FFMPEG_LZMA \
+       CONFIG_FFMPEG_ICONV \
+       CONFIG_FFMPEG_LIBDAV1D \
+       CONFIG_FFMPEG_LIBOPUS \
+       CONFIG_FFMPEG_LIBVORBIS \
+       CONFIG_FFMPEG_LIBVPX \
+       CONFIG_FFMPEG_LIBWEBP \
+       CONFIG_FFMPEG_LIBSPEEX \
+       CONFIG_FFMPEG_LIBXML2 \
+       CONFIG_FFMPEG_LAME \
+       CONFIG_FFMPEG_SHINE \
+       CONFIG_FFMPEG_LIBX264 \
+       CONFIG_FFMPEG_FDK_AAC \
+       CONFIG_FFMPEG_SELECT_COMPONENTS \
+       CONFIG_FFMPEG_DECODER_adpcm \
+       $(patsubst %,CONFIG_FFMPEG_ENCODER_%,$(FFMPEG_ENCODERS)) \
+       $(patsubst %,CONFIG_FFMPEG_DECODER_%,$(FFMPEG_DECODERS)) \
+       $(patsubst %,CONFIG_FFMPEG_MUXER_%,$(FFMPEG_MUXERS)) \
+       $(patsubst %,CONFIG_FFMPEG_DEMUXER_%,$(FFMPEG_DEMUXERS)) \
+       $(patsubst %,CONFIG_FFMPEG_PARSER_%,$(FFMPEG_PARSERS)) \
+       $(patsubst %,CONFIG_FFMPEG_PROTOCOL_%,$(FFMPEG_PROTOCOLS))
 
 include $(INCLUDE_DIR)/package.mk
 
 define Package/ffmpeg/Default
- TITLE:=FFmpeg
- URL:=https://ffmpeg.org/
- DEPENDS+= +libatomic
 TITLE:=FFmpeg
 URL:=https://ffmpeg.org/
 DEPENDS+= +libatomic
 endef
 
 define Package/ffmpeg/Default/description
- FFmpeg is a a software package that can record, convert and stream digital
- audio and video in numerous formats.
 FFmpeg is a a software package that can record, convert and stream digital
 audio and video in numerous formats.
 
- FFmpeg licensing / patent issues are complex. It is the responsibility of the
- user to understand any requirements in this regard with its usage. See:
- https://ffmpeg.org/legal.html for further information.
 FFmpeg licensing / patent issues are complex. It is the responsibility of the
 user to understand any requirements in this regard with its usage. See:
 https://ffmpeg.org/legal.html for further information.
 
- Patented codecs and technologies are available when CONFIG_BUILD_PATENTED=y.
 Patented codecs and technologies are available when CONFIG_BUILD_PATENTED=y.
 endef
 
 
 define Package/ffmpeg
 $(call Package/ffmpeg/Default)
- SECTION:=multimedia
- CATEGORY:=Multimedia
- TITLE+= program
- DEPENDS+= +libffmpeg-full
- VARIANT:=full
-endef
-
-define Package/ffmpeg-custom
-$(call Package/ffmpeg/Default)
- SECTION:=multimedia
- CATEGORY:=Multimedia
- TITLE+= program (custom)
- DEPENDS+= @!ALL libffmpeg-custom
- VARIANT:=custom
+  SECTION:=multimedia
+  CATEGORY:=Multimedia
+  TITLE+= program
+  DEPENDS+= @FFMPEG_PROGRAMS +libffmpeg
+  VARIANT:=default
 endef
 
 define Package/ffmpeg/description
 $(call Package/ffmpeg/Default/description)
- .
- This package contains the FFmpeg command line tool.
 .
 This package contains the FFmpeg command line tool.
 endef
 
-Package/ffmpeg-custom/description = $(Package/ffmpeg/description)
-
 define Package/ffprobe
 $(call Package/ffmpeg/Default)
- SECTION:=multimedia
- CATEGORY:=Multimedia
- TITLE+= CLI media identifier
- DEPENDS+= +libffmpeg-full
- VARIANT:=full
-endef
-
-define Package/ffprobe-custom
-$(call Package/ffmpeg/Default)
- SECTION:=multimedia
- CATEGORY:=Multimedia
- TITLE+= CLI media identifier (custom)
- DEPENDS+= @!ALL libffmpeg-custom
- VARIANT:=custom
+  SECTION:=multimedia
+  CATEGORY:=Multimedia
+  TITLE+= CLI media identifier
+  DEPENDS+= @FFMPEG_PROGRAMS +libffmpeg
+  VARIANT:=default
 endef
 
 define Package/ffprobe/description
 $(call Package/ffmpeg/Default/description)
- .
- This package contains the FFprobe command line tool.
 .
 This package contains the FFprobe command line tool.
 endef
 
-Package/ffprobe-custom/description = $(Package/ffprobe/description)
-
 define Package/libffmpeg/Default
 $(call Package/ffmpeg/Default)
- SECTION:=libs
- CATEGORY:=Libraries
- TITLE+= libraries
- DEPENDS+= +libpthread +zlib +libbz2
- PROVIDES:= libffmpeg
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE+= libraries
+  DEPENDS+= +libpthread +zlib
 endef
 
-
-# Package build suppressed when CONFIG_ALL=y
-define Package/libffmpeg-custom
+define Package/libffmpeg
 $(call Package/libffmpeg/Default)
- TITLE+= (custom)
- DEPENDS+= @!ALL \
-           +FFMPEG_CUSTOM_SELECT_libopus:libopus \
-           +PACKAGE_libx264:libx264 +PACKAGE_lame-lib:lame-lib \
-           +FFMPEG_CUSTOM_SELECT_libshine:shine \
-           +PACKAGE_fdk-aac:fdk-aac
- VARIANT:=custom
- MENU:=1
+  DEPENDS+= \
+       +FFMPEG_BZLIB:libbz2 \
+       +FFMPEG_LZMA:liblzma \
+       +FFMPEG_LIBDRM:libdrm \
+       +FFMPEG_LIBV4L2:libv4l \
+       +FFMPEG_TLS_GNUTLS:libgnutls \
+       +FFMPEG_TLS_OPENSSL:libopenssl \
+       +FFMPEG_TLS_MBEDTLS:libmbedtls \
+       +FFMPEG_LIBOPUS:libopus \
+       +FFMPEG_LIBVORBIS:libvorbis \
+       +FFMPEG_LIBVPX:libvpx \
+       +FFMPEG_LIBWEBP:libwebp \
+       +FFMPEG_LIBSPEEX:libspeex \
+       +FFMPEG_LIBXML2:libxml2 \
+       +FFMPEG_LAME:lame-lib \
+       +FFMPEG_SHINE:shine \
+       +FFMPEG_LIBX264:libx264 \
+       +FFMPEG_FDK_AAC:fdk-aac
+  # prepared, disabled until the libva / dav1d packages exist in the feeds
+  # (the matching options in Config.in are commented out as well):
+  #    +FFMPEG_VAAPI:libva
+  #    +FFMPEG_LIBDAV1D:libdav1d
+  VARIANT:=default
+  # transitional aliases for packages still depending on the now gone ones
+  PROVIDES:=libffmpeg-full libffmpeg-audio-dec
 endef
 
-define Package/libffmpeg-custom/config
+# The menu is not guarded by PACKAGE_libffmpeg: its options pull their
+# libraries themselves, and such a guard closes a Kconfig recursion as soon
+# as a pulled library carries an @-dependency (e.g. libx264 on @BUILD_PATENTED).
+define Package/libffmpeg/config
 source "$(SOURCE)/Config.in"
 endef
 
-define Package/libffmpeg-custom/description
+define Package/libffmpeg/description
 $(call Package/ffmpeg/Default/description)
- .
- This package contains customized FFmpeg shared libraries.
-endef
-
-
-define Package/libffmpeg-audio-dec
-$(call Package/libffmpeg/Default)
- TITLE+= (audio)
- VARIANT:=audio-dec
- CONFLICTS:=libffmpeg-full
+  .
+  This package contains the FFmpeg shared libraries, built according to
+  the "FFmpeg configuration" menu (full-featured by default).
 endef
 
-define Package/libffmpeg-audio-dec/description
-$(call Package/ffmpeg/Default/description)
- .
- This package contains FFmpeg shared libraries for audio decoding.
-endef
-
-
-define Package/libffmpeg-full
-$(call Package/libffmpeg/Default)
- TITLE+= (full)
- DEPENDS+= +alsa-lib +libgnutls +PACKAGE_libopus:libopus \
-    +PACKAGE_libv4l:libv4l \
-    +SOFT_FLOAT:shine \
-    +!SOFT_FLOAT:lame-lib \
-    +PACKAGE_libx264:libx264 \
-    +!PACKAGE_libx264:fdk-aac
- VARIANT:=full
- PROVIDES+=libffmpeg-mini libffmpeg-audio-dec
-endef
-
-
-define Package/libffmpeg-full/description
-$(call Package/ffmpeg/Default/description)
- .
- This package contains full-featured FFmpeg shared libraries.
-endef
-
-
 define Package/libffmpeg-mini
 $(call Package/libffmpeg/Default)
- TITLE+= (mini)
- VARIANT:=mini
- CONFLICTS:=libffmpeg-full
 TITLE+= (mini)
 VARIANT:=mini
+  CONFLICTS:=libffmpeg
 endef
 
 define Package/libffmpeg-mini/description
 $(call Package/ffmpeg/Default/description)
- .
- This package contains minimal-featured FFmpeg shared libraries.
+  .
+  This package contains a fixed, minimal set of FFmpeg shared libraries
+  (a small set of decoders and demuxers, file protocol only). It is not
+  configurable; use libffmpeg for anything beyond basic playback.
 endef
 
 
@@ -385,6 +357,12 @@ REAL_CPU_TYPE:=$(call qstrip,$(firstword $(subst +, ,$(CONFIG_CPU_TYPE))))
 # Fixup cpu types recognized by ffmpeg configure
 REAL_CPU_TYPE:=$(subst octeonplus,octeon+,$(REAL_CPU_TYPE))
 
+# Base configuration, shared by all variants.
+#
+# --disable-autodetect makes the build deterministic: no library is used
+# merely because it is present in the shared staging dir. Everything wanted
+# is requested explicitly below; a requested but missing library is a
+# configure error rather than a silently missing feature.
 FFMPEG_CONFIGURE:= \
        CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)" \
        LDFLAGS="$(TARGET_LDFLAGS)" \
@@ -396,17 +374,40 @@ FFMPEG_CONFIGURE:= \
        --target-os=linux \
        --prefix="/usr" \
        --pkg-config="pkg-config" \
+       --disable-autodetect \
        --enable-shared \
        --enable-static \
        --enable-pthreads \
        --enable-zlib \
        --disable-doc \
        --disable-debug \
+       --disable-checkasm \
+       --disable-vdpau \
+       --disable-outdevs \
+       \
        \
+       --disable-alsa \
+       --disable-sndio \
+       --disable-sdl2 \
+       --disable-xlib \
+       --disable-libxcb \
+       --disable-libxcb-shm \
+       --disable-libxcb-shape \
+       --disable-libxcb-xfixes \
+       --disable-bzlib \
+       --disable-iconv \
        --disable-lzma \
+       \
+       --disable-amf \
+       --disable-vulkan \
        --disable-vaapi \
-       --disable-vdpau \
-       --disable-outdevs
+       --disable-libdrm \
+       --disable-v4l2-m2m
+# Everything configure would autodetect on a Linux host is switched off
+# explicitly above. --disable-autodetect already implies this; the explicit
+# list documents the intent and is independent of changes to configure's
+# autodetect list. The libffmpeg variant re-enables bzlib/iconv/lzma and the
+# hwaccels through its FFMPEG_* options below; later flags take precedence.
 
 ifeq ($(CONFIG_SOFT_FLOAT),y)
 FFMPEG_CONFIGURE+= \
@@ -463,169 +464,119 @@ else
   FFMPEG_CONFIGURE += --disable-x86asm
 endif
 
-ifeq ($(BUILD_VARIANT),full)
-
-  FFMPEG_DISABLE= \
+# helper: --enable-$(1)=$(c) for every entry of $(2) whose $(3)_$(c) symbol is set
+FFMPEG_ENABLE_IF= \
        $(foreach c, $(2), \
-               --disable-$(1)="$(c)" \
+               $(if $($(3)_$(c)),--enable-$(1)="$(c)") \
        )
 
-       FFMPEG_CONFIGURE+= \
-               --enable-gnutls \
-               $(if $(CONFIG_BUILD_PATENTED),, \
-                       $(call FFMPEG_DISABLE,decoder,$(FFMPEG_PATENTED_DECODERS)) \
-                       $(call FFMPEG_DISABLE,muxer,$(FFMPEG_PATENTED_MUXERS)) \
-                       $(call FFMPEG_DISABLE,demuxer,$(FFMPEG_PATENTED_DEMUXERS)) \
-                       $(call FFMPEG_DISABLE,parser,$(FFMPEG_PATENTED_PARSERS))) \
-               $(if $(CONFIG_PACKAGE_libopus),--enable-libopus) \
-               $(if $(CONFIG_PACKAGE_libv4l),--enable-libv4l2)
-  ifeq ($(CONFIG_SOFT_FLOAT),y)
-       FFMPEG_CONFIGURE+= \
-               --enable-small \
-               \
-               $(if $(CONFIG_PACKAGE_shine),--enable-libshine)
-  else
-       ifeq ($(ARCH),x86_64)
-               FFMPEG_CONFIGURE+= --enable-hardcoded-tables
-       else
-               FFMPEG_CONFIGURE+= --enable-small
-       endif
-       FFMPEG_CONFIGURE+= $(if $(CONFIG_PACKAGE_lame-lib),--enable-libmp3lame)
-  endif
-  # x264 support and fdk-aac support can't coexist and be distributed.
-  # Prioritize x264 over fdk-aac in default builds (maintain status-quo).
-  ifneq ($(CONFIG_PACKAGE_libx264),)
-       FFMPEG_CONFIGURE+= \
-               --enable-gpl \
-               --enable-libx264
-  else
-       FFMPEG_CONFIGURE+= $(if $(CONFIG_PACKAGE_fdk-aac),--enable-libfdk-aac)
-  endif
-endif
-
-ifeq ($(BUILD_VARIANT),custom)
-
-  FFMPEG_ENABLE= \
+# helper: --enable-$(1)=$(c) for every entry of $(2)
+FFMPEG_ENABLE= \
        $(foreach c, $(2), \
-               $(if $($(3)_$(c)),--enable-$(1)="$(c)") \
+               --enable-$(1)="$(c)" \
        )
 
-  ifeq ($(CONFIG_FFMPEG_CUSTOM_LARGE),y)
-       FFMPEG_CONFIGURE+= \
-               --enable-hardcoded-tables
-  else
-       FFMPEG_CONFIGURE+= \
-               --enable-small
-  endif
-
-  ifeq ($(CONFIG_FFMPEG_CUSTOM_GPL),y)
-       FFMPEG_CONFIGURE+= --enable-gpl
-  endif
+# helper: --disable-$(1)=$(c) for every entry of $(2)
+FFMPEG_DISABLE= \
+       $(foreach c, $(2), \
+               --disable-$(1)="$(c)" \
+       )
 
-  ifeq ($(CONFIG_FFMPEG_CUSTOM_GPLV3),y)
-       FFMPEG_CONFIGURE+= --enable-version3
-  endif
+# on/off helper for a config symbol
+FFMPEG_OPT=$(if $(CONFIG_$(1)),--enable-$(2),--disable-$(2))
 
-  ifeq ($(CONFIG_FFMPEG_CUSTOM_NONFREE),y)
-       FFMPEG_CONFIGURE+= --enable-nonfree
-  endif
+ifeq ($(BUILD_VARIANT),default)
 
-  ifneq ($(CONFIG_FFMPEG_CUSTOM_PROGRAMS),y)
-      FFMPEG_CONFIGURE+= \
-       --disable-programs \
-       --disable-avfilter \
-       --disable-swresample
+  # vaapi/libdav1d: literal --disable until the libva / dav1d packages exist
+  # in the feeds; then restore $(call FFMPEG_OPT,FFMPEG_VAAPI,vaapi),
+  # $(call FFMPEG_OPT,FFMPEG_LIBDAV1D,libdav1d) and, for manual component
+  # selection, --enable-hwaccel=*_vaapi / --enable-decoder=libdav1d.
+  FFMPEG_CONFIGURE+= \
+       $(call FFMPEG_OPT,FFMPEG_GPL,gpl) \
+       $(call FFMPEG_OPT,FFMPEG_VERSION3,version3) \
+       $(call FFMPEG_OPT,FFMPEG_NONFREE,nonfree) \
+       $(call FFMPEG_OPT,FFMPEG_OPTIMIZE_SIZE,small) \
+       $(if $(CONFIG_FFMPEG_OPTIMIZE_SIZE),--disable-hardcoded-tables,--enable-hardcoded-tables) \
+       $(call FFMPEG_OPT,FFMPEG_LIBDRM,libdrm) \
+       $(call FFMPEG_OPT,FFMPEG_V4L2_M2M,v4l2-m2m) \
+       --disable-vaapi \
+       $(call FFMPEG_OPT,FFMPEG_LIBV4L2,libv4l2) \
+       $(call FFMPEG_OPT,FFMPEG_TLS_GNUTLS,gnutls) \
+       $(call FFMPEG_OPT,FFMPEG_TLS_OPENSSL,openssl) \
+       $(call FFMPEG_OPT,FFMPEG_TLS_MBEDTLS,mbedtls) \
+       $(call FFMPEG_OPT,FFMPEG_BZLIB,bzlib) \
+       $(call FFMPEG_OPT,FFMPEG_LZMA,lzma) \
+       $(call FFMPEG_OPT,FFMPEG_ICONV,iconv) \
+       --disable-libdav1d \
+       $(call FFMPEG_OPT,FFMPEG_LIBOPUS,libopus) \
+       $(call FFMPEG_OPT,FFMPEG_LIBVORBIS,libvorbis) \
+       $(call FFMPEG_OPT,FFMPEG_LIBVPX,libvpx) \
+       $(call FFMPEG_OPT,FFMPEG_LIBWEBP,libwebp) \
+       $(call FFMPEG_OPT,FFMPEG_LIBSPEEX,libspeex) \
+       $(call FFMPEG_OPT,FFMPEG_LIBXML2,libxml2) \
+       $(call FFMPEG_OPT,FFMPEG_LAME,libmp3lame) \
+       $(call FFMPEG_OPT,FFMPEG_SHINE,libshine) \
+       $(call FFMPEG_OPT,FFMPEG_LIBX264,libx264) \
+       $(call FFMPEG_OPT,FFMPEG_FDK_AAC,libfdk-aac)
+
+  ifneq ($(CONFIG_FFMPEG_PROGRAMS),y)
+       FFMPEG_CONFIGURE+= --disable-programs
+  else
+       FFMPEG_CONFIGURE+= \
+               --enable-ffmpeg \
+               --enable-ffprobe \
+               --disable-ffplay
   endif
 
-  ifneq ($(CONFIG_PACKAGE_ffmpeg-custom),n)
-      FFMPEG_CONFIGURE+= \
-       --enable-avfilter \
-       --enable-ffmpeg
+  # Component selection. By default every native component is built. With
+  # manual selection the build starts from --disable-everything, enables the
+  # selected components and adds those contributed by the selected external
+  # libraries, hwaccels and TLS backend (configure's --enable-<class>=NAME
+  # accepts shell globs; one flag per name, since commas would split make's
+  # $(if) arguments).
+  ifeq ($(CONFIG_FFMPEG_SELECT_COMPONENTS),y)
+       FFMPEG_CONFIGURE+= \
+               --disable-everything \
+               $(call FFMPEG_ENABLE_IF,encoder,$(FFMPEG_ENCODERS),CONFIG_FFMPEG_ENCODER) \
+               $(call FFMPEG_ENABLE_IF,decoder,$(FFMPEG_DECODERS),CONFIG_FFMPEG_DECODER) \
+               $(call FFMPEG_ENABLE_IF,muxer,$(FFMPEG_MUXERS),CONFIG_FFMPEG_MUXER) \
+               $(call FFMPEG_ENABLE_IF,demuxer,$(FFMPEG_DEMUXERS),CONFIG_FFMPEG_DEMUXER) \
+               $(call FFMPEG_ENABLE_IF,parser,$(FFMPEG_PARSERS),CONFIG_FFMPEG_PARSER) \
+               $(call FFMPEG_ENABLE_IF,protocol,$(FFMPEG_PROTOCOLS),CONFIG_FFMPEG_PROTOCOL) \
+               $(if $(CONFIG_FFMPEG_DECODER_adpcm),--enable-decoder=adpcm_*) \
+               $(if $(CONFIG_FFMPEG_TLS_NONE),,--enable-protocol=tls --enable-protocol=https) \
+               $(if $(CONFIG_FFMPEG_V4L2_M2M),--enable-decoder=*_v4l2m2m --enable-encoder=*_v4l2m2m) \
+               $(if $(CONFIG_FFMPEG_LIBOPUS),--enable-decoder=libopus --enable-encoder=libopus) \
+               $(if $(CONFIG_FFMPEG_LIBVORBIS),--enable-encoder=libvorbis) \
+               $(if $(CONFIG_FFMPEG_LIBVPX),--enable-decoder=libvpx_vp8 --enable-decoder=libvpx_vp9 --enable-encoder=libvpx_vp8 --enable-encoder=libvpx_vp9) \
+               $(if $(CONFIG_FFMPEG_LIBWEBP),--enable-encoder=libwebp --enable-encoder=libwebp_anim) \
+               $(if $(CONFIG_FFMPEG_LIBSPEEX),--enable-decoder=libspeex --enable-encoder=libspeex) \
+               $(if $(CONFIG_FFMPEG_LIBXML2),--enable-demuxer=dash --enable-demuxer=imf) \
+               $(if $(CONFIG_FFMPEG_LAME),--enable-encoder=libmp3lame) \
+               $(if $(CONFIG_FFMPEG_SHINE),--enable-encoder=libshine) \
+               $(if $(CONFIG_FFMPEG_LIBX264),--enable-encoder=libx264 --enable-encoder=libx264rgb) \
+               $(if $(CONFIG_FFMPEG_FDK_AAC),--enable-decoder=libfdk_aac --enable-encoder=libfdk_aac)
   endif
 
+  # patented components are never built without BUILD_PATENTED, regardless
+  # of the component selection above (later flags take precedence)
   FFMPEG_CONFIGURE+= \
-       --disable-swscale \
-       --disable-everything \
-       $(call FFMPEG_ENABLE,encoder,$(FFMPEG_CUSTOM_ENCODERS),CONFIG_FFMPEG_CUSTOM_ENCODER) \
-       $(call FFMPEG_ENABLE,decoder,$(FFMPEG_CUSTOM_DECODERS),CONFIG_FFMPEG_CUSTOM_DECODER) \
-       $(call FFMPEG_ENABLE,muxer,$(FFMPEG_CUSTOM_MUXERS),CONFIG_FFMPEG_CUSTOM_MUXER) \
-       $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_CUSTOM_DEMUXERS),CONFIG_FFMPEG_CUSTOM_DEMUXER) \
-       $(call FFMPEG_ENABLE,parser,$(FFMPEG_CUSTOM_PARSERS),CONFIG_FFMPEG_CUSTOM_PARSER) \
-       $(call FFMPEG_ENABLE,protocol,$(FFMPEG_CUSTOM_PROTOCOLS),CONFIG_FFMPEG_CUSTOM_PROTOCOL) \
-
-ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_adpcm),y)
-  FFMPEG_CONFIGURE+= \
-       --enable-decoder=adpcm_ima_wav \
-       --enable-decoder=adpcm_ima_qt \
-       --enable-decoder=adpcm_ms
-endif
-
-ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libfdk-aac),y)
-  FFMPEG_CONFIGURE+= \
-       --enable-libfdk-aac --enable-encoder=libfdk_aac
-endif
-
-ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libmp3lame),y)
-  FFMPEG_CONFIGURE+= \
-       --enable-libmp3lame --enable-encoder=libmp3lame
-endif
-
-ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libopus),y)
-  FFMPEG_CONFIGURE+= \
-       --enable-libopus --enable-decoder=libopus --enable-encoder=libopus
-endif
-
-ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libshine),y)
-  FFMPEG_CONFIGURE+= \
-       --enable-libshine --enable-encoder=libshine
-endif
-
-ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libx264),y)
-  FFMPEG_CONFIGURE+= \
-       --enable-libx264 --enable-encoder=libx264
-else
-  FFMPEG_CONFIGURE+= --disable-postproc
-endif
-
-endif
-
-ifeq ($(BUILD_VARIANT),audio-dec)
-
-  FFMPEG_ENABLE= \
-       $(foreach c, $(2), \
-               --enable-$(1)="$(c)" \
-       )
-
-  FFMPEG_CONFIGURE+= \
-       --enable-small \
-       --enable-gpl \
-       \
-       --disable-programs \
-       --disable-avfilter \
-       --disable-postproc \
-       --disable-swresample \
-       --disable-swscale \
-       --disable-everything \
-       $(call FFMPEG_ENABLE,decoder,$(FFMPEG_AUDIO_DECODERS)) \
-       $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_AUDIO_DEMUXERS)) \
-       $(call FFMPEG_ENABLE,protocol,$(FFMPEG_AUDIO_PROTOCOLS)) \
-       --disable-decoder=pcm_bluray,pcm_dvd
+       $(if $(CONFIG_BUILD_PATENTED),, \
+               $(call FFMPEG_DISABLE,decoder,$(FFMPEG_PATENTED_DECODERS)) \
+               $(call FFMPEG_DISABLE,muxer,$(FFMPEG_PATENTED_MUXERS)) \
+               $(call FFMPEG_DISABLE,demuxer,$(FFMPEG_PATENTED_DEMUXERS)) \
+               $(call FFMPEG_DISABLE,parser,$(FFMPEG_PATENTED_PARSERS)))
 endif
 
 ifeq ($(BUILD_VARIANT),mini)
 
-  FFMPEG_ENABLE= \
-       $(foreach c, $(2), \
-               --enable-$(1)="$(c)" \
-       )
-
   FFMPEG_CONFIGURE+= \
        --enable-small \
+       --disable-hardcoded-tables \
        \
        --disable-programs \
        --disable-avdevice \
        --disable-avfilter \
-       --disable-postproc \
        --disable-swresample \
        --disable-swscale \
        --disable-everything \
@@ -650,129 +601,49 @@ define Build/Compile
                all install
 endef
 
-define Build/InstallDev/custom
+# stage whatever the variant built - headers, static and shared libraries,
+# .pc files - so there is no per-variant library list to keep in sync
+define Build/InstallDev/Default
        $(INSTALL_DIR) $(1)/usr/include
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avformat,avutil} $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
        $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avformat,avutil}.{a,so*} $(1)/usr/lib/
-ifeq ($(CONFIG_FFMPEG_CUSTOM_PROGRAMS),y)
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avfilter,swresample}.{a,so*} $(1)/usr/lib/
-endif
-ifeq ($(BUILD_VARIANT),custom)
-  ifneq ($(CONFIG_PACKAGE_ffmpeg-custom),n)
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavfilter.{a,so*} $(1)/usr/lib/
-  endif
-endif
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.{a,so*} $(1)/usr/lib/
        $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avformat,avutil}.pc $(1)/usr/lib/pkgconfig/
-ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libx264),y)
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/libpostproc $(1)/usr/include/
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.{a,so*} $(1)/usr/lib/
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpostproc.pc $(1)/usr/lib/pkgconfig/
-endif
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/
 endef
 
-# Only ffmpeg with libx264 is GPL (yes libpostproc); all other builds are lgpl (no libpostproc)
-define Build/InstallDev/full
-       $(INSTALL_DIR) $(1)/usr/include
-       $(INSTALL_DIR) $(1)/usr/lib
-       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avfilter,avformat,avutil,swresample,swscale} $(1)/usr/include/
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avutil,swresample,swscale}.{a,so*} $(1)/usr/lib/
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avfilter,avformat,avutil,swresample,swscale}.pc $(1)/usr/lib/pkgconfig/
-ifneq ($(CONFIG_PACKAGE_libx264),)
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/libpostproc $(1)/usr/include/
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.{a,so*} $(1)/usr/lib/
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpostproc.pc $(1)/usr/lib/pkgconfig/
-endif
-endef
-
-define Build/InstallDev/mini
-       $(INSTALL_DIR) $(1)/usr/include
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avformat,avutil} $(1)/usr/include/
-       $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avformat,avutil}.{a,so*} $(1)/usr/lib/
-       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avformat,avutil}.pc $(1)/usr/lib/pkgconfig/
-endef
-
-Build/InstallDev/audio-dec = $(Build/InstallDev/custom)
-
-# XXX: attempt at installing "best" dev files available
-ifeq ($(BUILD_VARIANT),custom)
-  # XXX: only install "custom" dev files if -full & -mini are not selected
-  ifeq ($(CONFIG_PACKAGE_libffmpeg-full)$(CONFIG_PACKAGE_libffmpeg-mini),)
-    Build/InstallDev = $(Build/InstallDev/custom)
-  endif
-endif
-ifeq ($(BUILD_VARIANT),audio-dec)
-  # XXX: only install "audio-dec" dev files if -full & -mini are not selected
-  ifeq ($(CONFIG_PACKAGE_libffmpeg-full)$(CONFIG_PACKAGE_libffmpeg-mini),)
-    Build/InstallDev = $(Build/InstallDev/audio-dec)
-  endif
-endif
-ifeq ($(BUILD_VARIANT),full)
-  # XXX: always install "full" dev files if -full is selected
-  Build/InstallDev = $(Build/InstallDev/full)
+# Both variants stage into the same directory; libffmpeg takes precedence,
+# mini is staged only when libffmpeg is not selected (the two conflict at
+# install time).
+ifeq ($(BUILD_VARIANT),default)
+  Build/InstallDev = $(Build/InstallDev/Default)
 endif
 ifeq ($(BUILD_VARIANT),mini)
-  # XXX: only install "mini" dev files if -full is not selected
-  ifeq ($(CONFIG_PACKAGE_libffmpeg-full),)
-    Build/InstallDev = $(Build/InstallDev/mini)
+  ifeq ($(CONFIG_PACKAGE_libffmpeg),)
+    Build/InstallDev = $(Build/InstallDev/Default)
   endif
 endif
 
 define Package/ffmpeg/install
        $(INSTALL_DIR) $(1)/usr/bin
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffmpeg $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ffmpeg $(1)/usr/bin/ffmpeg
 endef
 
-Package/ffmpeg-custom/install = $(Package/ffmpeg/install)
-
 define Package/ffprobe/install
        $(INSTALL_DIR) $(1)/usr/bin
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffprobe $(1)/usr/bin/
-endef
-
-Package/ffprobe-custom/install = $(Package/ffprobe/install)
-
-define Package/libffmpeg-custom/install
-       $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avformat,avutil}.so.* $(1)/usr/lib/
-ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libx264),y)
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.so.* $(1)/usr/lib/
-endif
-ifeq ($(CONFIG_FFMPEG_CUSTOM_PROGRAMS),y)
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avfilter,swresample}.so.* $(1)/usr/lib/
-endif
-ifeq ($(BUILD_VARIANT),custom)
-  ifneq ($(CONFIG_PACKAGE_ffmpeg-custom),n)
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavfilter.so.* $(1)/usr/lib/
-  endif
-endif
-endef
-
-# Only ffmpeg with libx264 is GPL (yes libpostproc); all other builds are lgpl (no libpostproc)
-define Package/libffmpeg-full/install
-       $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avutil,swresample,swscale}.so.* $(1)/usr/lib/
-ifneq ($(CONFIG_PACKAGE_libx264),)
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.so.* $(1)/usr/lib/
-endif
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ffprobe $(1)/usr/bin/ffprobe
 endef
 
-define Package/libffmpeg-mini/install
+# ship whatever shared libraries the variant built
+define Package/libffmpeg/install/Default
        $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avformat,avutil}.so.* $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so.* $(1)/usr/lib/
 endef
 
-Package/libffmpeg-audio-dec/install = $(Package/libffmpeg-custom/install)
+Package/libffmpeg/install = $(Package/libffmpeg/install/Default)
+Package/libffmpeg-mini/install = $(Package/libffmpeg/install/Default)
 
 $(eval $(call BuildPackage,ffmpeg))
 $(eval $(call BuildPackage,ffprobe))
-$(eval $(call BuildPackage,ffmpeg-custom))
-$(eval $(call BuildPackage,ffprobe-custom))
-$(eval $(call BuildPackage,libffmpeg-audio-dec))
-$(eval $(call BuildPackage,libffmpeg-full))
+$(eval $(call BuildPackage,libffmpeg))
 $(eval $(call BuildPackage,libffmpeg-mini))
-$(eval $(call BuildPackage,libffmpeg-custom))
diff --git a/multimedia/ffmpeg/patches/020-libavcodec-fix-Wint-conversion-in-vulkan.patch b/multimedia/ffmpeg/patches/020-libavcodec-fix-Wint-conversion-in-vulkan.patch
deleted file mode 100644 (file)
index 1c4316f..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-From 2f24f10d9cf34ddce274496c4daa73f732d370c1 Mon Sep 17 00:00:00 2001
-From: Sam James <sam@gentoo.org>
-Date: Wed, 20 Dec 2023 12:32:43 +0000
-Subject: [PATCH] libavcodec: fix -Wint-conversion in vulkan
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-FIx warnings (soon to be errors in GCC 14, already so in Clang 15):
-```
-src/libavcodec/vulkan_av1.c: In function â€˜vk_av1_create_params’:
-src/libavcodec/vulkan_av1.c:183:43: error: initialization of â€˜long long unsigned int’ from â€˜void *’ makes integer from pointer without a cast [-Wint-conversion]
-  183 |         .videoSessionParametersTemplate = NULL,
-      |                                           ^~~~
-src/libavcodec/vulkan_av1.c:183:43: note: (near initialization for â€˜(anonymous).videoSessionParametersTemplate’)
-```
-
-Use Vulkan's VK_NULL_HANDLE instead of bare NULL.
-
-Fix Trac ticket #10724.
-
-Was reported downstream in Gentoo at https://bugs.gentoo.org/919067.
-
-Signed-off-by: Sam James <sam@gentoo.org>
----
- libavcodec/vulkan_av1.c    | 2 +-
- libavcodec/vulkan_decode.c | 6 +++---
- libavcodec/vulkan_h264.c   | 2 +-
- libavcodec/vulkan_hevc.c   | 2 +-
- libavcodec/vulkan_video.c  | 2 +-
- 5 files changed, 7 insertions(+), 7 deletions(-)
-
---- a/libavcodec/vulkan_av1.c
-+++ b/libavcodec/vulkan_av1.c
-@@ -180,7 +180,7 @@ static int vk_av1_create_params(AVCodecC
-         .sType = VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR,
-         .pNext = &av1_params,
-         .videoSession = ctx->common.session,
--        .videoSessionParametersTemplate = NULL,
-+        .videoSessionParametersTemplate = VK_NULL_HANDLE,
-     };
-     err = ff_vk_decode_create_params(buf, avctx, ctx, &session_params_create);
---- a/libavcodec/vulkan_decode.c
-+++ b/libavcodec/vulkan_decode.c
-@@ -188,9 +188,9 @@ int ff_vk_decode_prepare_frame(FFVulkanD
-         return 0;
-     vkpic->dpb_frame     = NULL;
--    vkpic->img_view_ref  = NULL;
--    vkpic->img_view_out  = NULL;
--    vkpic->img_view_dest = NULL;
-+    vkpic->img_view_ref  = VK_NULL_HANDLE;
-+    vkpic->img_view_out  = VK_NULL_HANDLE;
-+    vkpic->img_view_dest = VK_NULL_HANDLE;
-     vkpic->destroy_image_view = vk->DestroyImageView;
-     vkpic->wait_semaphores = vk->WaitSemaphores;
---- a/libavcodec/vulkan_h264.c
-+++ b/libavcodec/vulkan_h264.c
-@@ -315,7 +315,7 @@ static int vk_h264_create_params(AVCodec
-         .sType = VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR,
-         .pNext = &h264_params,
-         .videoSession = ctx->common.session,
--        .videoSessionParametersTemplate = NULL,
-+        .videoSessionParametersTemplate = VK_NULL_HANDLE,
-     };
-     /* SPS list */
---- a/libavcodec/vulkan_hevc.c
-+++ b/libavcodec/vulkan_hevc.c
-@@ -653,7 +653,7 @@ static int vk_hevc_create_params(AVCodec
-         .sType = VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR,
-         .pNext = &h265_params,
-         .videoSession = ctx->common.session,
--        .videoSessionParametersTemplate = NULL,
-+        .videoSessionParametersTemplate = VK_NULL_HANDLE,
-     };
-     HEVCHeaderSet *hdr;
---- a/libavcodec/vulkan_video.c
-+++ b/libavcodec/vulkan_video.c
-@@ -287,7 +287,7 @@ av_cold void ff_vk_video_common_uninit(F
-     if (common->session) {
-         vk->DestroyVideoSessionKHR(s->hwctx->act_dev, common->session,
-                                    s->hwctx->alloc);
--        common->session = NULL;
-+        common->session = VK_NULL_HANDLE;
-     }
-     if (common->nb_mem && common->mem)
diff --git a/multimedia/ffmpeg/patches/030-avformat-file-guard-fd_dup-by-FD_PROTOCOL-or-PIPE_PR.patch b/multimedia/ffmpeg/patches/030-avformat-file-guard-fd_dup-by-FD_PROTOCOL-or-PIPE_PR.patch
deleted file mode 100644 (file)
index 00487f5..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-From cb9c98da16e8412046835ebc0d167a4e09909df0 Mon Sep 17 00:00:00 2001
-From: Zhao Zhili <zhilizhao@tencent.com>
-Date: Sun, 30 Jun 2024 18:33:19 +0800
-Subject: [PATCH] avformat/file: guard fd_dup by FD_PROTOCOL or PIPE_PROTOCOL
-
-fd_dup is unused when fd and pipe have been disabled. This also
-fix build error with wasi since 'dup' isn't available.
-
-Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
----
- libavformat/file.c | 2 ++
- 1 file changed, 2 insertions(+)
-
---- a/libavformat/file.c
-+++ b/libavformat/file.c
-@@ -192,6 +192,7 @@ static int file_check(URLContext *h, int
-     return ret;
- }
-+#if CONFIG_FD_PROTOCOL || CONFIG_PIPE_PROTOCOL
- static int fd_dup(URLContext *h, int oldfd)
- {
-     int newfd;
-@@ -214,6 +215,7 @@ static int fd_dup(URLContext *h, int old
- #endif
-     return newfd;
- }
-+#endif
- static int file_close(URLContext *h)
- {
diff --git a/multimedia/ffmpeg/patches/040-vulkan_decode-fix-the-print-format-of-VkDeviceSize.patch b/multimedia/ffmpeg/patches/040-vulkan_decode-fix-the-print-format-of-VkDeviceSize.patch
deleted file mode 100644 (file)
index aa7c991..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-From c961ac4b0ca27d451c430553793b3fff88fc78e5 Mon Sep 17 00:00:00 2001
-From: Jun Zhao <mypopydev@gmail.com>
-Date: Sun, 12 Nov 2023 18:25:29 +0800
-Subject: [PATCH] vulkan_decode: fix the print format of VkDeviceSize
-
-VkDeviceSize represents device memory size and offset
-values as uint64_t in Spec.
-
-Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
----
- libavcodec/vulkan_video.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/libavcodec/vulkan_video.c
-+++ b/libavcodec/vulkan_video.c
-@@ -384,7 +384,7 @@ av_cold int ff_vk_video_common_init(void
-             .memorySize = mem[i].memoryRequirements.size,
-         };
--        av_log(log, AV_LOG_VERBOSE, "Allocating %"SIZE_SPECIFIER" bytes in bind index %i for video session\n",
-+        av_log(log, AV_LOG_VERBOSE, "Allocating %"PRIu64" bytes in bind index %i for video session\n",
-                bind_mem[i].memorySize, bind_mem[i].memoryBindIndex);
-     }
diff --git a/multimedia/ffmpeg/patches/050-avcodec-dct-Make-declarations-and-definitions-match.patch b/multimedia/ffmpeg/patches/050-avcodec-dct-Make-declarations-and-definitions-match.patch
deleted file mode 100644 (file)
index 8b05067..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-From 2204efc2a656ae60d77a4d01c6cf8e7d6baaf030 Mon Sep 17 00:00:00 2001
-From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-Date: Sun, 30 Mar 2025 12:49:07 +0200
-Subject: [PATCH] avcodec/dct: Make declarations and definitions match
-
-GCC considers declarations using a parameter of pointer
-type (or equivalently a parameter using an array of unspecified
-dimensions) to be inconsistent with a declaration using
-a known-length array type and emits a -Warray-parameter warning
-for several ff_j_rev_dct* functions for this.
-
-This patch makes the declarations match the actual definitions
-to suppress these (IMO nonsensical) warnings.
-
-Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
----
- libavcodec/dct.h     | 12 ++++++------
- libavcodec/jrevdct.c |  4 ++--
- 2 files changed, 8 insertions(+), 8 deletions(-)
-
---- a/libavcodec/dct.h
-+++ b/libavcodec/dct.h
-@@ -27,11 +27,11 @@
- #include <stddef.h>
- #include <stdint.h>
--void ff_j_rev_dct(int16_t *data);
--void ff_j_rev_dct4(int16_t *data);
--void ff_j_rev_dct2(int16_t *data);
--void ff_j_rev_dct1(int16_t *data);
--void ff_jref_idct_put(uint8_t *dest, ptrdiff_t line_size, int16_t *block);
--void ff_jref_idct_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block);
-+void ff_j_rev_dct(int16_t data[64]);
-+void ff_j_rev_dct4(int16_t data[64]);
-+void ff_j_rev_dct2(int16_t data[64]);
-+void ff_j_rev_dct1(int16_t data[64]);
-+void ff_jref_idct_put(uint8_t *dest, ptrdiff_t line_size, int16_t block[64]);
-+void ff_jref_idct_add(uint8_t *dest, ptrdiff_t line_size, int16_t block[64]);
- #endif /* AVCODEC_DCT_H */
---- a/libavcodec/jrevdct.c
-+++ b/libavcodec/jrevdct.c
-@@ -1159,13 +1159,13 @@ void ff_j_rev_dct1(DCTBLOCK data){
- #undef FIX
- #undef CONST_BITS
--void ff_jref_idct_put(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
-+void ff_jref_idct_put(uint8_t *dest, ptrdiff_t line_size, int16_t block[64])
- {
-     ff_j_rev_dct(block);
-     ff_put_pixels_clamped_c(block, dest, line_size);
- }
--void ff_jref_idct_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
-+void ff_jref_idct_add(uint8_t *dest, ptrdiff_t line_size, int16_t block[64])
- {
-     ff_j_rev_dct(block);
-     ff_add_pixels_clamped_c(block, dest, line_size);
diff --git a/multimedia/ffmpeg/patches/060-avutil-tx-fix-GCC-memset-warning.patch b/multimedia/ffmpeg/patches/060-avutil-tx-fix-GCC-memset-warning.patch
deleted file mode 100644 (file)
index 1206138..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-From 9a670636c0ee7c24b70591d315524e61c709ea5a Mon Sep 17 00:00:00 2001
-From: Rosen Penev <rosenp@gmail.com>
-Date: Fri, 2 May 2025 15:15:25 -0700
-Subject: [PATCH] avutil/tx: fix GCC memset warning
-
-The warning is that the whole array is not being cleared.
-
-Signed-off-by: Rosen Penev <rosenp@gmail.com>
----
- libavutil/tx.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/libavutil/tx.c
-+++ b/libavutil/tx.c
-@@ -283,7 +283,7 @@ static void reset_ctx(AVTXContext *s, in
-      * ff_tx_init_subtx() call is made. */
-     s->nb_sub = 0;
-     s->opaque = NULL;
--    memset(s->fn, 0, sizeof(*s->fn));
-+    memset(s->fn, 0, sizeof(s->fn));
- }
- void ff_tx_clear_ctx(AVTXContext *s)
diff --git a/multimedia/ffmpeg/patches/070-avformat-rawdec-guard-by-CONFIG_DATA_DEMUXER.patch b/multimedia/ffmpeg/patches/070-avformat-rawdec-guard-by-CONFIG_DATA_DEMUXER.patch
deleted file mode 100644 (file)
index c8fb97b..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-From 22baff53be0f830a1607af2b60e50605eb732ec4 Mon Sep 17 00:00:00 2001
-From: Rosen Penev <rosenp@gmail.com>
-Date: Fri, 2 May 2025 15:21:13 -0700
-Subject: [PATCH] avformat/rawdec: guard by CONFIG_DATA_DEMUXER
-
-Otherwise raw_data_read_header becomes an unused static function.
-
-Signed-off-by: Rosen Penev <rosenp@gmail.com>
----
- libavformat/rawdec.c | 2 ++
- 1 file changed, 2 insertions(+)
-
---- a/libavformat/rawdec.c
-+++ b/libavformat/rawdec.c
-@@ -102,6 +102,7 @@ int ff_raw_subtitle_read_header(AVFormat
-     return 0;
- }
-+#if CONFIG_DATA_DEMUXER
- static int raw_data_read_header(AVFormatContext *s)
- {
-     AVStream *st = avformat_new_stream(s, NULL);
-@@ -112,6 +113,7 @@ static int raw_data_read_header(AVFormat
-     st->start_time = 0;
-     return 0;
- }
-+#endif
- /* Note: Do not forget to add new entries to the Makefile as well. */
diff --git a/multimedia/ffmpeg/patches/080-avcodec-pcm-bluray-dvd-Use-correct-pointer-types-on-.patch b/multimedia/ffmpeg/patches/080-avcodec-pcm-bluray-dvd-Use-correct-pointer-types-on-.patch
deleted file mode 100644 (file)
index 29abd88..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-From 347a70f101be28f8d78e8fd62ffc3a78324f49e9 Mon Sep 17 00:00:00 2001
-From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-Date: Thu, 28 Mar 2024 05:35:36 +0100
-Subject: [PATCH] avcodec/pcm-bluray/dvd: Use correct pointer types on BE
-
-Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
----
- libavcodec/pcm-bluray.c | 5 +++--
- libavcodec/pcm-dvd.c    | 2 +-
- 2 files changed, 4 insertions(+), 3 deletions(-)
-
---- a/libavcodec/pcm-bluray.c
-+++ b/libavcodec/pcm-bluray.c
-@@ -167,7 +167,7 @@ static int pcm_bluray_decode_frame(AVCod
-             samples *= num_source_channels;
-             if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
- #if HAVE_BIGENDIAN
--                bytestream2_get_buffer(&gb, dst16, buf_size);
-+                bytestream2_get_buffer(&gb, (uint8_t*)dst16, buf_size);
- #else
-                 do {
-                     *dst16++ = bytestream2_get_be16u(&gb);
-@@ -187,7 +187,8 @@ static int pcm_bluray_decode_frame(AVCod
-             if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
-                 do {
- #if HAVE_BIGENDIAN
--                    bytestream2_get_buffer(&gb, dst16, avctx->ch_layout.nb_channels * 2);
-+                    bytestream2_get_buffer(&gb, (uint8_t*)dst16,
-+                                           avctx->ch_layout.nb_channels * 2);
-                     dst16 += avctx->ch_layout.nb_channels;
- #else
-                     channel = avctx->ch_layout.nb_channels;
---- a/libavcodec/pcm-dvd.c
-+++ b/libavcodec/pcm-dvd.c
-@@ -157,7 +157,7 @@ static void *pcm_dvd_decode_samples(AVCo
-     switch (avctx->bits_per_coded_sample) {
-     case 16: {
- #if HAVE_BIGENDIAN
--        bytestream2_get_buffer(&gb, dst16, blocks * s->block_size);
-+        bytestream2_get_buffer(&gb, (uint8_t*)dst16, blocks * s->block_size);
-         dst16 += blocks * s->block_size / 2;
- #else
-         int samples = blocks * avctx->ch_layout.nb_channels;
diff --git a/multimedia/ffmpeg/patches/090-avcodec-tiff-Suppress-unused-variable-warnings.patch b/multimedia/ffmpeg/patches/090-avcodec-tiff-Suppress-unused-variable-warnings.patch
deleted file mode 100644 (file)
index 65bed65..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-From bb3c50b46d50b8bf4f45d7ae8f24607aaf23acea Mon Sep 17 00:00:00 2001
-From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-Date: Sun, 2 Jun 2024 06:11:46 +0200
-Subject: [PATCH] avcodec/tiff: Suppress unused variable warnings
-
-Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
----
- libavcodec/tiff.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
---- a/libavcodec/tiff.c
-+++ b/libavcodec/tiff.c
-@@ -427,7 +427,7 @@ static void av_always_inline horizontal_
-             uint8_t shift = is_dng ? 0 : 16 - bpp;
-             GetBitContext gb;
--            int ret = init_get_bits8(&gb, src, width);
-+            av_unused int ret = init_get_bits8(&gb, src, width);
-             av_assert1(ret >= 0);
-             for (int i = 0; i < s->width; i++) {
-                 dst16[i] = get_bits(&gb, bpp) << shift;
-@@ -462,7 +462,7 @@ static void unpack_gray(TiffContext *s,
-     GetBitContext gb;
-     uint16_t *dst = (uint16_t *)(p->data[0] + lnum * p->linesize[0]);
--    int ret = init_get_bits8(&gb, src, width);
-+    av_unused int ret = init_get_bits8(&gb, src, width);
-     av_assert1(ret >= 0);
-     for (int i = 0; i < s->width; i++) {
diff --git a/multimedia/ffmpeg/patches/100-avcodec-tableprint_vlc-Unbreak-hardcoded-tables.patch b/multimedia/ffmpeg/patches/100-avcodec-tableprint_vlc-Unbreak-hardcoded-tables.patch
deleted file mode 100644 (file)
index 5e25f34..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-From 1d47ae65bf6df91246cbe25c997b25947f7a4d1d Mon Sep 17 00:00:00 2001
-From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-Date: Thu, 4 Dec 2025 18:42:02 +0100
-Subject: [PATCH] avcodec/tableprint_vlc: Unbreak hardcoded tables
-
-Forgotten in d8ffec5bf9a2803f55cc0822a97b7815f24bee83.
-Fixes issue #21102.
-
-Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
----
- libavcodec/tableprint_vlc.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/libavcodec/tableprint_vlc.h
-+++ b/libavcodec/tableprint_vlc.h
-@@ -27,7 +27,7 @@
- #define av_log(a, ...) while(0)
- #define ff_dlog(a, ...) while(0)
- #define AVUTIL_MEM_H
--#define av_malloc(s) NULL
-+#define av_mallocz(s) NULL
- #define av_malloc_array(a, b) NULL
- #define av_realloc_f(p, o, n) NULL
- #define av_free(p) while(0)
diff --git a/multimedia/ffmpeg/patches/120-avfilter-af_channelsplit-fix-mixed-declaration-and-c.patch b/multimedia/ffmpeg/patches/120-avfilter-af_channelsplit-fix-mixed-declaration-and-c.patch
deleted file mode 100644 (file)
index 9b37926..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-From 613c85a8f5b296c2b79fc0abfd98fccf962bb334 Mon Sep 17 00:00:00 2001
-From: Marvin Scholz <epirat07@gmail.com>
-Date: Fri, 12 Jul 2024 17:47:14 +0200
-Subject: [PATCH] avfilter/af_channelsplit: fix mixed declaration and code
-
-Fix a "mixing declarations and code is incompatible with standards
-before C99" warning.
----
- libavfilter/af_channelsplit.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
---- a/libavfilter/af_channelsplit.c
-+++ b/libavfilter/af_channelsplit.c
-@@ -156,6 +156,7 @@ static int query_formats(AVFilterContext
- static int filter_frame(AVFilterLink *outlink, AVFrame *buf)
- {
-+    AVFrame *buf_out;
-     AVFilterContext *ctx = outlink->src;
-     ChannelSplitContext *s = ctx->priv;
-     const int i = FF_OUTLINK_IDX(outlink);
-@@ -164,7 +165,7 @@ static int filter_frame(AVFilterLink *ou
-     av_assert1(channel >= 0);
--    AVFrame *buf_out = av_frame_clone(buf);
-+    buf_out = av_frame_clone(buf);
-     if (!buf_out)
-         return AVERROR(ENOMEM);
diff --git a/multimedia/ffmpeg/patches/160-libavdevice-v4l2-libv4l2-posix-ioctl.patch b/multimedia/ffmpeg/patches/160-libavdevice-v4l2-libv4l2-posix-ioctl.patch
new file mode 100644 (file)
index 0000000..e70d512
--- /dev/null
@@ -0,0 +1,48 @@
+From e8bb0c69987b6b894b594d672230f6164d11fbc0 Mon Sep 17 00:00:00 2001
+From: Mirko Vogt <foss@mirko.in>
+Date: Thu, 10 Sep 2026 22:34:11 +0000
+Subject: [PATCH] libavdevice/v4l2: tell libv4l2.h about the POSIX ioctl
+ signature
+
+libv4l2.h declares v4l2_ioctl() with a "long request" by default and only
+switches to the POSIX/musl "int request" signature when the *consumer*
+defines a feature macro before including it: HAVE_POSIX_IOCTL up to
+v4l-utils 1.30 (added 2024-10-17), LIBV4L_HAVE_POSIX_IOCTL from 1.32 on
+(renamed 2025-09-10 to avoid clashing with consumers' own config.h).
+
+FFmpeg detects the musl signature itself (HAVE_IOCTL_POSIX) and types its
+ioctl_f accordingly, but never forwards that knowledge to libv4l2.h. It used
+to work by accident while FFmpeg's config.h still spelled the symbol
+HAVE_POSIX_IOCTL; commit 5fea5e3e11d6 ("configure: rename POSIX ioctl check")
+renamed it and the header fell back to the "long" prototype. With GCC 14
+the resulting pointer-type mismatch is an error:
+
+  libavdevice/v4l2.c:145:17: error: assignment to 'int (*)(int,  int, ...)'
+  from incompatible pointer type 'int (*)(int,  long unsigned int, ...)'
+
+Define both spellings so either header generation gets the signature the
+library was actually built with (OpenWrt builds v4l-utils with
+HAVE_POSIX_IOCTL on musl). Same approach as q66's posix-ioctl.patch in
+Chimera Linux and Alpine, which defines one of the two names per copy;
+this patch defines both.
+
+Signed-off-by: Mirko Vogt <foss@mirko.in>
+
+---
+--- a/libavdevice/v4l2.c
++++ b/libavdevice/v4l2.c
+@@ -49,6 +49,14 @@
+ #include <dirent.h>
+ #if CONFIG_LIBV4L2
++#if HAVE_IOCTL_POSIX
++/* libv4l2.h only declares v4l2_ioctl() with the POSIX "int request"
++ * signature when told so by the consumer: HAVE_POSIX_IOCTL up to
++ * v4l-utils 1.30, LIBV4L_HAVE_POSIX_IOCTL from 1.32 on. Without it the
++ * assignment to ioctl_f below has an incompatible pointer type on musl. */
++#define HAVE_POSIX_IOCTL 1
++#define LIBV4L_HAVE_POSIX_IOCTL 1
++#endif
+ #include <libv4l2.h>
+ #endif
diff --git a/multimedia/ffmpeg/patches/170-tls_mbedtls-build-without-version-module.patch b/multimedia/ffmpeg/patches/170-tls_mbedtls-build-without-version-module.patch
new file mode 100644 (file)
index 0000000..2b9b1af
--- /dev/null
@@ -0,0 +1,49 @@
+From e8979a51f671fe2cb51d34c670abe10dfebc4c3f Mon Sep 17 00:00:00 2001
+From: Mirko Vogt <foss@mirko.in>
+Date: Thu, 10 Sep 2026 22:34:12 +0000
+Subject: [PATCH] avformat/tls_mbedtls: build without mbedTLS's version module
+
+mbedTLS's version module (MBEDTLS_VERSION_C) is optional and distributions
+building a size-optimised mbedTLS leave it out; mbedtls/version.h then does
+not declare mbedtls_version_get_number() and the unconditional call in
+tls_open() fails to compile:
+
+  libavformat/tls_mbedtls.c:637:9: error: implicit declaration of function
+  'mbedtls_version_get_number'
+
+The call only exists to detect mbedTLS 3.6.0, whose TLS 1.3 code cannot
+disable certificate verification. Query the version at runtime when the
+module is available and fall back to the compile-time MBEDTLS_VERSION_NUMBER
+otherwise; the two only differ when the headers do not match the library.
+
+Signed-off-by: Mirko Vogt <foss@mirko.in>
+
+---
+--- a/libavformat/tls_mbedtls.c
++++ b/libavformat/tls_mbedtls.c
+@@ -44,6 +44,16 @@
+ #include "libavutil/avstring.h"
+ #include "libavutil/random_seed.h"
++/* The version module is optional in mbedTLS (MBEDTLS_VERSION_C). */
++static unsigned int tls_mbedtls_version_number(void)
++{
++#if defined(MBEDTLS_VERSION_C)
++    return mbedtls_version_get_number();
++#else
++    return MBEDTLS_VERSION_NUMBER;
++#endif
++}
++
+ static int mbedtls_x509_fingerprint(char *cert_buf, size_t cert_sz, char **fingerprint)
+ {
+     unsigned char md[32];
+@@ -634,7 +644,7 @@ static int tls_open(URLContext *h, const
+ #ifdef MBEDTLS_SSL_PROTO_TLS1_3
+     // this version does not allow disabling certificate verification with TLSv1.3 (yes, really).
+-    if (mbedtls_version_get_number() == 0x03060000 && !shr->verify) {
++    if (tls_mbedtls_version_number() == 0x03060000 && !shr->verify) {
+         av_log(h, AV_LOG_INFO, "Forcing TLSv1.2 because certificate verification is disabled\n");
+         mbedtls_ssl_conf_max_tls_version(&tls_ctx->ssl_config, MBEDTLS_SSL_VERSION_TLS1_2);
+     }
diff --git a/multimedia/ffmpeg/patches/180-mips-cabac-no-mips16.patch b/multimedia/ffmpeg/patches/180-mips-cabac-no-mips16.patch
new file mode 100644 (file)
index 0000000..a9c9b72
--- /dev/null
@@ -0,0 +1,40 @@
+From 8ceae920ff60974b22c7b1b8139310584702bf0f Mon Sep 17 00:00:00 2001
+From: Rosen Penev <rosenp@gmail.com>
+Date: Fri, 11 Sep 2026 16:16:53 -0700
+Subject: [PATCH] avcodec/mips/cabac: do not use the inline assembly in MIPS16
+ mode
+
+The MIPS CABAC inline assembly uses 32-bit-only registers and
+instructions (sll with $25, movz, movn) and is included by every CABAC
+decoder without an inline-asm guard. Compiled with -mips16, as OpenWrt
+builds MIPS packages, the assembler rejects it:
+
+  {standard input}:9366: Error: invalid operands `sll $25,$4,0x11'
+  {standard input}:9369: Error: opcode not supported on this processor:
+  mips32r2 (mips32r2) `movz $6,$16,$17'
+
+Fall back to the C implementation when __mips16 is defined.
+
+Signed-off-by: Rosen Penev <rosenp@gmail.com>
+---
+ libavcodec/mips/cabac.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/libavcodec/mips/cabac.h
++++ b/libavcodec/mips/cabac.h
+@@ -30,7 +30,7 @@
+ #include "libavutil/mips/mmiutils.h"
+ #include "config.h"
+-#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
++#if !defined(__mips16) && !HAVE_MIPS32R6 && !HAVE_MIPS64R6
+ #define get_cabac_inline get_cabac_inline_mips
+ static av_always_inline int get_cabac_inline_mips(CABACContext *c,
+                                                   uint8_t * const state){
+@@ -226,5 +226,5 @@ static av_always_inline int get_cabac_by
+     return res;
+ }
+-#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
++#endif /* !defined(__mips16) && !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
+ #endif /* AVCODEC_MIPS_CABAC_H */
diff --git a/multimedia/ffmpeg/patches/190-configure-hevcparse-select-hevc_sei.patch b/multimedia/ffmpeg/patches/190-configure-hevcparse-select-hevc_sei.patch
new file mode 100644 (file)
index 0000000..6c14a30
--- /dev/null
@@ -0,0 +1,31 @@
+From 0a6cd2e97d8707429a9aeae854475b1f41d2de50 Mon Sep 17 00:00:00 2001
+From: Mirko Vogt <foss@mirko.in>
+Date: Thu, 10 Sep 2026 22:34:12 +0000
+Subject: [PATCH] configure: hevcparse requires hevc_sei
+
+libavcodec/hevc/parse.c calls ff_hevc_decode_nal_sei(), which lives in
+hevc/sei.o and is only built for hevc_sei. hevcparse does not select
+hevc_sei; the HEVC decoder and parser happen to select both, so the gap
+only shows when they are disabled while another hevcparse user stays
+enabled. The dovi_split bitstream filter is such a user, and it is
+enabled by default:
+
+  ./configure --disable-decoder=hevc --disable-parser=hevc
+  libavcodec/libavcodec.so: undefined reference to `ff_hevc_decode_nal_sei'
+
+Select hevc_sei from hevcparse.
+
+Signed-off-by: Mirko Vogt <foss@mirko.in>
+
+---
+--- a/configure
++++ b/configure
+@@ -3099,7 +3099,7 @@ faanidct_select="idctdsp"
+ h264dsp_select="startcode"
+ h264parse_select="golomb"
+ h264_sei_select="golomb itut_t35"
+-hevcparse_select="golomb"
++hevcparse_select="golomb hevc_sei"
+ hevc_sei_select="golomb itut_t35"
+ iso_writer_select="golomb"
+ frame_thread_encoder_deps="encoders threads"
git clone https://git.99rst.org/PROJECT