Factsheet
Bobby Bingham (libavfilter)
Bobby Bingham (libavfilter)
linux - How to compile FFmpeg as static (single file) - Stack Overflow
Can anyone tell me how you compile ffmpeg from a GitHub version, preferably into a static build?
Compiling Static FFMPEG Binary - Stack Overflow
FFmpeg Windows static builds
Videos
» npm install ffmpeg-static
In my CentOS 5.11 and FFmpeg 3.0, I have to use options
--pkg-config-flags="--static"
--extra-cflags="-I$HOME/ffmpeg/include -static"
--extra-ldflags="-L$HOME/ffmpeg/lib -static"
--enable-static tell a complier to create the "static libraries" (libav*.a). We can be combine FFmpeg API in the other standalone (static) application.
--disable-shared tell a complier not to create the "dynamically linked shared object libraries" (libav*.so). These type of libraries can be load and use FFmpeg API by the other application.
These 2 options doesn't complie FFmpeg as standalone static executable.
Thanks for stib's suggestion. I leave my answer here.
FFmepg build process take higher priority to use dynamic library even if static libraries are ready. Therefore, I first removed some external libraries support from build configuration and make sure all external libraries are only static (remove *.dylib from prefix /usr/local/lib). Then rebuild it with the following command:
./configure --pkg-config-flags="--static" --libdir=/usr/local/lib --extra-version=ntd_20150128 --disable-shared --enable-static --enable-gpl --enable-pthreads --enable-nonfree --enable-libass --enable-libfdk-aac --enable-libmp3lame --enable-libx264 --enable-filters --enable-runtime-cpudetect
Remember to define --pkg-config-flags="--static", asking build process to use static library. Then, we will get a single executable FFmpeg binary!
P.S.: I removed the libass support from the configuration, because libass depends on Fontconfig lib which I only have dynamic library available. I'll put the libass support back once I figured out how to make a static library of fontconfig.
Thanks.