Optional `ffmpeg` deps
Is it reasonable to move some Depends to Recommends? Not all deps are needed for some use-cases.
- Context: https://github.com/yt-dlp/yt-dlp/issues/14294#issuecomment-3277711404
i'm sorry my computer glitched and accidentally closed your issue. I am trying to write a response
Unfortunately for your use case, FFMpeg is a traditional dynamically-linked (not dynamically-loading) program written in the C programming language, and that means that it becomes "dynamically linked" to all of its dependencies. This means that all of the dependencies that were present when that package of ffmpeg was compiled must also be installed before that ffmpeg is run, otherwise, errors will occur.
~ $ ldd $(command -v ffmpeg)
libavdevice.so.61 => /data/data/com.termux/files/usr/lib/libavdevice.so.61
libavfilter.so.10 => /data/data/com.termux/files/usr/lib/libavfilter.so.10
libavformat.so.61 => /data/data/com.termux/files/usr/lib/libavformat.so.61
libavcodec.so.61 => /data/data/com.termux/files/usr/lib/libavcodec.so.61
libpostproc.so.58 => /data/data/com.termux/files/usr/lib/libpostproc.so.58
libswresample.so.5 => /data/data/com.termux/files/usr/lib/libswresample.so.5
libswscale.so.8 => /data/data/com.termux/files/usr/lib/libswscale.so.8
libavutil.so.59 => /data/data/com.termux/files/usr/lib/libavutil.so.59
libm.so => /system/lib64/libm.so
libc.so => /system/lib64/libc.so
librubberband.so => /data/data/com.termux/files/usr/lib/librubberband.so
libharfbuzz.so => /data/data/com.termux/files/usr/lib/libharfbuzz.so
libfribidi.so => /data/data/com.termux/files/usr/lib/libfribidi.so
liblcms2.so => /data/data/com.termux/files/usr/lib/liblcms2.so
libvmaf.so => /data/data/com.termux/files/usr/lib/libvmaf.so
libass.so => /data/data/com.termux/files/usr/lib/libass.so
libvidstab.so => /data/data/com.termux/files/usr/lib/libvidstab.so
libzmq.so => /data/data/com.termux/files/usr/lib/libzmq.so
libzimg.so => /data/data/com.termux/files/usr/lib/libzimg.so
libOpenCL.so => /data/data/com.termux/files/usr/lib/libOpenCL.so
libfontconfig.so => /data/data/com.termux/files/usr/lib/libfontconfig.so
libfreetype.so => /data/data/com.termux/files/usr/lib/libfreetype.so
libandroid.so => /data/data/com.termux/files/usr/lib/libandroid.so
libdl.so => /system/lib64/libdl.so
ld-android.so => /system/lib64/ld-android.so
libxml2.so.16 => /data/data/com.termux/files/usr/lib/libxml2.so.16
libbz2.so.1.0 => /data/data/com.termux/files/usr/lib/libbz2.so.1.0
libgme.so => /data/data/com.termux/files/usr/lib/libgme.so
libopenmpt.so => /data/data/com.termux/files/usr/lib/libopenmpt.so
libbluray.so => /data/data/com.termux/files/usr/lib/libbluray.so
libz.so.1 => /data/data/com.termux/files/usr/lib/libz.so.1
libgnutls.so => /data/data/com.termux/files/usr/lib/libgnutls.so
libsrt.so => /data/data/com.termux/files/usr/lib/libsrt.so
libssh.so => /data/data/com.termux/files/usr/lib/libssh.so
libiconv.so => /data/data/com.termux/files/usr/lib/libiconv.so
libandroid-glob.so => /data/data/com.termux/files/usr/lib/libandroid-glob.so
libvpx.so.11 => /data/data/com.termux/files/usr/lib/libvpx.so.11
libwebpmux.so => /data/data/com.termux/files/usr/lib/libwebpmux.so
libwebp.so => /data/data/com.termux/files/usr/lib/libwebp.so
liblzma.so.5 => /data/data/com.termux/files/usr/lib/liblzma.so.5
libdav1d.so => /data/data/com.termux/files/usr/lib/libdav1d.so
libopencore-amrwb.so => /data/data/com.termux/files/usr/lib/libopencore-amrwb.so
libaom.so => /data/data/com.termux/files/usr/lib/libaom.so
libmp3lame.so => /data/data/com.termux/files/usr/lib/libmp3lame.so
libopencore-amrnb.so => /data/data/com.termux/files/usr/lib/libopencore-amrnb.so
libopus.so => /data/data/com.termux/files/usr/lib/libopus.so
librav1e.so => /data/data/com.termux/files/usr/lib/librav1e.so
libSvtAv1Enc.so => /data/data/com.termux/files/usr/lib/libSvtAv1Enc.so
libtheoraenc.so => /data/data/com.termux/files/usr/lib/libtheoraenc.so
libtheoradec.so => /data/data/com.termux/files/usr/lib/libtheoradec.so
libvo-amrwbenc.so.0 => /data/data/com.termux/files/usr/lib/libvo-amrwbenc.so.0
libvorbis.so => /data/data/com.termux/files/usr/lib/libvorbis.so
libvorbisenc.so => /data/data/com.termux/files/usr/lib/libvorbisenc.so
libx264.so.164 => /data/data/com.termux/files/usr/lib/libx264.so.164
libx265.so => /data/data/com.termux/files/usr/lib/libx265.so
libxvidcore.so.4 => /data/data/com.termux/files/usr/lib/libxvidcore.so.4
libmediandk.so => /data/data/com.termux/files/usr/lib/libmediandk.so
libsoxr.so => /data/data/com.termux/files/usr/lib/libsoxr.so
libwebp.so.7 => /data/data/com.termux/files/usr/lib/libwebp.so.7
libsharpyuv.so.0 => /data/data/com.termux/files/usr/lib/libsharpyuv.so.0
libogg.so => /data/data/com.termux/files/usr/lib/libogg.so
libandroid-posix-semaphore.so => /data/data/com.termux/files/usr/lib/libandroid-posix-semaphore.so
libc++_shared.so => /data/data/com.termux/files/usr/lib/libc++_shared.so
libmpg123.so => /data/data/com.termux/files/usr/lib/libmpg123.so
libvorbisfile.so => /data/data/com.termux/files/usr/lib/libvorbisfile.so
libudfread.so => /data/data/com.termux/files/usr/lib/libudfread.so
libexpat.so.1 => /data/data/com.termux/files/usr/lib/libexpat.so.1
libpng16.so => /data/data/com.termux/files/usr/lib/libpng16.so
libbrotlidec.so => /data/data/com.termux/files/usr/lib/libbrotlidec.so
libbrotlicommon.so => /data/data/com.termux/files/usr/lib/libbrotlicommon.so
libidn2.so => /data/data/com.termux/files/usr/lib/libidn2.so
libunistring.so => /data/data/com.termux/files/usr/lib/libunistring.so
libhogweed.so.6 => /data/data/com.termux/files/usr/lib/libhogweed.so.6
libnettle.so.8 => /data/data/com.termux/files/usr/lib/libnettle.so.8
libgmp.so => /data/data/com.termux/files/usr/lib/libgmp.so
libandroid-support.so => /data/data/com.termux/files/usr/lib/libandroid-support.so
libcrypto.so.3 => /data/data/com.termux/files/usr/lib/libcrypto.so.3
libsodium.so => /data/data/com.termux/files/usr/lib/libsodium.so
libfftw3.so => /data/data/com.termux/files/usr/lib/libfftw3.so
libsamplerate.so => /data/data/com.termux/files/usr/lib/libsamplerate.so
libglib-2.0.so.0 => /data/data/com.termux/files/usr/lib/libglib-2.0.so.0
libgraphite2.so => /data/data/com.termux/files/usr/lib/libgraphite2.so
libpcre2-8.so => /data/data/com.termux/files/usr/lib/libpcre2-8.so
If any of those dependencies, or any dependencies of any of those dependencies, are uninstalled, then unfortunately, you will see that the current ffmpeg available in Termux will immediately stop working and have an error:
~ $ mv $PREFIX/lib/libbrotlidec.so ~
~ $ ffmpeg
CANNOT LINK EXECUTABLE "ffmpeg": library "libbrotlidec.so" not found: needed by /data/data/com.termux/files/usr/lib/libfreetype.so in namespace (default)
~ $ mv ~/libbrotlidec.so $PREFIX/lib/
~ $ ffmpeg
ffmpeg version 7.1.1 Copyright (c) 2000-2025 the FFmpeg developers
built with Android (13624864, +pgo, +bolt, +lto, +mlgo, based on r530567e) clang version 19.0.1 (https://android.googlesource.com/toolchain/llvm-project 97a699bf4812a18fb657c2779f5296a4ab2694d2)
configuration: --arch=aarch64 --as=aarch64-linux-android-clang --cc=aarch64-linux-android-clang --cxx=aarch64-linux-android-clang++ --nm=llvm-nm --ar=llvm-ar --ranlib=llvm-ranlib --pkg-config=/home/builder/.termux-build/_cache/android-r28c-api-24-v1/bin/pkg-config --strip=llvm-strip --cross-prefix=aarch64-linux-android- --disable-indevs --disable-outdevs --enable-indev=lavfi --disable-static --disable-symver --enable-cross-compile --enable-gnutls --enable-gpl --enable-version3 --enable-jni --enable-lcms2 --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libharfbuzz --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenmpt --enable-libopus --enable-librav1e --enable-librubberband --enable-libsoxr --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-mediacodec --enable-opencl --enable-shared --prefix=/data/data/com.termux/files/usr --target-os=android --extra-libs=-landroid-glob --disable-vulkan --enable-neon --disable-libfdk-aac
libavutil 59. 39.100 / 59. 39.100
libavcodec 61. 19.101 / 61. 19.101
libavformat 61. 7.100 / 61. 7.100
libavdevice 61. 3.100 / 61. 3.100
libavfilter 10. 4.100 / 10. 4.100
libswscale 8. 3.100 / 8. 3.100
libswresample 5. 3.100 / 5. 3.100
libpostproc 58. 3.100 / 58. 3.100
Universal media converter
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
Use -h to get full help or, even better, run 'man ffmpeg'
~ $
The same exact limitation applies to ffmpeg on Desktop Linux, not only Android. Here are all the packages that would have to be removed from my Gentoo PC in order to remove libX11, which also include ffmpeg.
tacokoneko@CORSAIR ~/code/termux/termux-packages $ sudo emerge --depclean libX11 --verbose
Calculating dependencies... done!
x11-libs/libX11-1.8.12 pulled in by:
app-accessibility/at-spi2-core-2.54.1-r1 requires x11-libs/libX11[abi_x86_32(-),abi_x86_64(-)]
app-editors/pluma-1.28.0-r1 requires x11-libs/libX11
app-editors/vscodium-1.101.24242 requires x11-libs/libX11
app-emulation/wine-vanilla-10.0-r2 requires x11-libs/libX11[abi_x86_32(-),abi_x86_64(-)]
app-i18n/ibus-1.5.31-r1 requires x11-libs/libX11
app-misc/fastfetch-2.45.0 requires x11-libs/libX11
app-text/atril-1.28.1-r1 requires x11-libs/libX11
app-text/texlive-core-2024-r1 requires x11-libs/libX11
dev-dotnet/libgdiplus-6.0.2-r4 requires x11-libs/libX11
dev-games/aseprite-1.3.5-r1 requires x11-libs/libX11
dev-games/godot-4.4.1-r1 requires x11-libs/libX11
dev-java/openjdk-17.0.15_p6-r1 requires x11-libs/libX11
dev-java/openjdk-21.0.7_p6-r1 requires x11-libs/libX11
dev-java/openjdk-25_p19-r1 requires x11-libs/libX11
dev-java/openjdk-8.452_p09-r1 requires x11-libs/libX11
dev-java/openjdk-bin-11.0.27_p6 requires x11-libs/libX11
dev-java/openjdk-bin-21.0.7_p6 requires x11-libs/libX11
dev-java/openjfx-11.0.11_p1-r4 requires x11-libs/libX11
dev-java/swt-4.10-r4 requires x11-libs/libX11
dev-lang/tk-8.6.16 requires >=x11-libs/libX11-1.6.2[abi_x86_64(-)]
dev-libs/m17n-lib-1.8.4-r2 requires x11-libs/libX11
dev-perl/Tk-804.36.0-r5 requires x11-libs/libX11
dev-qt/qtbase-6.9.1-r1 requires x11-libs/libX11
dev-qt/qtgui-5.15.17 requires x11-libs/libX11
dev-qt/qtmultimedia-6.9.1 requires x11-libs/libX11
dev-qt/qtwebengine-6.9.1-r1 requires x11-libs/libX11
dev-qt/qtwidgets-5.15.17 requires x11-libs/libX11
dev-tcltk/blt-2.5.3-r3 requires x11-libs/libX11
dev-tcltk/tix-8.4.3-r4 requires x11-libs/libX11
dev-util/android-studio-2025.1.1.13 requires >=x11-libs/libX11-1.8.1
dev-util/vulkan-tools-1.4.313.0 requires x11-libs/libX11[abi_x86_64(-)]
games-util/antimicrox-3.5.1 requires x11-libs/libX11
games-util/heroic-bin-2.17.2 requires x11-libs/libX11
gnome-extra/yad-14.1 requires x11-libs/libX11
gui-libs/gtk-4.18.6-r1 requires x11-libs/libX11
kde-frameworks/kcrash-5.116.0 requires x11-libs/libX11
kde-frameworks/kcrash-6.13.0 requires x11-libs/libX11
kde-frameworks/kguiaddons-5.116.0-r2 requires x11-libs/libX11
kde-frameworks/kguiaddons-6.13.0-r1 requires x11-libs/libX11
kde-frameworks/kwindowsystem-5.116.0 requires x11-libs/libX11
kde-frameworks/kwindowsystem-6.13.0 requires x11-libs/libX11
mail-client/thunderbird-140.0.1 requires x11-libs/libX11
mate-base/caja-1.28.0-r2 requires x11-libs/libX11
mate-base/libmatekbd-1.28.0 requires x11-libs/libX11
mate-base/mate-applets-1.28.1 requires x11-libs/libX11
mate-base/mate-control-center-1.28.0-r2 requires x11-libs/libX11
mate-base/mate-desktop-1.28.2 requires x11-libs/libX11
mate-base/mate-panel-1.28.4-r1 requires x11-libs/libX11
mate-base/mate-session-manager-1.28.0-r1 requires x11-libs/libX11
mate-base/mate-settings-daemon-1.28.0-r2 requires x11-libs/libX11
mate-extra/mate-power-manager-1.28.1-r1 requires x11-libs/libX11
mate-extra/mate-screensaver-1.28.0 requires >=x11-libs/libX11-1
mate-extra/mate-utils-1.28.0-r1 requires x11-libs/libX11
media-gfx/blender-4.4.3 requires x11-libs/libX11
media-gfx/eom-1.28.0-r3 requires x11-libs/libX11
media-gfx/fbida-2.14-r6 requires x11-libs/libX11
media-gfx/gimp-9999 requires x11-libs/libX11
media-gfx/graphviz-12.2.1-r1 requires x11-libs/libX11
media-gfx/inkscape-1.4-r2 requires x11-libs/libX11
media-gfx/krita-5.2.9 requires x11-libs/libX11
media-libs/freeglut-3.6.0-r1 requires >=x11-libs/libX11-1.6.2[abi_x86_32(-),abi_x86_64(-)]
media-libs/glew-2.2.0-r1 requires >=x11-libs/libX11-1.6.2[abi_x86_64(-)]
media-libs/gst-plugins-bad-1.24.11 requires x11-libs/libX11[abi_x86_32(-),abi_x86_64(-)]
media-libs/gst-plugins-base-1.24.11-r1 requires >=x11-libs/libX11-1.6.2[abi_x86_32(-),abi_x86_64(-)]
media-libs/imlib2-1.12.3-r1 requires x11-libs/libX11[abi_x86_64(-)]
media-libs/libcaca-0.99_beta19-r11 requires >=x11-libs/libX11-1.6.2
media-libs/libcanberra-gtk3-0.30 requires x11-libs/libX11[abi_x86_64(-)]
media-libs/libepoxy-1.5.10-r3 requires x11-libs/libX11[abi_x86_32(-),abi_x86_64(-)]
media-libs/libglvnd-1.7.0 requires x11-libs/libX11[abi_x86_32(-),abi_x86_64(-)]
media-libs/libpulse-17.0 requires x11-libs/libX11[abi_x86_32(-),abi_x86_64(-)]
media-libs/libsdl2-2.32.6 requires >=x11-libs/libX11-1.6.2[abi_x86_32(-),abi_x86_64(-)]
media-libs/libsfml-2.6.2 requires x11-libs/libX11
media-libs/libva-2.22.0-r1 requires >=x11-libs/libX11-1.6.2[abi_x86_32(-),abi_x86_64(-)]
media-libs/lsp-plugins-1.2.14 requires x11-libs/libX11
media-libs/mesa-25.1.5 requires >=x11-libs/libX11-1.6.2[abi_x86_32(-),abi_x86_64(-)]
media-libs/netpbm-11.2.17 requires x11-libs/libX11
media-libs/suil-0.10.22-r2 requires x11-libs/libX11
media-libs/tg_owt-0_pre20250515-r2 requires x11-libs/libX11
media-libs/vulkan-layers-1.4.313.0 requires x11-libs/libX11:=[abi_x86_32(-),abi_x86_64(-)], x11-libs/libX11:0/0=[abi_x86_32(-),abi_x86_64(-)]
media-libs/vulkan-loader-1.4.313.0 requires x11-libs/libX11:=[abi_x86_32(-),abi_x86_64(-)], x11-libs/libX11:0/0=[abi_x86_32(-),abi_x86_64(-)]
media-libs/zvbi-0.2.44 requires x11-libs/libX11[abi_x86_32(-),abi_x86_64(-)]
media-plugins/x42-avldrums-0.7.3 requires x11-libs/libX11
media-video/ffmpeg-7.1.1-r2 requires x11-libs/libX11[abi_x86_32(-),abi_x86_64(-)]
media-video/ffmpeg-compat-6.1.2-r2 requires x11-libs/libX11[abi_x86_64(-)]
media-video/libva-utils-2.22.0 requires >=x11-libs/libX11-1.6.2
media-video/mpv-0.40.0-r3 requires x11-libs/libX11
media-video/obs-studio-31.1.0 requires x11-libs/libX11
media-video/pipewire-1.4.2 requires x11-libs/libX11
media-video/vlc-3.0.21_p20250217-r3 requires x11-libs/libX11
net-im/discord-0.0.101 requires x11-libs/libX11
net-im/toxic-0.16.0 requires x11-libs/libX11
net-irc/hexchat-2.16.2-r1 requires x11-libs/libX11
net-libs/gtk-vnc-1.3.1-r1 requires >=x11-libs/libX11-1.6.5
net-libs/webkit-gtk-2.46.5-r411 requires x11-libs/libX11
net-libs/webkit-gtk-2.46.5-r601 requires x11-libs/libX11
net-misc/moonlight-6.1.0-r2 requires x11-libs/libX11
net-misc/spice-gtk-0.42-r4 requires x11-libs/libX11
net-misc/teamviewer-15.64.3 requires x11-libs/libX11
net-misc/tigervnc-1.15.0-r1 requires x11-libs/libX11
net-voip/mumble-1.5.735 requires x11-libs/libX11
sci-visualization/gnuplot-6.0.2-r2 requires x11-libs/libX11
sys-apps/dbus-1.16.2 requires x11-libs/libX11
sys-apps/groff-1.23.0 requires x11-libs/libX11
www-client/firefox-140.0.4 requires x11-libs/libX11
www-client/surf-2.1-r3 requires x11-libs/libX11
www-client/ungoogled-chromium-137.0.7151.103_p1 requires x11-libs/libX11:0/0=
x11-apps/appres-1.0.7 requires x11-libs/libX11
x11-apps/fonttosfnt-1.2.4 requires x11-libs/libX11
x11-apps/mesa-progs-9.0.0 requires x11-libs/libX11[abi_x86_64(-)]
x11-apps/transset-1.0.4 requires x11-libs/libX11
x11-apps/xauth-1.1.4 requires x11-libs/libX11
x11-apps/xdpyinfo-1.3.4 requires x11-libs/libX11
x11-apps/xgamma-1.0.7 requires x11-libs/libX11
x11-apps/xhost-1.0.10 requires x11-libs/libX11
x11-apps/xinit-1.4.4 requires x11-libs/libX11
x11-apps/xinput-1.6.4 requires >=x11-libs/libX11-1.3
x11-apps/xkbcomp-1.4.7 requires >=x11-libs/libX11-1.6.9
x11-apps/xkill-1.0.6 requires x11-libs/libX11
x11-apps/xmodmap-1.0.11 requires x11-libs/libX11
x11-apps/xprop-1.2.8 requires x11-libs/libX11
x11-apps/xrandr-1.5.3 requires x11-libs/libX11
x11-apps/xrdb-1.2.2 requires x11-libs/libX11
x11-apps/xset-1.2.5 requires x11-libs/libX11
x11-apps/xsetroot-1.1.3 requires x11-libs/libX11
x11-apps/xwininfo-1.1.6 requires x11-libs/libX11
x11-libs/cairo-1.18.4-r1 requires >=x11-libs/libX11-1.6.2[abi_x86_32(-),abi_x86_64(-)]
x11-libs/gdk-pixbuf-xlib-2.40.2 requires x11-libs/libX11[abi_x86_64(-)]
x11-libs/gtk+-2.24.33-r3 requires >=x11-libs/libX11-1.6.2[abi_x86_32(-),abi_x86_64(-)]
x11-libs/gtk+-3.24.49-r1 requires x11-libs/libX11[abi_x86_32(-),abi_x86_64(-)]
x11-libs/libXScrnSaver-1.2.4 requires >=x11-libs/libX11-1.6.2[abi_x86_64(-)]
x11-libs/libXaw-1.0.16 requires >=x11-libs/libX11-1.6.2[abi_x86_64(-)]
x11-libs/libXcomposite-0.4.6 requires >=x11-libs/libX11-1.6.2[abi_x86_32(-),abi_x86_64(-)]
x11-libs/libXcursor-1.2.3 requires >=x11-libs/libX11-1.6.2[abi_x86_32(-),abi_x86_64(-)]
x11-libs/libXdamage-1.1.6 requires >=x11-libs/libX11-1.6.2[abi_x86_32(-),abi_x86_64(-)]
x11-libs/libXext-1.3.6 requires >=x11-libs/libX11-1.6.2[abi_x86_32(-),abi_x86_64(-)]
x11-libs/libXfixes-6.0.1 requires >=x11-libs/libX11-1.6.2[abi_x86_32(-),abi_x86_64(-)]
x11-libs/libXft-2.3.9 requires >=x11-libs/libX11-1.6.2[abi_x86_32(-),abi_x86_64(-)]
x11-libs/libXi-1.8.2 requires >=x11-libs/libX11-1.6.2[abi_x86_32(-),abi_x86_64(-)]
x11-libs/libXinerama-1.1.5 requires >=x11-libs/libX11-1.6.2[abi_x86_32(-),abi_x86_64(-)]
x11-libs/libXmu-1.2.1 requires >=x11-libs/libX11-1.6.2[abi_x86_64(-)]
x11-libs/libXpm-3.5.17 requires >=x11-libs/libX11-1.6.2[abi_x86_64(-)]
x11-libs/libXpresent-1.0.1 requires x11-libs/libX11[abi_x86_64(-)]
x11-libs/libXrandr-1.5.4 requires >=x11-libs/libX11-1.6.2[abi_x86_32(-),abi_x86_64(-)]
x11-libs/libXrender-0.9.12 requires >=x11-libs/libX11-1.6.2[abi_x86_32(-),abi_x86_64(-)]
x11-libs/libXres-1.2.2 requires x11-libs/libX11
x11-libs/libXt-1.3.1-r1 requires >=x11-libs/libX11-1.6.2[abi_x86_64(-)]
x11-libs/libXtst-1.2.5 requires >=x11-libs/libX11-1.6.2[abi_x86_32(-),abi_x86_64(-)]
x11-libs/libXv-1.0.13 requires >=x11-libs/libX11-1.6.2[abi_x86_32(-),abi_x86_64(-)]
x11-libs/libXxf86vm-1.1.6 requires >=x11-libs/libX11-1.6.2[abi_x86_32(-),abi_x86_64(-)]
x11-libs/libvdpau-1.5 requires x11-libs/libX11[abi_x86_32(-),abi_x86_64(-)]
x11-libs/libwnck-43.2 requires x11-libs/libX11
x11-libs/libxkbfile-1.1.3 requires x11-libs/libX11[abi_x86_64(-)]
x11-libs/libxklavier-5.4-r1 requires x11-libs/libX11:0/0=, x11-libs/libX11:=
x11-libs/motif-2.3.8-r6 requires >=x11-libs/libX11-1.6.2[abi_x86_64(-)]
x11-libs/pango-1.56.4-r1 requires >=x11-libs/libX11-1.6.2[abi_x86_32(-),abi_x86_64(-)]
x11-libs/startup-notification-0.12-r2 requires >=x11-libs/libX11-1.4.3
x11-libs/wxGTK-3.2.8.1 requires x11-libs/libX11[abi_x86_64(-)]
x11-misc/dmenu-5.3 requires x11-libs/libX11
x11-misc/mate-notification-daemon-1.28.1-r2 requires x11-libs/libX11
x11-misc/obconf-2.0.4_p20150213-r2 requires x11-libs/libX11
x11-misc/picom-12.5 requires x11-libs/libX11
x11-misc/screengrab-2.9.0 requires x11-libs/libX11
x11-misc/xdotool-3.20211022.1-r1 requires x11-libs/libX11
x11-misc/xscreensaver-6.09-r1 requires x11-libs/libX11
x11-terms/kitty-0.41.1-r1 requires x11-libs/libX11
x11-terms/mate-terminal-1.28.1 requires x11-libs/libX11
x11-terms/st-0.9.2 requires x11-libs/libX11
x11-terms/xterm-398 requires x11-libs/libX11
x11-wm/marco-1.28.1-r2 requires x11-libs/libX11
>>> No packages selected for removal by depclean
If you've read this far, though, you might be interested to know that there are theoretical workarounds/solutions to your problem that might not be too difficult to set up.
One possible solution is: an ffmpeg-minimal package can be compiled and provided that intentionally has all nonessential ffmpeg features and dependencies disabled at compile-time, which creates copies ("builds") of ffmpeg that can work and be used in Termux or other Linux distributions without having to have nearly as many dependencies installed.
FFMpeg provides package maintainers a convenient build setting, --disable-everything, which can be used to achieve that result.
Do you think that is something that would help you in your goal of setting up a yt-dlp configuration in Termux with as few dependencies as possible?
Additionally, if I help you create an invidual build of ffmpeg with --disable-everything applied for yourself, that you could maintain and recompile on your own, do you think that would be able to meet your needs sufficiently, or would you prefer that an ffmpeg-minimal package become available in Termux for you to more easily get using pkg install ffmpeg-minimal on any device that you have just clean installed Termux on, which would need to be maintained and recompiled regularly by Termux package maintainers?
First of all, thank you for your time, and your elaborated answer!
Do you think that is something that would help you in your goal of setting up a
yt-dlpconfiguration in Termux with as few dependencies as possible?
I'm afraid that YTDLP would require that ffmpeg can use codecs such as Vorbis, MP3-LAME, h.264, VP9, etc... so an "absolute minimal" build might be "too extreme".
For my use-cases (yt-dlp -x), I assume codecs aren't needed, just knowledge about the container. The video data is discarded while the audio is copied as-is (I rarely need to transcode).
if I help you create an invidual build of
ffmpegwith--disable-everythingapplied for yourself, that you could maintain and recompile on your own, do you think that would be able to meet your needs sufficiently, or would you prefer that anffmpeg-minimalpackage become available in Termux for you to more easily get usingpkg install ffmpeg-minimalon any device that you have just clean installed Termux on, which would need to be maintained and recompiled regularly by Termux package maintainers?
I'm willing to build it on my own. I already have Clang installed because of Helix (and Rust). But I'm afraid of memory requirements. I had issues building Helix because of too many codegen-units.
I'd expect that other users could benefit from such a minimal package, but a poll (or something else) should be opened to gather stats about this
Same here. I had to set codegen-units = 4 on my phone (8cores and 4GB RAM); because the default (for that core-count) codegen-units = 8 triggers the Low-Memory-Killer and forcefully-reboots near the end of cargo build
It might be helpful for any rooted users reading to mention that this command gives my particular device (Samsung Galaxy A70 SM-A705FN with a custom, manually-configured 4 gigabyte system-wide swap file) a vastly greater capability of avoiding that problem, since after I run this, compilations that use all the device memory are actually swapped into my custom swap file until the custom swap file is fully full, rather than being killed long before the swap file is anywhere near full (which is the default behavior when I don't use this command after every reboot):
su
echo 0 > /sys/module/lowmemorykiller/parameters/enable_lmk
If your device isn't rooted and doesn't have a custom swap file installed, but you still regularly encounter problems with the Low Memory Killer killing your compilations, then you probably would need to use either GitHub Actions or a different computer to build your packages.
I'm willing to build it on my own. I already have Clang installed I'm afraid that YTDLP would require that ffmpeg can use codecs such as Vorbis, MP3-LAME, h.264, VP9, etc... so an "absolute minimal" build might be "too extreme". For my use-cases (yt-dlp -x), I assume codecs aren't needed, just knowledge about the container. The video data is discarded while the audio is copied as-is (I rarely need to transcode).
I'm not sure exactly what configuration of ffmpeg build settings would be complete enough to do everything you need it to do, but still minimal enough to satisfy your desire for fewer dependencies, so let's start by making a customized ffmpeg build.sh that you might be able to use, and checking to see whether you are able to use it and whether it does what you need yet, and then try to make changes to the approach in response to any problems that occur.
I will send another message when I have some commands ready for you to try.
About the swap, my TCL 505 has a 4GB "RAM expansion" feature, which did consistently help avoid LMK and reboots. Nowadays, I prefer to reduce codegen-units. I only "expand RAM" when it's absolutely necessary
@Rudxain please try using this series of commands on your device:
pkg upgrade
pkg install python-yt-dlp
git clone -b ffmpeg-minimal https://github.com/robertkirkman/termux-packages.git termux-packages-ffmpeg-minimal-src
git clone https://github.com/termux/termux-packages.git termux-packages-ffmpeg-minimal-dest
cp -r termux-packages-ffmpeg-minimal-src/packages/ffmpeg-minimal termux-packages-ffmpeg-minimal-dest/packages/
cd termux-packages-ffmpeg-minimal-dest
scripts/setup-termux.sh
./build-package.sh -I -f ffmpeg-minimal
cd output
pkg reinstall ./ffmpeg-minimal_*.deb
yt-dlp --ffmpeg-location=$(command -v ffmpeg-minimal)
For me, there were no issues building this on-device.
At first, this ffmpeg-minimal might not have all necessary codecs enabled for you to do what you need to sufficiently.
Please try testing this with your use-cases and let me know what errors occur for you, after which we can try repeatedly rebuilding it with slightly more dependencies enabled each time, until it is just complete enough for it to do what you need.
My procedure was a bit different because I already had a shallow-clone of this repo:
pkg upgrade
pkg i python-yt-dlp
cd downloads/termux-packs/
gh pr checkout 26243
git switch master
git pull
git restore --source ffmpeg-minimal packages/ffmpeg-minimal
scripts/setup-termux.sh
./build-package.sh -I -f ffmpeg-minimal
cd output
pkg reinstall ./ffmpeg-minimal_*.deb
# "Me at the zoo"
yt-dlp "--ffmpeg-location=$(command -v ffmpeg-minimal)" -x jNQXAC9IVRw
~I'm awaiting setup-termux to finish...~
gh pr checkout 26243 git switch master git pull git restore --source ffmpeg-minimal packages/ffmpeg-minimal
very good, the commands I sent were intended for someone who might not have the gh command and who might not be highly experienced with git and not have a clone of the repository already, but I didn't know that you already had a clone of the repository and that you know how to do that
I forgot to mention git clone --depth=1. That's how I do "shallow" clones
All the commands have finished! Unfortunately, yt-dlp complained:
ERROR: Postprocessing: WARNING: unable to obtain file audio codec with ffprobe
According to the previous lines, the video was downloaded successfully. Even ls agrees:
'Me at the zoo [jNQXAC9IVRw].webm'
ffmpeg-minimal_7.1.1_aarch64.deb
ERROR: Postprocessing: WARNING: unable to obtain file audio codec with ffprobe
Ok, I will change some things until that error is no longer happening for me, and then let you know when I have uploaded my changes so that you can test them.
FWIW, I tried using ffmpeg directly, but it also fails:
ffmpeg-minimal -i 'Me at the zoo [jNQXAC9IVRw].webm' -vn -acodec copy test.ogg
ffmpeg version 7.1.1 Copyright (c) 2000-2025 the FFmpeg developers
built with clang version 20.1.8
configuration: --arch=aarch64 --as=aarch64-linux-android-clang --cc=aarch64-linux-android-clang --cxx=aarch64-linux-android-clang++ --nm=llvm-nm --ar=llvm-ar --ranlib=llvm-ranlib --pkg-config=pkg-config --strip=llvm-strip --cross-prefix=aarch64-linux-android- --disable-everything --enable-cross-compile --prefix=/data/data/com.termux/files/usr/opt/ffmpeg-minimal --target-os=android --extra-libs=-landroid-glob --enable-neon
libavutil 59. 39.100 / 59. 39.100
libavcodec 61. 19.101 / 61. 19.101
libavformat 61. 7.100 / 61. 7.100
libavdevice 61. 3.100 / 61. 3.100
libavfilter 10. 4.100 / 10. 4.100
libswscale 8. 3.100 / 8. 3.100
libswresample 5. 3.100 / 5. 3.100
[in#0 @ 0xb400007a19814000] Error opening input: Protocol not found
[in#0 @ 0xb400007a19814000] Did you mean file:Me at the zoo [jNQXAC9IVRw].webm?
Error opening input file Me at the zoo [jNQXAC9IVRw].webm.
Error opening input files: Protocol not found
exit status: 0x08
The non-minimal variant works.
This means yt-dlp isn't "picky", it's actually how ffmpeg works by default
Ok, now I have uploaded changes that make this command work fully for me:
yt-dlp --ffmpeg-location=$(command -v ffmpeg-minimal) -x jNQXAC9IVRw
In order to fix all errors with that command, it was necessary to add these dependencies:
-
libopus -
libdav1d
It was also necessary to add these arguments to the ffmpeg-minimal build script. If any of these arguments is not added, then a different error would occur each time, so they are all necessary to form the bare minimum ffmpeg-minimal required to successfully run that command:
-
--enable-protocol=file -
--enable-demuxer="matroska,webm" -
--enable-muxer="mp4" -
--enable-muxer="ogg" -
--enable-libdav1d -
--enable-decoder=libdav1d -
--enable-libopus -
--enable-decoder=libopus
please try redownloading my branch, recompiling it and continuing to test more commands that you need to run!
The next time that you see an error happen, please send the next command that it happens for, so that I can test it and then continue adding more dependencies as it turns out that you need each one.
You can look through yt-dlp source code to find all codecs supported rather than to figure out one-by-one. https://github.com/yt-dlp/yt-dlp/blob/65e90aea29cf3bfc9d1ae3e009fbf9a8db3a23c9/yt_dlp/postprocessor/ffmpeg.py#L36-L60
I also don't think there's a need for ffmpeg-minimal since yt-dlp supports a wide range video hosting sites not limited to Youtube so its codec support is probably wide enough for a minimal package to be meaningless.
You can look through yt-dlp source code to find all codecs supported rather than to figure out one-by-one. I also don't think there's a need for ffmpeg-minimal since yt-dlp supports a wide range video hosting sites not limited to Youtube so its codec support is probably wide enough for a minimal package to be meaningless.
I agree, and I don't necessarily intend to merge ffmpeg-minimal if nobody else wants it.
What is happening here is that the creator of this issue requested an extremely hyperspecific thing, which is that even though the current ffmpeg package already exists, they are not satisfied with it (for a reason that is not 100% clear other than that it is "too big"), so I am helping them build a package for themselves of that exact thing they want, and finding out what that exact thing they want is, along the way.
You can look through yt-dlp source code to find all codecs supported
I was about to say something similar. Even YT typically provides multiple codecs for the same videos. ytdlp just auto-selects what it considers "best". So if I use ytdlp with ffmpeg-minimal, I'd be forced to always use a limited set of codecs.
I also don't think there's a need for ffmpeg-minimal since yt-dlp supports a wide range video hosting sites not limited to Youtube so its codec support is probably wide enough for a minimal package to be meaningless.
I agree in some way. Maybe a better route could be for YT-DLP (upstream) to bundle its own fine-tuned variant of ffmpeg. I've seen other projects do that with other dependencies.
Or, if ffmpeg-minimal were to become "official", I highly suggest opening a poll of sorts. Currently, we've "overfitted" ffmpeg for a narrow set of codecs used by YT, which doesn't seem like a good metric for an "average Termux user" (unless most Termux users only use ffmpeg because of yt-dlp)
However, I'd still like to thank Robert for their help!
Currently, we've "overfitted" ffmpeg for a narrow set of codecs used by YT, which doesn't seem like a good metric for an "average Termux user"
in my opinion, the "correctly fitted" ffmpeg is the normal one, because it has every feature enabled that anyone has ever requested for Termux. however, that one did not seem to be "correctly fitted" to your particular request. I believe enabling all features necessary to support any possible operation in yt-dlp would result in an ffmpeg that is not very much smaller than the normal Termux ffmpeg, because yt-dlp supports downloading many files from many different websites like soundcloud, etc. and also supports near-arbitrary custom FFmpeg arguments, which can often be used in Bash or Python scripts that invoke yt-dlp.
The current ffmpeg package with all of its dependencies takes up 88.6MiB.
yt-dlp alone adds another 24.6MiB.
(116.2MiB if we combine its own dependencies into that total.)
So all in we're looking at 204.8MiB of on-device storage space to install ffmpeg and python-yt-dlp.
Does shaving off 44.7MiB[^1] via a ffmpeg-minimal package justify maintaining a separate stripped down version of FFMPEG in the repos?
[^1]: All calculations done against the current versions of the packages and their dependencies on AArch64.
Size for ffmpeg-minimal based off this CI run:
https://github.com/termux/termux-packages/actions/runs/17666896595
Interesting, thank you for the calculation.
That difference is even less than I would have thought,
and the current ffmpeg-minimal really IS basically the minimum possible required for the single command which downloads and extracts the audio in OGG format from a specific resolution and format of the first YouTube video, and not necessarily any other videos or audio from anything else,
so adding pretty much any other functionality to it will only increase its size further.
@Rudxain do you really consider a maximum 45 MB of space saved as an important optimization for your situation, when at least 150 MB is already required for the bare minimum code to run your test case?
- As I've stated in the review I left on the associated PR (https://github.com/termux/termux-packages/pull/26243#pullrequestreview-3224308038), I wouldn't be opposed to making
ffmpeg-minimala subpackage offfmpeg, similar to the approach used forqbittorrent-nox. https://github.com/termux/termux-packages/blob/9937b7487379513651c67649e6adcc36d8262100/x11-packages/qbittorrent/build.sh#L38-L45
That doesn't address if having such a separate package makes sense though.
204.8MiB
yikes...
Does shaving off 44.7MiB via a
ffmpeg-minimalpackage justify maintaining a separate stripped down version of FFMPEG in the repos?
If we only consider that data, I'd say no. But what about RSS use and startup time? I could use top for the former, but IDK how to properly measure the latter
do you really consider a maximum 45 MB of space saved as an important optimization for your situation
Not if I have to build it myself, because of all the build-deps and the source-repo. I could build it remotely. But still, it's unfortunate that the savings are that small. ffmpeg should migrate to using dlopen, but I assume that's a hard rework for the FFMPEG project.
Another option is to replace the existing ffmpeg package, I assume that'd be a breaking-change, ~but it seems Debian works just fine with less deps and ytdlp works with it~
but it seems Debian works just fine with less deps and ytdlp works with it
Have you checked the total packages being install with yt-dlp in Debian? Here is the output from apt install yt-dlp in Debian trixie container.
Summary:
Upgrading: 0, Installing: 308, Removing: 0, Not Upgrading: 0
Download size: 211 MB
Space needed: 774 MB / 274 GB available
Debian splits ffmpeg packages into smaller ones which have their own dependency tree.