[FFmpeg-user] how to build ffmpeg into one static program without any dependent dynamic library

qw applemax82 at 163.com
Wed Jul 4 15:52:29 EEST 2018


Hi Moritz,


Thanks for your help.


I use CentOS 7.4 to build static ffmpeg.


Thanks!


Regards


Andrew



At 2018-07-04 19:19:57, "Moritz Barsnick" <barsnick at gmx.net> wrote:
>Hi qw,
>
>On Wed, Jul 04, 2018 at 18:52:06 +0800, qw wrote:
>> ./configure --disable-ffplay --disable-indev=sndio --disable-outdev=sndio \
>> --enable-version3 --enable-asm --enable-x86asm --enable-avfilter \
>> --enable-static --disable-shared --enable-gpl --enable-nonfree --prefix=/usr/local/ \
>> --enable-stripping
>[...]
>> ldd /usr/local/bin/ffmpeg 
>> linux-vdso.so.1 =>  (0x00007ffee27f4000)
>> libm.so.6 => /lib64/libm.so.6 (0x00007f8504516000)
>> libxcb.so.1 => /lib64/libxcb.so.1 (0x00007f85042ed000)
>> libxcb-shm.so.0 => /lib64/libxcb-shm.so.0 (0x00007f85040e9000)
>> libxcb-shape.so.0 => /lib64/libxcb-shape.so.0 (0x00007f8503ee5000)
>> libxcb-xfixes.so.0 => /lib64/libxcb-xfixes.so.0 (0x00007f8503cdc000)
>> libasound.so.2 => /lib64/libasound.so.2 (0x00007f85039de000)
>> libva.so.2 => /lib64/libva.so.2 (0x00007f85037bc000)
>> libgomp.so.1 => /lib64/libgomp.so.1 (0x00007f8503595000)
>> libdl.so.2 => /lib64/libdl.so.2 (0x00007f8503391000)
>> libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f8503089000)
>> librt.so.1 => /lib64/librt.so.1 (0x00007f8502e80000)
>> libva-drm.so.2 => /lib64/libva-drm.so.2 (0x00007f8502c7d000)
>> libz.so.1 => /lib64/libz.so.1 (0x00007f8502a67000)
>> liblzma.so.5 => /lib64/liblzma.so.5 (0x00007f8502840000)
>> libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f8502624000)
>> libva-x11.so.2 => /lib64/libva-x11.so.2 (0x00007f850241e000)
>> libX11.so.6 => /lib64/libX11.so.6 (0x00007f85020df000)
>> libnuma.so.1 => /lib64/libnuma.so.1 (0x00007f8501ed3000)
>> libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f8501cbd000)
>> libc.so.6 => /lib64/libc.so.6 (0x00007f85018f9000)
>> /lib64/ld-linux-x86-64.so.2 (0x00005629c1296000)
>> libXau.so.6 => /lib64/libXau.so.6 (0x00007f85016f5000)
>> libdrm.so.2 => /lib64/libdrm.so.2 (0x00007f85014e5000)
>> libXext.so.6 => /lib64/libXext.so.6 (0x00007f85012d3000)
>> libXfixes.so.3 => /lib64/libXfixes.so.3 (0x00007f85010cd000)
>> 
>> 
>> There are lots of system dynamic libraries for my ffmpeg.
>> How to build static ffmepg without any dependent dynamic library?
>
>All those dynamic/shared dependant libraries you see above: You need to
>provide static versions of them when linking ffmpeg. Those are the ones
>named "*.a" If your system is built up from some distribution or
>package manager (such as Linux Ubuntu or the likes), you need to find
>those static library packages. If that system/distribution does not
>provide them, you actually need to build them yourself. (There do exist
>peculiar tricks to convert shared libraries to static ones, but I'm
>certain that's not stable.)
>
>Ubuntu (and probably Debian) seems to provide those static libraries in
>their "-dev" packages. Fedora, to my knowledge, does not give you any
>chance to get the static versions, with few exceptions (which usually
>land in a "lib*-static" package).
>
>Do you not have the possibility for your target system (where ffmpeg is
>supposed to run) to provide these libraries?
>
>Cheers,
>Moritz
>_______________________________________________
>ffmpeg-user mailing list
>ffmpeg-user at ffmpeg.org
>http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
>To unsubscribe, visit link above, or email
>ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-user mailing list