Skip to content

ffmpeg 9 - #30455

Open
mirko wants to merge 6 commits into
openwrt:masterfrom
mirko:ffmpeg9
Open

ffmpeg 9#30455
mirko wants to merge 6 commits into
openwrt:masterfrom
mirko:ffmpeg9

Conversation

@mirko

@mirko mirko commented Sep 5, 2026

Copy link
Copy Markdown
Member

📦 Package Details

Maintainer: @thess @antonlacon
(You can find this by checking the history of the package Makefile.)

Description:
Update to ffmpeg 9.x.

ffmpeg is a complex beast and every major release changes and breaks things.
Now we're going from 6.x to 9.x - and on top purposely introduced some design changes to the package.

This will inevitably break things!

Decisions:

  • drop libffmpeg-full, ffmpeg-custom and libffmpeg-audio-dec; there's libffmpeg and libffmpeg-mini now, where the former defaults to what -full provided and can be fully customised, -mini stays the same with a static set of build options, libffmpeg-full and libffmpeg-audio-dec provided as legacy aliases to not break packages right away. Only upstream package using libffmpeg-audio-dec is squeezelite (maintained by @kel-mo), maybe that one can just depend on ffmpeg (full)?
  • focus on deterministic builds rather on implicit decision making (auto-detection, if package A is selected, enable support for B, etc.)
  • focus on decoding rather than encoding, with only encoders being pre-selected upstream packages depend on (mp3, h264) (fine with adding encoders on-demand, but no need to do so pro-actively, as the difference in use cases for decoding and encoding is significant).
  • making mbedtls the default TLS backend provider
  • dropping the presets specified in Config.in for minidlna and audio-decoding

The patches coming along with this PR are mostly either compile fixes or taken over from LibreElec.
It's obvious we're trying to lay grounds for getting Kodi running, so I'm not even trying suger-coat that some of the patches are exclusively for catering kodi.


🧪 Run Testing Details

  • OpenWrt Version:
  • OpenWrt Target/Subtarget:
  • OpenWrt Device:

✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

If your PR contains a patch:

  • It can be applied using git am
  • It has been refreshed to avoid offsets, fuzzes, etc., using
    make package/<your-package>/refresh V=s
  • It is structured in a way that it is potentially upstreamable
    (e.g., subject line, commit description, etc.)
    We must try to upstream patches to reduce maintenance burden.

