[FFmpeg-user] Static binary with libpulse
Guru Prasad
gurupras at buffalo.edu
Mon May 9 01:56:13 EEST 2022
Hello,
I'm trying to build an application that uses a very stripped down version
of ffmpeg. My goal is to be able to stream system audio out via RTP using
opus encoding.
To do this, I started with trying to compile FFmpeg with just the required
components, and I ended up with this:
./configure \
--prefix="${BUILD}" \
--pkg-config-flags="--static" \
--extra-cflags="-I${BUILD}/include" \
--extra-ldflags="-L${BUILD}/lib -L${BUILD}/../libopus/.libs
-L${BUILD}/../../alsa/alsa-lib/build/lib" \
--extra-ldexeflags="-static" \
--disable-everything \
--enable-alsa \
--enable-libpulse \
--enable-indev=alsa,pulse \
--enable-protocol=rtp \
--enable-libopus
The issue is that libpulse is being very difficult to statically compile,
which is fine. I'm willing to accept that my application will only run on
systems where libpulse is available dynamically.
However, if I remove the static part of the config command-line, I end up
with a huge list of dynamically linked libraries.
guru at vm-001:~/ffmpeg$ ldd ./ffmpeg
linux-vdso.so.1 (0x00007fffb4df6000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f09cb3f6000)
libasound.so.2 => /lib/x86_64-linux-gnu/libasound.so.2
(0x00007f09cb2f3000)
libpulse.so.0 => /lib/x86_64-linux-gnu/libpulse.so.0
(0x00007f09cb29e000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f09cb282000)
libva-drm.so.2 => /lib/x86_64-linux-gnu/libva-drm.so.2
(0x00007f09cb27d000)
libva.so.2 => /lib/x86_64-linux-gnu/libva.so.2 (0x00007f09cb24a000)
libva-x11.so.2 => /lib/x86_64-linux-gnu/libva-x11.so.2
(0x00007f09cb242000)
libvdpau.so.1 => /lib/x86_64-linux-gnu/libvdpau.so.1
(0x00007f09cb23c000)
libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6
(0x00007f09cb0fc000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f09caed4000)
/lib64/ld-linux-x86-64.so.2 (0x00007f09cb6d1000)
libpulsecommon-15.99.so => /usr/lib/x86_64-linux-gnu/pulseaudio/
libpulsecommon-15.99.so (0x00007f09cae4d000)
libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3
(0x00007f09cadff000)
libdrm.so.2 => /lib/x86_64-linux-gnu/libdrm.so.2
(0x00007f09cade9000)
libXext.so.6 => /lib/x86_64-linux-gnu/libXext.so.6
(0x00007f09cadd4000)
libXfixes.so.3 => /lib/x86_64-linux-gnu/libXfixes.so.3
(0x00007f09cadcc000)
libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1
(0x00007f09cada2000)
libsndfile.so.1 => /lib/x86_64-linux-gnu/libsndfile.so.1
(0x00007f09cad21000)
libX11-xcb.so.1 => /lib/x86_64-linux-gnu/libX11-xcb.so.1
(0x00007f09cad1c000)
libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0
(0x00007f09cac55000)
libasyncns.so.0 => /lib/x86_64-linux-gnu/libasyncns.so.0
(0x00007f09cac4d000)
libapparmor.so.1 => /lib/x86_64-linux-gnu/libapparmor.so.1
(0x00007f09cac38000)
libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6
(0x00007f09cac30000)
libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6
(0x00007f09cac28000)
libFLAC.so.8 => /lib/x86_64-linux-gnu/libFLAC.so.8
(0x00007f09cabec000)
libvorbis.so.0 => /lib/x86_64-linux-gnu/libvorbis.so.0
(0x00007f09cabbf000)
libvorbisenc.so.2 => /lib/x86_64-linux-gnu/libvorbisenc.so.2
(0x00007f09cab14000)
libopus.so.0 => /lib/x86_64-linux-gnu/libopus.so.0
(0x00007f09caab6000)
libogg.so.0 => /lib/x86_64-linux-gnu/libogg.so.0
(0x00007f09caaa9000)
liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5
(0x00007f09caa7e000)
libzstd.so.1 => /lib/x86_64-linux-gnu/libzstd.so.1
(0x00007f09ca9af000)
liblz4.so.1 => /lib/x86_64-linux-gnu/liblz4.so.1
(0x00007f09ca98f000)
libcap.so.2 => /lib/x86_64-linux-gnu/libcap.so.2
(0x00007f09ca984000)
libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20
(0x00007f09ca846000)
libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0
(0x00007f09ca82c000)
libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0
(0x00007f09ca806000)
libmd.so.0 => /lib/x86_64-linux-gnu/libmd.so.0 (0x00007f09ca7f9000)
Is there some kind of middle-ground where I can include most of the
libraries statically as it did in a static build but only link against
libpulse dynamically?
More information about the ffmpeg-user
mailing list