Re: [FFmpeg-user] how to build ffmpeg into one static program without any dependent dynamic library
Hi, Static glibc/zlib/libstdc++ are installed as below: yum install glibc-static zlib-static libstdc++-static Therefore libm.a/libz.a/libpthread.a/libdl.a are installed /usr/lib64/libm.a /usr/lib64/libz.a /usr/lib64/libpthread.a /usr/lib64/libdl.a I use the following command to configure and build ffmpeg 4.0 ./configure --disable-ffplay --disable-indev=sndio --disable-outdev=sndio \ --extra-ldflags='-L/usr/lib' \ --extra-libs='-lz -lm -lpthread -lstdc++ -ldl' \ --disable-libxcb --disable-libxcb-shm --disable-libxcb-xfixes --disable-libxcb-shape \ --enable-gpl --enable-stripping make When I use ldd the check ffmpeg's dependent dynamic libraries, libz.so.1/libm.so.6/libpthread.so.0/libdl.so.2 are still ffmpeg's dependent dynamic libraries. ldd ./ffmpeg linux-vdso.so.1 => (0x7fff8cffe000) libm.so.6 => /lib64/libm.so.6 (0x7f4b36d72000) libasound.so.2 => /lib64/libasound.so.2 (0x7f4b36a73000) libva.so.2 => /lib64/libva.so.2 (0x7f4b36851000) libz.so.1 => /lib64/libz.so.1 (0x7f4b3663b000) liblzma.so.5 => /lib64/liblzma.so.5 (0x7f4b36414000) libva-drm.so.2 => /lib64/libva-drm.so.2 (0x7f4b36211000) libva-x11.so.2 => /lib64/libva-x11.so.2 (0x7f4b3600b000) libX11.so.6 => /lib64/libX11.so.6 (0x7f4b35ccc000) libpthread.so.0 => /lib64/libpthread.so.0 (0x7f4b35ab) libc.so.6 => /lib64/libc.so.6 (0x7f4b356ed000) /lib64/ld-linux-x86-64.so.2 (0x55f02297c000) libdl.so.2 => /lib64/libdl.so.2 (0x7f4b354e8000) librt.so.1 => /lib64/librt.so.1 (0x7f4b352e) libdrm.so.2 => /lib64/libdrm.so.2 (0x7f4b350d1000) libXext.so.6 => /lib64/libXext.so.6 (0x7f4b34ebe000) libXfixes.so.3 => /lib64/libXfixes.so.3 (0x7f4b34cb8000) libxcb.so.1 => /lib64/libxcb.so.1 (0x7f4b34a9) libXau.so.6 => /lib64/libXau.so.6 (0x7f4b3488b000) How can I make ffmpeg link with specified static libraries, i.e. libm.a/libz.a/libpthread.a/libdl.a? Thanks! Regards Andrew At 2018-07-09 18:01:14, "Reindl Harald" wrote: > >Am 09.07.2018 um 11:39 schrieb Moritz Barsnick: >>> Can I specify which static libraries are used and which dynamic libraries >>> are used to build ffmpeg? >> >> If both static and dynamic libraries are found, the linkers will by >> default prefer the dynamic one. >> >> Choices can be manipulated, but no build system I know of supports >> this, because it would make ./configure and the Makefiles too >> complicated > >--extra-ldflags='-I/rpmbuild/BUILD/ffmpeg-20180617/x264-static >-L/rpmbuild/BUILD/ffmpeg-20180617/x264-static -ldl' > >this links my /rpmbuild/BUILD/ffmpeg-20180617/x264-static/x264.a built >in the first step of 'ffmpeg-latest.spec' and on that machine x264-devel >from the distribution is present too > >see my first repsone to that question with the wholke spec-file >___ >ffmpeg-user mailing list >ffmpeg-user@ffmpeg.org >http://ffmpeg.org/mailman/listinfo/ffmpeg-user > >To unsubscribe, visit link above, or email >ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] how to build ffmpeg into one static program without any dependent dynamic library
> -Original Message- > From: ffmpeg-user [mailto:ffmpeg-user-boun...@ffmpeg.org] On Behalf Of > Reindl Harald > Sent: Thursday, July 5, 2018 6:35 PM > To: ffmpeg-user@ffmpeg.org > Subject: Re: [FFmpeg-user] how to build ffmpeg into one static program > without any dependent dynamic library > > > > Am 05.07.2018 um 11:55 schrieb qw: > > yum install glibc-devel glibc-static zlib-static libstdc++-static Is > > there any way to install install libva and libva-drm libraries? > > static - no - redhat has strong policies to *remove* .a files for static > linking > from packages because static linking is considered a bad practice > > libva-devel x86_64 1.8.3-1.el7 base > libdrm-devel x86_64 2.4.83-2.el7 base > > only dynamic libraries - just don't do it - build proper rpm packages which > contains automatic dependencies Libva doesn't support static building. See https://github.com/intel/libva/issues/118#issuecomment-34533 ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] how to build ffmpeg into one static program without any dependent dynamic library
Am 09.07.2018 um 11:39 schrieb Moritz Barsnick: >> Can I specify which static libraries are used and which dynamic libraries >> are used to build ffmpeg? > > If both static and dynamic libraries are found, the linkers will by > default prefer the dynamic one. > > Choices can be manipulated, but no build system I know of supports > this, because it would make ./configure and the Makefiles too > complicated --extra-ldflags='-I/rpmbuild/BUILD/ffmpeg-20180617/x264-static -L/rpmbuild/BUILD/ffmpeg-20180617/x264-static -ldl' this links my /rpmbuild/BUILD/ffmpeg-20180617/x264-static/x264.a built in the first step of 'ffmpeg-latest.spec' and on that machine x264-devel from the distribution is present too see my first repsone to that question with the wholke spec-file ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] how to build ffmpeg into one static program without any dependent dynamic library
On Mon, Jul 09, 2018 at 16:21:40 +0800, qw wrote: > /export/qiang/buildDir/jdcloud_vod_ffmpeg/JD_FFmpeg/libavformat/rtpproto.c:140: > warning: Using 'getaddrinfo' in statically linked applications requires at > runtime the shared libraries from the glibc version used for linking Yes, that's a restriction of glibc and static linking, google it. > However, ffmpeg is static without any dependent dynamic library. Congrats! You did it! > If I want to use Intel qsv codec, the option of '--enable-libmfx' should be > added. Then configure will report error : > /bin/ld: cannot find -lva > /bin/ld: cannot find -lva-drm > The reason why it fails is that, there is no static libva library. Perhaps you can build these statically yourself (as was recommended for all the other dependant stuff). > Can I specify which static libraries are used and which dynamic libraries are > used to build ffmpeg? If both static and dynamic libraries are found, the linkers will by default prefer the dynamic one. Choices can be manipulated, but no build system I know of supports this, because it would make ./configure and the Makefiles too complicated. What comes to mind: a) Build a fake chroot build environment, where you hide all the dynamic libraries. b) At least GNU ld allows you to specify the preference per library on the command line. From the build, you take the linker command line (which you observe with "make V=1"). Replace stuff like this: https://stackoverflow.com/a/20728782/3974309 Or, you can also add stuff before each and every explicitly specified lib: $ gcc -o something [...] -Wl,-Bdynamic -ltiff -Wl,-Bstatic -lpng [...] You can also do this in blocks: after "-Wl,-Bdynamic", list all the one you want dynamically, then add "-Wl,-Bstatic" and list all the ones you want statically. Moritz ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] how to build ffmpeg into one static program without any dependent dynamic library
Hi, I use the following command to configure and build static ffmpeg : ./configure --disable-ffplay --disable-indev=sndio --disable-outdev=sndio \ --extra-libs='-static -L/usr/lib' --extra-cflags='--static' \ --enable-gpl --enable-stripping make reports some warnings : libavformat/libavformat.a(rtpproto.o): In function `rtp_resolve_host': /export/qiang/buildDir/jdcloud_vod_ffmpeg/JD_FFmpeg/libavformat/rtpproto.c:140: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libpthread.a(libpthread.o): In function `sem_open': (.text+0x6a23): warning: the use of `mktemp' is dangerous, better use `mkstemp' libavformat/libavformat.a(rtpproto.o): In function `rtp_resolve_host': /export/qiang/buildDir/jdcloud_vod_ffmpeg/JD_FFmpeg/libavformat/rtpproto.c:140: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libpthread.a(libpthread.o): In function `sem_open': (.text+0x6a23): warning: the use of `mktemp' is dangerous, better use `mkstemp' However, ffmpeg is static without any dependent dynamic library. If I want to use Intel qsv codec, the option of '--enable-libmfx' should be added. Then configure will report error : /bin/ld: cannot find -lva /bin/ld: cannot find -lva-drm The reason why it fails is that, there is no static libva library. Can I specify which static libraries are used and which dynamic libraries are used to build ffmpeg? Thanks! Regards Andrew At 2018-07-04 22:20:07, "Moritz Barsnick" wrote: >On Wed, Jul 04, 2018 at 20:52:29 +0800, qw wrote: >> Thanks for your help. >> I use CentOS 7.4 to build static ffmpeg. > >Could you please show us: >$ objdump -p /usr/local/bin/ffmpeg | grep NEEDED > >Furthermore, please make sure the following packages are installed: >glibc-devel >glibc-static # covers libc, libm, libdl(?), librt, libpthread dependencies >zlib-static # covers libz dependency > >Please add the following ffmpeg configure options: > --disable-libxcb # gets rid of libxcb* dependencies > --disable-xlib # gets rid of libX* dependencies > --disable-lzma # gets rid of liblzma dependency > --disable-vaapi # gets rid of libva dependency > --disable-alsa # gets rid of libasound dependency > >(At the loss of a few features.) > >And then build once more. > >Again: Can you not just install the required dynamic libs on the >target? > >Moritz >___ >ffmpeg-user mailing list >ffmpeg-user@ffmpeg.org >http://ffmpeg.org/mailman/listinfo/ffmpeg-user > >To unsubscribe, visit link above, or email >ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] how to build ffmpeg into one static program without any dependent dynamic library
2018-07-05 15:42 GMT+02:00, qw : > It's inconvenient to use ffmpeg with dependent dynamic libraries. How / why is it inconvenient? Stop top-posting! Carl Eugen ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] how to build ffmpeg into one static program without any dependent dynamic library
Hi, If the option of '--libmfx' is chosen, there is no way to build static ffmpeg. Is there any way to build static ffmpeg, where only dynamic libraries of libva are allowed and other system libraries are static? Thanks! Regard Andrew At 2018-07-05 18:35:26, "Reindl Harald" wrote: > > >Am 05.07.2018 um 11:55 schrieb qw: >> yum install glibc-devel glibc-static zlib-static libstdc++-static >> Is there any way to install install libva and libva-drm libraries? > >static - no - redhat has strong policies to *remove* .a files for static >linking from packages because static linking is considered a bad practice > >libva-devel x86_64 1.8.3-1.el7 base >libdrm-devel x86_64 2.4.83-2.el7 base > >only dynamic libraries - just don't do it - build proper rpm packages >which contains automatic dependencies > >___ >ffmpeg-user mailing list >ffmpeg-user@ffmpeg.org >http://ffmpeg.org/mailman/listinfo/ffmpeg-user > >To unsubscribe, visit link above, or email >ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] how to build ffmpeg into one static program without any dependent dynamic library
Hi, It's inconvenient to use ffmpeg with dependent dynamic libraries. Therefore, I want static ffmpeg instead. Thanks! Regards andrew At 2018-07-05 18:56:31, "Carl Eugen Hoyos" wrote: >2018-07-05 11:21 GMT+02:00, qw : >> Hi Carl Eugen, >> >> Thanks for your help. I use the following command to build static ffmpeg >> without any dependent dynamic library: >> >> ./configure --disable-ffplay \ --extra-libs='-static -L/usr/lib' >> --extra-cflags='--static' \ --enable-version3 --enable-asm --enable-x86asm >> --enable-avfilter \ --enable-static --disable-shared --enable-gpl >> --enable-nonfree --prefix=/usr/local/ \ --enable-stripping > >Did you read my email? > >Iirc, I asked you why you need static linking and I suggested you >remove some options because they make no sense. > >Please do not top-post here, Carl Eugen >___ >ffmpeg-user mailing list >ffmpeg-user@ffmpeg.org >http://ffmpeg.org/mailman/listinfo/ffmpeg-user > >To unsubscribe, visit link above, or email >ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] how to build ffmpeg into one static program without any dependent dynamic library
2018-07-05 11:21 GMT+02:00, qw : > Hi Carl Eugen, > > Thanks for your help. I use the following command to build static ffmpeg > without any dependent dynamic library: > > ./configure --disable-ffplay \ --extra-libs='-static -L/usr/lib' > --extra-cflags='--static' \ --enable-version3 --enable-asm --enable-x86asm > --enable-avfilter \ --enable-static --disable-shared --enable-gpl > --enable-nonfree --prefix=/usr/local/ \ --enable-stripping Did you read my email? Iirc, I asked you why you need static linking and I suggested you remove some options because they make no sense. Please do not top-post here, Carl Eugen ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] how to build ffmpeg into one static program without any dependent dynamic library
Am 05.07.2018 um 11:55 schrieb qw: > yum install glibc-devel glibc-static zlib-static libstdc++-static > Is there any way to install install libva and libva-drm libraries? static - no - redhat has strong policies to *remove* .a files for static linking from packages because static linking is considered a bad practice libva-devel x86_64 1.8.3-1.el7 base libdrm-devel x86_64 2.4.83-2.el7 base only dynamic libraries - just don't do it - build proper rpm packages which contains automatic dependencies ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] how to build ffmpeg into one static program without any dependent dynamic library
Hi Moritz, I have installed the following packages: yum install glibc-devel glibc-static zlib-static libstdc++-static And I use the following command to build static ffmpeg without any dependent dynamic library: ./configure --disable-ffplay \ --extra-libs='-static -L/usr/lib' --extra-cflags='--static' \ --enable-version3 --enable-asm --enable-x86asm --enable-avfilter \ --enable-static --disable-shared --enable-gpl --enable-nonfree --prefix=/usr/local/ \ --enable-stripping But I also want to build static ffmpeg with the option of '--enable-libmfx'. I fail to run the following command: ./configure --disable-ffplay \ --extra-libs='-static -L/usr/lib' --extra-cflags='--static' \ --enable-version3 --enable-asm --enable-x86asm --enable-avfilter \ --enable-static --disable-shared --enable-gpl --enable-nonfree --prefix=/usr/local/ \ --enable-stripping --enable-libmfx configure reported : /bin/ld: cannot find -lva /bin/ld: cannot find -lva-drm Is there any way to install install libva and libva-drm libraries? Thanks Regards Andrew At 2018-07-04 22:20:07, "Moritz Barsnick" wrote: >On Wed, Jul 04, 2018 at 20:52:29 +0800, qw wrote: >> Thanks for your help. >> I use CentOS 7.4 to build static ffmpeg. > >Could you please show us: >$ objdump -p /usr/local/bin/ffmpeg | grep NEEDED > >Furthermore, please make sure the following packages are installed: >glibc-devel >glibc-static # covers libc, libm, libdl(?), librt, libpthread dependencies >zlib-static # covers libz dependency > >Please add the following ffmpeg configure options: > --disable-libxcb # gets rid of libxcb* dependencies > --disable-xlib # gets rid of libX* dependencies > --disable-lzma # gets rid of liblzma dependency > --disable-vaapi # gets rid of libva dependency > --disable-alsa # gets rid of libasound dependency > >(At the loss of a few features.) > >And then build once more. > >Again: Can you not just install the required dynamic libs on the >target? > >Moritz >___ >ffmpeg-user mailing list >ffmpeg-user@ffmpeg.org >http://ffmpeg.org/mailman/listinfo/ffmpeg-user > >To unsubscribe, visit link above, or email >ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] how to build ffmpeg into one static program without any dependent dynamic library
Hi Carl Eugen, Thanks for your help. I use the following command to build static ffmpeg without any dependent dynamic library: ./configure --disable-ffplay \ --extra-libs='-static -L/usr/lib' --extra-cflags='--static' \ --enable-version3 --enable-asm --enable-x86asm --enable-avfilter \ --enable-static --disable-shared --enable-gpl --enable-nonfree --prefix=/usr/local/ \ --enable-stripping make I have install Intel media sdk 2018 R1 on my centos 7.4. I still want to build ffmpeg with Intel media sdk, i.e. with the option of '--enable-libmfx'. But I fail to run configure command: ./configure --disable-ffplay \ --extra-libs='-static -L/usr/lib' --extra-cflags='--static' \ --enable-version3 --enable-asm --enable-x86asm --enable-avfilter \ --enable-static --disable-shared --enable-gpl --enable-nonfree --prefix=/usr/local/ \ --enable-stripping --enable-libmfx configure reports as follows: ERROR: libmfx not found If you think configure made a mistake, make sure you are using the latest version from Git. If the latest version fails, report the problem to the ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net. Include the log file "ffbuild/config.log" produced by configure as this will help solve the problem. Is it possible to build static ffmpeg with the option of '--enable-libmfx'? Thanks! Regards Andrew At 2018-07-05 01:15:17, "Carl Eugen Hoyos" wrote: >2018-07-04 12:52 GMT+02:00, qw : > >> I have download ffmpeg 4.0, > >Just in case you forgot: On this mailing list, only current >FFmpeg git head is supported. > >> and want to build it into one static program, > >May I ask why? >(One of the options you use make it difficult to guess.) > >> i.e. ffmpeg, without any dependent dynamic library. > >As said, the easiest way is to use musl (and as said, >only x86_64 is supported, developers do not want to >document that x86_32 is incompatible). > >> I can find this kind of static ffmpeg from >> 'https://johnvansickle.com/ffmpeg/'. But I fail to build >> static ffmpeg myself. >> >> My steps are shown as follows: >> >> ./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 > >The following options have no effect, remove them: >--enable-asm --enable-x86asm --enable-avfilter >--enable-static --disable-shared --prefix=/usr/local/ >--enable-stripping > >--enable-version3 has no effect in above configure line. >(Is is needed for amr encoding, libsmb, libvmaf - which >doesn't work afair - and a few unusual things.) > >--enable-nonfree has an effect but I suspect you don't >want it, please remove it. > >In addition to what Moritz suggested, I believe you want >something like --extra-cflags=-static to convince your >linker to use the static libraries once you installed them. > >Carl Eugen >___ >ffmpeg-user mailing list >ffmpeg-user@ffmpeg.org >http://ffmpeg.org/mailman/listinfo/ffmpeg-user > >To unsubscribe, visit link above, or email >ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] how to build ffmpeg into one static program without any dependent dynamic library
2018-07-04 12:52 GMT+02:00, qw : > I have download ffmpeg 4.0, Just in case you forgot: On this mailing list, only current FFmpeg git head is supported. > and want to build it into one static program, May I ask why? (One of the options you use make it difficult to guess.) > i.e. ffmpeg, without any dependent dynamic library. As said, the easiest way is to use musl (and as said, only x86_64 is supported, developers do not want to document that x86_32 is incompatible). > I can find this kind of static ffmpeg from > 'https://johnvansickle.com/ffmpeg/'. But I fail to build > static ffmpeg myself. > > My steps are shown as follows: > > ./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 The following options have no effect, remove them: --enable-asm --enable-x86asm --enable-avfilter --enable-static --disable-shared --prefix=/usr/local/ --enable-stripping --enable-version3 has no effect in above configure line. (Is is needed for amr encoding, libsmb, libvmaf - which doesn't work afair - and a few unusual things.) --enable-nonfree has an effect but I suspect you don't want it, please remove it. In addition to what Moritz suggested, I believe you want something like --extra-cflags=-static to convince your linker to use the static libraries once you installed them. Carl Eugen ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] how to build ffmpeg into one static program without any dependent dynamic library
On Wed, Jul 04, 2018 at 20:52:29 +0800, qw wrote: > Thanks for your help. > I use CentOS 7.4 to build static ffmpeg. Could you please show us: $ objdump -p /usr/local/bin/ffmpeg | grep NEEDED Furthermore, please make sure the following packages are installed: glibc-devel glibc-static # covers libc, libm, libdl(?), librt, libpthread dependencies zlib-static # covers libz dependency Please add the following ffmpeg configure options: --disable-libxcb # gets rid of libxcb* dependencies --disable-xlib # gets rid of libX* dependencies --disable-lzma # gets rid of liblzma dependency --disable-vaapi # gets rid of libva dependency --disable-alsa # gets rid of libasound dependency (At the loss of a few features.) And then build once more. Again: Can you not just install the required dynamic libs on the target? Moritz ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] how to build ffmpeg into one static program without any dependent dynamic library
Am 04.07.2018 um 12:52 schrieb qw: > I have download ffmpeg 4.0, and want to build it into one static program, > i.e. ffmpeg, without any dependent dynamic library. > > ./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 > > make && make install > > ldd /usr/local/bin/ffmpeg > linux-vdso.so.1 => (0x7ffee27f4000) > libm.so.6 => /lib64/libm.so.6 (0x7f8504516000) > libxcb.so.1 => /lib64/libxcb.so.1 (0x7f85042ed000) > libxcb-shm.so.0 => /lib64/libxcb-shm.so.0 (0x7f85040e9000) > libxcb-shape.so.0 => /lib64/libxcb-shape.so.0 (0x7f8503ee5000) > libxcb-xfixes.so.0 => /lib64/libxcb-xfixes.so.0 (0x7f8503cdc000) > libasound.so.2 => /lib64/libasound.so.2 (0x7f85039de000) > libva.so.2 => /lib64/libva.so.2 (0x7f85037bc000) > libgomp.so.1 => /lib64/libgomp.so.1 (0x7f8503595000) > libdl.so.2 => /lib64/libdl.so.2 (0x7f8503391000) > libstdc++.so.6 => /lib64/libstdc++.so.6 (0x7f8503089000) > librt.so.1 => /lib64/librt.so.1 (0x7f8502e8) > libva-drm.so.2 => /lib64/libva-drm.so.2 (0x7f8502c7d000) > libz.so.1 => /lib64/libz.so.1 (0x7f8502a67000) > liblzma.so.5 => /lib64/liblzma.so.5 (0x7f850284) > libpthread.so.0 => /lib64/libpthread.so.0 (0x7f8502624000) > libva-x11.so.2 => /lib64/libva-x11.so.2 (0x7f850241e000) > libX11.so.6 => /lib64/libX11.so.6 (0x7f85020df000) > libnuma.so.1 => /lib64/libnuma.so.1 (0x7f8501ed3000) > libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x7f8501cbd000) > libc.so.6 => /lib64/libc.so.6 (0x7f85018f9000) > /lib64/ld-linux-x86-64.so.2 (0x5629c1296000) > libXau.so.6 => /lib64/libXau.so.6 (0x7f85016f5000) > libdrm.so.2 => /lib64/libdrm.so.2 (0x7f85014e5000) > libXext.so.6 => /lib64/libXext.so.6 (0x7f85012d3000) > libXfixes.so.3 => /lib64/libXfixes.so.3 (0x7f85010cd000) > > There are lots of system dynamic libraries for my ffmpeg you simply can't avoid that 100% until you build and link each and every library static as i showe dyou for x264 in your other thread "[FFmpeg-user] How to build ffmpeg/x264/x265/fdkaac into one single ffmpeg file?" may i ask why you start a second thread for the same topic at all? ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] how to build ffmpeg into one static program without any dependent dynamic library
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" 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 => (0x7ffee27f4000) >> libm.so.6 => /lib64/libm.so.6 (0x7f8504516000) >> libxcb.so.1 => /lib64/libxcb.so.1 (0x7f85042ed000) >> libxcb-shm.so.0 => /lib64/libxcb-shm.so.0 (0x7f85040e9000) >> libxcb-shape.so.0 => /lib64/libxcb-shape.so.0 (0x7f8503ee5000) >> libxcb-xfixes.so.0 => /lib64/libxcb-xfixes.so.0 (0x7f8503cdc000) >> libasound.so.2 => /lib64/libasound.so.2 (0x7f85039de000) >> libva.so.2 => /lib64/libva.so.2 (0x7f85037bc000) >> libgomp.so.1 => /lib64/libgomp.so.1 (0x7f8503595000) >> libdl.so.2 => /lib64/libdl.so.2 (0x7f8503391000) >> libstdc++.so.6 => /lib64/libstdc++.so.6 (0x7f8503089000) >> librt.so.1 => /lib64/librt.so.1 (0x7f8502e8) >> libva-drm.so.2 => /lib64/libva-drm.so.2 (0x7f8502c7d000) >> libz.so.1 => /lib64/libz.so.1 (0x7f8502a67000) >> liblzma.so.5 => /lib64/liblzma.so.5 (0x7f850284) >> libpthread.so.0 => /lib64/libpthread.so.0 (0x7f8502624000) >> libva-x11.so.2 => /lib64/libva-x11.so.2 (0x7f850241e000) >> libX11.so.6 => /lib64/libX11.so.6 (0x7f85020df000) >> libnuma.so.1 => /lib64/libnuma.so.1 (0x7f8501ed3000) >> libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x7f8501cbd000) >> libc.so.6 => /lib64/libc.so.6 (0x7f85018f9000) >> /lib64/ld-linux-x86-64.so.2 (0x5629c1296000) >> libXau.so.6 => /lib64/libXau.so.6 (0x7f85016f5000) >> libdrm.so.2 => /lib64/libdrm.so.2 (0x7f85014e5000) >> libXext.so.6 => /lib64/libXext.so.6 (0x7f85012d3000) >> libXfixes.so.3 => /lib64/libXfixes.so.3 (0x7f85010cd000) >> >> >> 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@ffmpeg.org >http://ffmpeg.org/mailman/listinfo/ffmpeg-user > >To unsubscribe, visit link above, or email >ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] how to build ffmpeg into one static program without any dependent dynamic library
On Wed, Jul 04, 2018 at 13:19:57 +0200, Moritz Barsnick wrote: > On Wed, Jul 04, 2018 at 18:52:06 +0800, qw wrote: > > ldd /usr/local/bin/ffmpeg > > linux-vdso.so.1 => (0x7ffee27f4000) > > libm.so.6 => /lib64/libm.so.6 (0x7f8504516000) > > libxcb.so.1 => /lib64/libxcb.so.1 (0x7f85042ed000) > > libxcb-shm.so.0 => /lib64/libxcb-shm.so.0 (0x7f85040e9000) > > libxcb-shape.so.0 => /lib64/libxcb-shape.so.0 (0x7f8503ee5000) > > libxcb-xfixes.so.0 => /lib64/libxcb-xfixes.so.0 (0x7f8503cdc000) > > libasound.so.2 => /lib64/libasound.so.2 (0x7f85039de000) > > libva.so.2 => /lib64/libva.so.2 (0x7f85037bc000) > > libgomp.so.1 => /lib64/libgomp.so.1 (0x7f8503595000) > > libdl.so.2 => /lib64/libdl.so.2 (0x7f8503391000) > > libstdc++.so.6 => /lib64/libstdc++.so.6 (0x7f8503089000) > > librt.so.1 => /lib64/librt.so.1 (0x7f8502e8) > > libva-drm.so.2 => /lib64/libva-drm.so.2 (0x7f8502c7d000) > > libz.so.1 => /lib64/libz.so.1 (0x7f8502a67000) > > liblzma.so.5 => /lib64/liblzma.so.5 (0x7f850284) > > libpthread.so.0 => /lib64/libpthread.so.0 (0x7f8502624000) > > libva-x11.so.2 => /lib64/libva-x11.so.2 (0x7f850241e000) > > libX11.so.6 => /lib64/libX11.so.6 (0x7f85020df000) > > libnuma.so.1 => /lib64/libnuma.so.1 (0x7f8501ed3000) > > libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x7f8501cbd000) > > libc.so.6 => /lib64/libc.so.6 (0x7f85018f9000) > > /lib64/ld-linux-x86-64.so.2 (0x5629c1296000) > > libXau.so.6 => /lib64/libXau.so.6 (0x7f85016f5000) > > libdrm.so.2 => /lib64/libdrm.so.2 (0x7f85014e5000) > > libXext.so.6 => /lib64/libXext.so.6 (0x7f85012d3000) > > libXfixes.so.3 => /lib64/libXfixes.so.3 (0x7f85010cd000) > > All those dynamic/shared dependant libraries you see above: You need to > provide static versions of them when linking ffmpeg. Actually, what comes to mind is that a lot of them are "system" features picked up by ffmpeg configure. If you don't need the x11grab indev, which I assume pulls in all those X11 dependencies (incl. libdrm and libxcb), you could explicitly disable it on the configure command line. I also notice libva, which you can also explicitly disable. With the others, one would have to check which ffmpeg pulls in, and for which features each is needed. (That's not documented well.) Cheers, Moritz ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] how to build ffmpeg into one static program without any dependent dynamic library
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 => (0x7ffee27f4000) > libm.so.6 => /lib64/libm.so.6 (0x7f8504516000) > libxcb.so.1 => /lib64/libxcb.so.1 (0x7f85042ed000) > libxcb-shm.so.0 => /lib64/libxcb-shm.so.0 (0x7f85040e9000) > libxcb-shape.so.0 => /lib64/libxcb-shape.so.0 (0x7f8503ee5000) > libxcb-xfixes.so.0 => /lib64/libxcb-xfixes.so.0 (0x7f8503cdc000) > libasound.so.2 => /lib64/libasound.so.2 (0x7f85039de000) > libva.so.2 => /lib64/libva.so.2 (0x7f85037bc000) > libgomp.so.1 => /lib64/libgomp.so.1 (0x7f8503595000) > libdl.so.2 => /lib64/libdl.so.2 (0x7f8503391000) > libstdc++.so.6 => /lib64/libstdc++.so.6 (0x7f8503089000) > librt.so.1 => /lib64/librt.so.1 (0x7f8502e8) > libva-drm.so.2 => /lib64/libva-drm.so.2 (0x7f8502c7d000) > libz.so.1 => /lib64/libz.so.1 (0x7f8502a67000) > liblzma.so.5 => /lib64/liblzma.so.5 (0x7f850284) > libpthread.so.0 => /lib64/libpthread.so.0 (0x7f8502624000) > libva-x11.so.2 => /lib64/libva-x11.so.2 (0x7f850241e000) > libX11.so.6 => /lib64/libX11.so.6 (0x7f85020df000) > libnuma.so.1 => /lib64/libnuma.so.1 (0x7f8501ed3000) > libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x7f8501cbd000) > libc.so.6 => /lib64/libc.so.6 (0x7f85018f9000) > /lib64/ld-linux-x86-64.so.2 (0x5629c1296000) > libXau.so.6 => /lib64/libXau.so.6 (0x7f85016f5000) > libdrm.so.2 => /lib64/libdrm.so.2 (0x7f85014e5000) > libXext.so.6 => /lib64/libXext.so.6 (0x7f85012d3000) > libXfixes.so.3 => /lib64/libXfixes.so.3 (0x7f85010cd000) > > > 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@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-user] how to build ffmpeg into one static program without any dependent dynamic library
Hi, I have download ffmpeg 4.0, and want to build it into one static program, i.e. ffmpeg, without any dependent dynamic library. I can find this kind of static ffmpeg from 'https://johnvansickle.com/ffmpeg/'. But I fail to build static ffmpeg myself. My steps are shown as follows: ./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 make && make install ldd /usr/local/bin/ffmpeg linux-vdso.so.1 => (0x7ffee27f4000) libm.so.6 => /lib64/libm.so.6 (0x7f8504516000) libxcb.so.1 => /lib64/libxcb.so.1 (0x7f85042ed000) libxcb-shm.so.0 => /lib64/libxcb-shm.so.0 (0x7f85040e9000) libxcb-shape.so.0 => /lib64/libxcb-shape.so.0 (0x7f8503ee5000) libxcb-xfixes.so.0 => /lib64/libxcb-xfixes.so.0 (0x7f8503cdc000) libasound.so.2 => /lib64/libasound.so.2 (0x7f85039de000) libva.so.2 => /lib64/libva.so.2 (0x7f85037bc000) libgomp.so.1 => /lib64/libgomp.so.1 (0x7f8503595000) libdl.so.2 => /lib64/libdl.so.2 (0x7f8503391000) libstdc++.so.6 => /lib64/libstdc++.so.6 (0x7f8503089000) librt.so.1 => /lib64/librt.so.1 (0x7f8502e8) libva-drm.so.2 => /lib64/libva-drm.so.2 (0x7f8502c7d000) libz.so.1 => /lib64/libz.so.1 (0x7f8502a67000) liblzma.so.5 => /lib64/liblzma.so.5 (0x7f850284) libpthread.so.0 => /lib64/libpthread.so.0 (0x7f8502624000) libva-x11.so.2 => /lib64/libva-x11.so.2 (0x7f850241e000) libX11.so.6 => /lib64/libX11.so.6 (0x7f85020df000) libnuma.so.1 => /lib64/libnuma.so.1 (0x7f8501ed3000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x7f8501cbd000) libc.so.6 => /lib64/libc.so.6 (0x7f85018f9000) /lib64/ld-linux-x86-64.so.2 (0x5629c1296000) libXau.so.6 => /lib64/libXau.so.6 (0x7f85016f5000) libdrm.so.2 => /lib64/libdrm.so.2 (0x7f85014e5000) libXext.so.6 => /lib64/libXext.so.6 (0x7f85012d3000) libXfixes.so.3 => /lib64/libXfixes.so.3 (0x7f85010cd000) There are lots of system dynamic libraries for my ffmpeg. How to build static ffmepg without any dependent dynamic library? Thanks regards Andrew ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".