@mirko mirko mentioned this pull request Sep 5, 2026
4 tasks

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit checks

  • eb43bbc "ffmpeg: update to 9.0.1" — the new base configure block passes --disable-v4l2-request / --disable-libudev, and the custom/mini/audio-dec blocks still pass --disable-postproc; stock 9.0.1 configure has none of those (no v4l2_request and no postproc library in FFmpeg 9's option lists) and dies on an unknown --disable-*. The patches that add them arrive in cd36712 and 0f54e2c, so eb43bbc, f080c9b and cd36712 each fail configure — the message should say the series is not bisectable, or the patch commits should be ordered ahead of the Makefile rework.

Generated by Claude Code

Comment thread multimedia/ffmpeg/Makefile Outdated
+FFMPEG_FULL_TLS_GNUTLS:libgnutls \
+FFMPEG_FULL_TLS_OPENSSL:libopenssl \
+FFMPEG_FULL_TLS_MBEDTLS:libmbedtls \
+FFMPEG_FULL_LIBDAV1D:libdav1d \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no libdav1d package in this feed or in openwrt/openwrt — grep -r dav1d over both trees finds nothing — so with FFMPEG_FULL_LIBDAV1D defaulting to y this dependency is unresolvable and libffmpeg-full (and therefore ffmpeg/ffprobe) cannot be selected at all. +FFMPEG_FULL_VAAPI:libva on line 417 has the same problem, there is no libva package either (default n, so it only bites when enabled). Either land the dav1d/libva packages first, or drop these two options from this PR.


Generated by Claude Code

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be fixed by dropping support for respective libs (for now, until also upstreamed)

Comment thread multimedia/ffmpeg/Config.in Outdated
default y

if PACKAGE_libffmpeg-custom
menu "FFmpeg (custom variant) configuration"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Package/<pkg>/config is emitted verbatim right after menuconfig PACKAGE_libffmpeg-custom with no guard of its own (package-metadata.pl:378), so replacing the if with a plain menu makes the whole custom option tree visible and settable in every buildroot config and leaves MENU:=1 with nothing to nest. Restore the guard (the closing endmenu on the last line then has to go back to endif).

Suggested change
menu "FFmpeg (custom variant) configuration"
if PACKAGE_libffmpeg-custom

Generated by Claude Code

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

solved differently — MENU:=1 is gone and the free-standing menu is now deliberate and documented, thanks


Generated by Claude Code

Comment thread multimedia/ffmpeg/Makefile Outdated
few hundred kB of code and tables.

config FFMPEG_FULL_PROGRAMS
bool "Build the command line programs (ffmpeg, ffprobe)"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing connects this symbol to the ffmpeg/ffprobe packages, so turning it off while either is selected does not leave them "with nothing to install" — Package/ffmpeg/install runs INSTALL_BIN on a binary that was never built and the build aborts. Add @FFMPEG_FULL_PROGRAMS to the DEPENDS of Package/ffmpeg and Package/ffprobe.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, thanks


Generated by Claude Code

Comment thread multimedia/ffmpeg/Makefile Outdated
Comment on lines +29 to +30
# the tarball unpacks into ffmpeg-$(PKG_VERSION), not $(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(if $(BUILD_VARIANT),$(PKG_NAME)-$(BUILD_VARIANT)/)ffmpeg-$(PKG_VERSION)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: the premise is wrong — PKG_NAME is ffmpeg, and include/package.mk:11 already defaults to exactly this string, so the override is a no-op. Drop both lines.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, thanks


Generated by Claude Code

@mirko
mirko marked this pull request as draft September 5, 2026 19:36
@BKPepe
BKPepe requested a balanced review from Copilot September 5, 2026 20:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

Updates the OpenWrt FFmpeg package to 9.0.1, restructuring the build to be more deterministic and explicit about enabled features/libraries, and bringing in/refreshing downstream patches (notably for V4L2/Kodi-related use cases).

Changes:

  • Bump FFmpeg from 6.1.4 to 9.0.1 and adjust build dir handling for the new tarball layout.
  • Rework configure flags and Kconfig options to avoid autodetect and make feature selection explicit (full/custom variants).
  • Refresh patch stack: drop a set of now-upstream/obsolete warning-fix patches and add/adjust V4L2-related patches (incl. V4L2 M2M deinterlace filter and V4L2 Request format fixes).

Reviewed changes

Copilot reviewed 16 out of 18 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
multimedia/ffmpeg/Makefile Version bump to 9.0.1 and major packaging/configure refactor for deterministic builds and explicit feature toggles.
multimedia/ffmpeg/Config.in Restructure custom-variant menu; remove custom patented toggle in favor of global BUILD_PATENTED.
multimedia/ffmpeg/patches/020-libavcodec-fix-Wint-conversion-in-vulkan.patch Removed (likely upstreamed/obsolete in FFmpeg 9).
multimedia/ffmpeg/patches/030-avformat-file-guard-fd_dup-by-FD_PROTOCOL-or-PIPE_PR.patch Removed (likely upstreamed/obsolete).
multimedia/ffmpeg/patches/040-vulkan_decode-fix-the-print-format-of-VkDeviceSize.patch Removed (likely upstreamed/obsolete).
multimedia/ffmpeg/patches/050-avcodec-dct-Make-declarations-and-definitions-match.patch Removed (likely upstreamed/obsolete).
multimedia/ffmpeg/patches/060-avutil-tx-fix-GCC-memset-warning.patch Removed (likely upstreamed/obsolete).
multimedia/ffmpeg/patches/070-avformat-rawdec-guard-by-CONFIG_DATA_DEMUXER.patch Removed (likely upstreamed/obsolete).
multimedia/ffmpeg/patches/080-avcodec-pcm-bluray-dvd-Use-correct-pointer-types-on-.patch Removed (likely upstreamed/obsolete).
multimedia/ffmpeg/patches/090-avcodec-tiff-Suppress-unused-variable-warnings.patch Removed (likely upstreamed/obsolete).
multimedia/ffmpeg/patches/100-avcodec-tableprint_vlc-Unbreak-hardcoded-tables.patch Removed (likely upstreamed/obsolete).
multimedia/ffmpeg/patches/110-libreelec.patch Add/port LibreELEC/Kodi-oriented changes (dav1d get_format; swscale warning removal).
multimedia/ffmpeg/patches/120-avfilter-af_channelsplit-fix-mixed-declaration-and-c.patch Removed (likely upstreamed/obsolete).
multimedia/ffmpeg/patches/140-vf-deinterlace-v4l2m2m.patch Adds a new V4L2 M2M deinterlacing filter and wires it into FFmpeg build.
multimedia/ffmpeg/patches/150-v4l2-request-define-sunxi-afbc-formats.patch Adds missing downstream sunxi/cedrus AFBC fourcc defines for sanitized kernel headers.
multimedia/ffmpeg/patches/160-libavdevice-v4l2-libv4l2-posix-ioctl.patch Fixes libv4l2 ioctl signature mismatch on musl by defining expected feature macros.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +150 to +156
+static inline uint32_t v4l2_pix_fmt_from_drm_format(uint64_t drm_format)
+{
+ switch(drm_format) {
+#if defined(V4L2_PIX_FMT_SUNXI_TILED_NV12) && defined(DRM_FORMAT_MOD_ALLWINNER_TILED)
+ case DRM_FORMAT_MOD_ALLWINNER_TILED:
+ return V4L2_PIX_FMT_SUNXI_TILED_NV12;
+#endif
Comment on lines +210 to +218
+static inline uint64_t drm_format_modifier(uint64_t drm_format)
+{
+#ifdef DRM_FORMAT_MOD_ALLWINNER_TILED
+ if (drm_format == DRM_FORMAT_MOD_ALLWINNER_TILED)
+ return DRM_FORMAT_MOD_ALLWINNER_TILED;
+#endif
+ return DRM_FORMAT_MOD_LINEAR;
+
+}
Comment on lines +420 to +449
+static int v4l2_buffer_export_drm(V4L2Buffer* avbuf, uint64_t drm_format)
+{
+ struct v4l2_exportbuffer expbuf;
+ int i, ret;
+
+ for (i = 0; i < avbuf->num_planes; i++) {
+ memset(&expbuf, 0, sizeof(expbuf));
+
+ expbuf.index = avbuf->buffer.index;
+ expbuf.type = avbuf->buffer.type;
+ expbuf.plane = i;
+
+ ret = ioctl(avbuf->q->ctx->fd, VIDIOC_EXPBUF, &expbuf);
+ if (ret < 0)
+ return AVERROR(errno);
+
+ avbuf->fd = expbuf.fd;
+
+ if (V4L2_TYPE_IS_MULTIPLANAR(avbuf->buffer.type)) {
+ /* drm frame */
+ avbuf->drm_frame.objects[i].size = avbuf->buffer.m.planes[i].length;
+ avbuf->drm_frame.objects[i].fd = expbuf.fd;
+ avbuf->drm_frame.objects[i].format_modifier = drm_format_modifier(drm_format);
+ } else {
+ /* drm frame */
+ avbuf->drm_frame.objects[0].size = avbuf->buffer.length;
+ avbuf->drm_frame.objects[0].fd = expbuf.fd;
+ avbuf->drm_frame.objects[0].format_modifier = drm_format_modifier(drm_format);
+ }
+ }
Comment on lines +604 to +614
+ if (pfd.revents & events) {
+ memset(&buf, 0, sizeof(buf));
+ buf.memory = V4L2_MEMORY_MMAP;
+ buf.type = queue->format.type;
+ if (V4L2_TYPE_IS_MULTIPLANAR(queue->format.type)) {
+ memset(planes, 0, sizeof(planes));
+ buf.length = VIDEO_MAX_PLANES;
+ buf.m.planes = planes;
+ }
+
+ ret = ioctl(ctx->fd, VIDIOC_DQBUF, &buf);
Comment on lines +928 to +929
+ ctx->orig_width = drm_desc->layers[0].planes[0].pitch;
+ ctx->orig_height = drm_desc->layers[0].planes[1].offset / ctx->orig_width;
+ memset(&cap, 0, sizeof(cap));
+ ret = ioctl(ctx->fd, VIDIOC_QUERYCAP, &cap);
+ if (ret < 0)
+ return ret;
Comment on lines +258 to +259
+ if (ret)
+ av_log(NULL, AV_LOG_ERROR, "VIDIOC_G_FMT failed: %d\n", ret);
+ AVBufferRef *hw_frames_ctx;
+
+ /*
+ * TODO: check if its really neccessary to hold this
Comment thread multimedia/ffmpeg/Makefile Outdated
+FFMPEG_TLS_GNUTLS:libgnutls \
+FFMPEG_TLS_OPENSSL:libopenssl \
+FFMPEG_TLS_MBEDTLS:libmbedtls \
+FFMPEG_LIBDAV1D:libdav1d \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no libdav1d package in this feed or in openwrt/openwrt, and FFMPEG_LIBDAV1D defaults to y, so all ten Feeds Package Test Build jobs die at configure (mipsel_24kc shown):

ERROR: dav1d >= 1.0.0 not found using pkg-config
make[2]: *** [Makefile:661: .../.configured_2fc8a77d2a030a29ff9b591c10b3e409] Error 1
    ERROR: package/feeds/packages_ci/ffmpeg failed to build (build variant: default).
WARNING: Makefile 'package/feeds/packages_ci/ffmpeg/Makefile' has a dependency on 'libdav1d', which does not exist

Either land a dav1d package first or drop the option from this PR; +FFMPEG_VAAPI:libva on line 302 is equally unresolvable (default n, so it only bites once enabled).


Generated by Claude Code

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, thanks


Generated by Claude Code

CONFLICTS:=libffmpeg-full
TITLE+= (mini)
VARIANT:=mini
CONFLICTS:=libffmpeg

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: on master Package/libffmpeg/Default carried PROVIDES:= libffmpeg, so the mini variant could satisfy a +libffmpeg dependency; here it provides nothing and conflicts with the real libffmpeg. That leaves mpd and minidlna always pulling the full build, and no in-tree consumer able to use libffmpeg-mini at all. Intentional?


Generated by Claude Code

@mirko
mirko force-pushed the ffmpeg9 branch 3 times, most recently from 143f3ad to ce2f1f8 Compare September 8, 2026 15:22
@mirko
mirko marked this pull request as ready for review September 8, 2026 15:30
@thess

thess commented Sep 8, 2026

Copy link
Copy Markdown
Member

If you would be so kind as to remove me as package maintainer, I would appreciate it.

@mirko

mirko commented Sep 8, 2026

Copy link
Copy Markdown
Member Author

If you would be so kind as to remove me as package maintainer, I would appreciate it.

Of course, if you wish so - @antonlacon you still in? Asking also, as ffmpeg6 has been a while..

@kel-mo

kel-mo commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

re: squeezelite, I am not its official maintainer so take my view with a grain of salt - i may have assumed a de facto status on account of the last 2 annual bumps. Not opposed at all to depending on the full ffmpeg myself, acknowledging the increased size will prohibit installation on a subset of storage limited hardware.

Curious to learn about the plans for kodi and openwrt, I recently became involved with its team and more specifically the flatpak maintenance. You might also consider team membership if this becomes a long term labor of love for you!

@mirko

mirko commented Sep 8, 2026

Copy link
Copy Markdown
Member Author

re: squeezelite, I am not its official maintainer so take my view with a grain of salt - i may have assumed a de facto status on account of the last 2 annual bumps. Not opposed at all to depending on the full ffmpeg myself, acknowledging the increased size will prohibit installation on a subset of storage limited hardware.

Then I'd say let's not overengineer but see if there's actual demand for a lighter variant which we can then still provide.

Curious to learn about the plans for kodi and openwrt, I recently became involved with its team and more specifically the flatpak maintenance. You might also consider team membership if this becomes a long term labor of love for you!

I always wanted getting kodi ported to OpenWrt, but it's hell of a monster. This comment (xbmc/xbmc#28454 (comment)) sums up my prime example why I gave up quite a few times in the past, however @dangowrt gave it another try and achieved a PoC I got hyped about and recently ported pipewire, ffmpeg9 and kodi22.

However my personal interaction with the kodi community - at least on GitHub - was rather disappointing so far I have to admit. While I understand it's a huge end-user facing project, attracting lot's of non-technical (and annoying piracy) questions and they have to establish mechanisms to deal with the flood, conversations like e.g. xbmc/xbmc#17873 rather discouraged me from engaging further :/

Comment on lines +207 to +216
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 \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: FFMPEG_VAAPI and FFMPEG_LIBDAV1D are commented out in Config.in now, so these two entries track symbols that can never be set.

Suggested change
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_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 \

Generated by Claude Code

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Temporarily disabled features, as dependencies are not upstream(ed) yet, as you already figured out earlier. But plan is to just uncomment and enable once that happened, hence these symbols are only "deactivated" instead of "removed".

PKG_NAME:=ffmpeg
PKG_VERSION:=6.1.4
PKG_RELEASE:=2
PKG_VERSION:=9.0.1

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{standard input}:9366: Error: invalid operands `sll $25,$4,0x11'
{standard input}:9367: Error: operand 2 must be an immediate expression `slt $17,$4,$25'
{standard input}:9369: Error: opcode not supported on this processor: mips32r2 (mips32r2) `movz $6,$16,$17'
make[3]: *** [ffbuild/common.mak:83: libavcodec/vvc/cabac.o] Error 1
    ERROR: package/feeds/packages_ci/ffmpeg failed to build (build variant: default).

mipsel_24kc dies on FFmpeg 9's VVC CABAC; the register numbers ($24/$25) and the rejected movz/movn suggest the MIPS inline asm ends up assembled in MIPS16 mode. Only aarch64_generic is green on this head, so the other targets may need a look too (--disable-inline-asm on mips, or a .set nomips16 patch, if you want to chase this one).


Generated by Claude Code

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build is for mips16 and --disable-inline-asm does not appear to be a fix for that build issue.
That option only affects code guarded by HAVE_INLINE_ASM. mips/cabac.h has no such guard, so the assembly is compiled regardless and the build fails the same way.
It would only cost mips32 optimisations for nothing.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fixed now by re-adding a patch which already existed but got lost in a previous version bump.
Didn't surface in ffmpeg 6.x builds, as the only codecs using that were guarded by @BUILD_PATENDED.
Now with ffmpeg 9.x we also have codecs being built unconditionally.

@mirko
mirko force-pushed the ffmpeg9 branch 2 times, most recently from 00f1e62 to b7a6537 Compare September 9, 2026 13:48
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.

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
  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 (Rosen Penev, 2020; dropped by the
    6.1.2 update): restores the MIPS16 guard for the MIPS CABAC inline
    assembly; FFmpeg 9's VVC decoder compiles that file on every MIPS
    build, not only with BUILD_PATENTED
  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 LibreELEC patches (libpostproc, Kodi compatibility, V4L2 Request
API) and the options they introduce are added by the following commits.

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 <noreply@anthropic.com>
Signed-off-by: Mirko Vogt <mirko-openwrt@nanl.de>
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 fix
as q66's posix-ioctl.patch in Chimera Linux, also carried by Alpine,
extended for the older macro name.

Assisted-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Mirko Vogt <mirko-openwrt@nanl.de>
Upstream dropped libpostproc in 8.0; Kodi still requires it.

The --enable/--disable-postproc option the patch re-introduces is set
explicitly: on together with GPL in libffmpeg, off in libffmpeg-mini.

Patches:
  100-postproc: carried over from LibreELEC (Matthias Reichl's rebase
    of Michael Niedermayer's libpostproc source plugin;
    packages/multimedia/ffmpeg/patches/postproc/0001-postproc.patch as
    of LibreELEC commit 5f03a122f8): re-adds libpostproc as a source
    plugin

Header unchanged, hunks refreshed with quilt; the patched tree is
identical to the one LibreELEC's file produces.

Signed-off-by: Mirko Vogt <mirko-openwrt@nanl.de>
Patches:
  110-libdav1d-get-format: carried over from LibreELEC (Lukas Rusak):
    adds a get_format callback to the libdav1d decoder so Kodi's
    hardware-first, software-fallback decoder setup initialises
    multithreaded software decoding properly; without effect until the
    libdav1d option is enabled
  111-swscale-yuv2rgb-no-warning: carried over from LibreELEC
    (Christian Hewitt): removes the warning swscale logs on every
    context initialisation without an accelerated colourspace
    conversion

LibreELEC keeps both in one file
(packages/multimedia/ffmpeg/patches/libreelec/0001-libreelec.patch as
of LibreELEC commit 5d54b2dd82); they are split here so each keeps its
own header. Headers unchanged, hunks refreshed with quilt; the patched
tree is identical to the one LibreELEC's file produces.

Signed-off-by: Mirko Vogt <mirko-openwrt@nanl.de>
V4L2 Request API hwaccels for stateless decoders such as Allwinner
cedrus, exporting DRM_PRIME frames, and a V4L2 M2M deinterlace filter
driving mem2mem deinterlacers such as Allwinner's sun8i-di on DRM_PRIME
frames. The hwaccels introduce the v4l2-request and libudev configure
options.

Add the FFMPEG_V4L2_REQUEST option (pulls libdrm and libudev) to the
libffmpeg menu, keep both new configure options explicitly off in the
common block like the other autodetected ones, and re-add the
*_v4l2request hwaccels under manual component selection.

Patches:
  120-v4l2-request-01 to -13: carried over from LibreELEC
    (packages/multimedia/ffmpeg/patches/v4l2-request/0001-v4l2-request.patch
    as of LibreELEC commit 79de202a10), one file per patch of the series:
    01 avutil/hwcontext: Add hwdevice type for V4L2 Request API
       (Jonas Karlman)
    02 avutil/hwcontext_v4l2request: Probe for a capable media and
       video device (Jonas Karlman)
    03 avcodec: Add common V4L2 Request API code (Jonas Karlman)
    04 avcodec/v4l2request: Add common decode support for hwaccels
       (Jonas Karlman)
    05 avcodec: Add V4L2 Request API mpeg2 hwaccel (Jonas Karlman)
    06 avcodec/h264dec: add ref_pic_marking and pic_order_cnt bit_size
       to slice context (Boris Brezillon)
    07 avcodec: Add V4L2 Request API h264 hwaccel (Jernej Skrabec)
    08 avcodec: Add V4L2 Request API hevc hwaccel (Jernej Skrabec)
    09 avcodec: Add V4L2 Request API vp8 hwaccel (Boris Brezillon)
    10 avcodec: Add V4L2 Request API vp9 hwaccel (Boris Brezillon)
    11 avcodec: Add V4L2 Request API av1 hwaccel (Jonas Karlman)
    12 avutil/hwcontext_v4l2request: Add support for AFBC_16X16_SPLIT
       pix fmts (Jernej Skrabec)
    13 avutil/hwcontext_v4l2request: Add support for BROADCOM_SAND128
       pix fmts (Jonas Karlman)
    Co-developed by Alex Bee, Benjamin Gaignard and Ezequiel Garcia.
  140-vf-deinterlace-v4l2m2m: carried over from LibreELEC
    (packages/multimedia/ffmpeg/patches/vf-deinterlace-v4l2m2m/0001-vf-deinterlace-v4l2m2m.patch
    as of LibreELEC commit 9ef6c9c6f7; Jernej Skrabec): adds the
    deinterlace_v4l2m2m filter

Headers unchanged, hunks refreshed with quilt; the patched tree is
identical to the one LibreELEC's files produce.

LibreELEC's v4l2-drmprime patch (stateful M2M decoders) is not carried:
it needs a rebase for FFmpeg 9 which LibreELEC has not done either.

Signed-off-by: Mirko Vogt <mirko-openwrt@nanl.de>
The cedrus AFBC capture fourccs are downstream kernel additions missing
from the sanitised toolchain headers, so 10-bit HEVC found no DRM_PRIME
capture format and silently fell back to software decoding. Define them
locally when the headers lack them.

Assisted-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Mirko Vogt <mirko-openwrt@nanl.de>
@mirko

mirko commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

Referencing ticket #30494 here, as it essentially caused me to fork and modify existing patch files just to make the CI happy.

@mirko

mirko commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

All failed target builds are failing due to (in this case for arm):

Run docker run \
  docker run \
    -e ENABLE_GENERIC_TESTS=true \
    -e FORCE_GENERIC_TESTS=true \
    -e PKG_MANAGER=apk \
    --platform linux/arm_cortex-a15_neon-vfpv4 \
    --rm \
    --volume $GITHUB_WORKSPACE:/ci \
    test-container
  shell: /usr/bin/bash -e {0}
  env:
    BRANCH: master
    PACKAGES: ffmpeg 
    MERGE_ID: c7852f562
    BASE_ID: 11396c343
    HEAD_ID: 24ed9e683
    PRNUMBER: 30455
    ARCHIVE_NAME: arm_cortex-a15_neon-vfpv4-PR30455-c7852f562
    HAVE_PKGS: true
    PKG_MANAGER: apk
ERROR: wget: exited with error 8
WARNING: updating and opening https://downloads.openwrt.org/snapshots/targets/armsr/armv7/kmods/6.12.91-1-ccc7e43f4b5bd9dc1c03e464730d7e62/packages.adb: unexpected end of file
WARNING: opening /ci/packages.adb: UNTRUSTED signature
 [https://downloads.openwrt.org/snapshots/targets/armsr/armv7/packages/packages.adb]
 [https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/base/packages.adb]
 [https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/luci/packages.adb]
 [https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/packages/packages.adb]
 [https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/routing/packages.adb]
 [https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/telephony/packages.adb]
 [https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/video/packages.adb]
1 unavailable, 0 stale; 10183 distinct packages available
Error: Process completed with exit code 1.

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 6 new commits.


Generated by Claude Code

# 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.
# v4l2-request and libudev are introduced by patches/120-v4l2-request.patch,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: the same commit splits that file into 120-v4l2-request-01.patch-13.patch, so this filename no longer exists; same at line 498.

Suggested change
# v4l2-request and libudev are introduced by patches/120-v4l2-request.patch,
# v4l2-request and libudev are introduced by patches/120-v4l2-request-*.patch,

Generated by Claude Code

@@ -0,0 +1,46 @@
From ba6b36feb25bd8e622b87b28e5fca7e635dd6b5f Mon Sep 17 00:00:00 2001

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: ba6b36fe… is not a commit that exists, and the body below — FFmpeg 9's VVC decoder, the 6.1.2 update dropping the guard in 2024, this PR's own assembler output — cannot be text Rosen wrote in 2020. Attribute the rewritten header to yourself and credit the original guard (030-h264-mips.patch, added in 79afc370f) in the body instead.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants