PR #25858 opened by Kilian (lusoris)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25858
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25858.patch

A shared build with only derain, dnn_classify, dnn_detect or dnn_processing 
enabled produces a libavfilter that does not link against libswscale, and with 
the TensorFlow backend not against libavformat either. A program linked with 
`-Wl,--no-allow-shlib-undefined` then fails on the `sws_*` symbols (OpenVINO) 
or on the `sws_*` and `avio_*` symbols (TensorFlow).

These four filters select the dnn component, and `dnn_deps` lists avformat and 
swscale, but the conditional library dependency block in configure has no 
`avfilter_deps` entry for dnn. Only sr has its own entry. This adds one line, 
`enabled dnn && prepend avfilter_deps "avformat swscale"`, which covers all DNN 
filters.

This completes the configure part of pull request 25734, which fixed the same 
gap for scale_vulkan, metadata and ametadata and left the DNN filters unchecked.

Tested on master 0706d0ab1f in an Arch Linux container with the distribution's 
OpenVINO 2026.4.1 and TensorFlow 2.21.0 packages, CPU only:

- each backend with each of derain, dnn_classify, dnn_detect, dnn_processing: 
`--enable-shared --disable-everything --enable-lib<backend> 
--enable-filter=<filter>`; before, `avfilter_FFLIBS=avutil` and the link fails 
with 3 undefined `sws_*` references (plus 4 `avio_*` with TensorFlow); after, 
`avfilter_FFLIBS=swscale avformat avcodec avutil`, the link succeeds and the 
program runs with `LD_BIND_NOW=1`
- sr as control: links before and after
- default configure without flags: `ffbuild/config.mak`, `config.h` and 
`config_components.h` are identical before and after

The libtorch and ONNX Runtime backends were not built; they use the same common 
`dnn_io_proc.c`, which calls `sws_*`.



>From 2bccaa91593cf013ad5e7625c6c06fc0b9b64eaf Mon Sep 17 00:00:00 2001
From: lusoris <[email protected]>
Date: Sat, 7 Nov 2026 19:38:33 +0100
Subject: [PATCH] configure: add missing library dependencies of the DNN
 filters

derain, dnn_classify, dnn_detect and dnn_processing select the dnn
component, and dnn_deps lists avformat and swscale, but the
conditional library dependency block has no avfilter_deps entry for
dnn; only sr carries its own. The common DNN code calls sws_* in
dnn_io_proc.c and vf_dnn_processing.c, and the TensorFlow backend
calls avio_* to load the model.

A shared build with one of these four filters therefore links
libavfilter against libavutil only. Linking a program with
-Wl,--no-allow-shlib-undefined fails on the sws_* symbols with the
OpenVINO backend, and on the sws_* and avio_* symbols with the
TensorFlow backend.

Prepend avformat and swscale to avfilter_deps whenever dnn is enabled.

Signed-off-by: lusoris <[email protected]>
---
 configure | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure b/configure
index 3a0ee5ddfb3..176431a962e 100755
--- a/configure
+++ b/configure
@@ -8241,6 +8241,7 @@ enabled ametadata_filter    && prepend avfilter_deps 
"avformat"
 enabled amovie_filter       && prepend avfilter_deps "avformat avcodec"
 enabled aresample_filter    && prepend avfilter_deps "swresample"
 enabled cover_rect_filter   && prepend avfilter_deps "avformat avcodec"
+enabled dnn                 && prepend avfilter_deps "avformat swscale"
 enabled ebur128_filter && enabled swresample && prepend avfilter_deps 
"swresample"
 enabled elbg_filter         && prepend avfilter_deps "avcodec"
 enabled find_rect_filter    && prepend avfilter_deps "avformat avcodec"
-- 
2.54.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to