[FFmpeg-user] Help with static compile of ffmpeg with 3rd party libraries

Brad Phillips brad at bradphillips.org
Sat Dec 19 06:21:40 CET 2015


I’m a mac user who’s currently trying to accomplish a static compile of ffmpeg with certain 3rd party libraries included in the resulting make.  I’ve installed many of the libraries I’m looking for via homebrew and have noted that they tend to include both .dylib files alongside the static .a files when being installed.  

After a series of rounds of unsuccessful static builds (ffmpeg always seemed to be referencing the libraries and wasn’t truly portable), removing .dylib files from my library install locations started having some successes with resulting ffmpeg compiles.  

Currently, I’m running into the occasional library that ffmpeg ./configure reports “Error: [library] not found” even though it’s definitely present on my system.  Checking that I’ve got those libraries installed, in most cases, I’m noting that these libraries don’t include .pc/pkg-control files.  So, my main question involves around including libraries that are indeed on my machine but need to be manually located for the ffmpeg configuration - I have an example config command that is working:

PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure --pkg-config-flags="--static" --libdir=/usr/local/lib --extra-version=ntd_20151218 --disable-shared --enable-static --enable-gpl --enable-pthreads --enable-nonfree --enable-libfdk-aac  --enable-libmp3lame  --enable-avisynth --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libspeex --enable-libx264 --enable-version3 --enable-ffplay --disable-indev=qtkit --disable-indev=x11grab_xcb --enable-filters --enable-runtime-cpudetect --extra-cflags=-I/usr/local/Cellar/lame/3.99.5/include --extra-ldflags=-L/usr/local/Cellar/lame/3.99.5/lib

So, in the above, I’m manually locating the libmp3lame library with the extra-cflags and extra-ldflags because my machine doesn’t have a .pc file for that library.  The same can be said for the snappy library (installed on my machine but no .pc file), but when I try appending another manual locator for the snappy library onto the above configure command alongside the —enable-libsnappy option, the ffmpeg ./configure fails:

PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure --pkg-config-flags="--static" --libdir=/usr/local/lib --extra-version=ntd_20151218 --disable-shared --enable-static --enable-gpl --enable-pthreads --enable-nonfree --enable-libfdk-aac  --enable-libmp3lame  --enable-avisynth --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libspeex --enable-libx264 --enable-version3 --enable-ffplay --disable-indev=qtkit --disable-indev=x11grab_xcb --enable-filters --enable-runtime-cpudetect --enable-libsnappy --extra-cflags=-I/usr/local/Cellar/snappy/1.1.3/include --extra-ldflags=-L/usr/local/Cellar/snappy/1.1.3/lib --extra-cflags=-I/usr/local/Cellar/lame/3.99.5/include --extra-ldflags=-L/usr/local/Cellar/lame/3.99.5/lib

The error I get is: "ERROR: snappy not found”

I’ve checked and re-checked to be certain my locations are correct for the libsnappy library, but it’s possible I’m totally missing something or going about this the wrong way.

Any help or tips are greatly appreciated!  

Thanks! +Brad

More information about the ffmpeg-user mailing list