Compiling ffmpeg: how to force it to link to a specific libx264?
Question
I'm trying to compile the newest version of ffmpeg (in CentOS 5.3). I first downloaded the latest version of libx264, compiled it with --enable-static
and installed it in /usr/local/
. However, when I then compile ffmpeg I get this error message:
libavcodec/libavcodec.a(libx264.o): In function `X264_init':
/usr/local/src/ffmpeg/libavcodec/libx264.c:494: undefined reference to `x264_encoder_open_125'
collect2: ld returned 1 exit status
make: *** [ffmpeg_g] Error 1
Searching on the net, I see that this can happen if ffmpeg is picking up an older version of libx264, which I indeed have (in /usr/lib
) and can't uninstall because other pieces of software depend on it. The question is then: how can I force ffmpeg to link against the libx264 that I want? The last time I had to do this (admittedly a year ago) I also had 2 versions of libx264, and I don't remember having to do anything special. Is there a configure switch that I'm forgetting?
Solution
Using and android-ffmpeg git project as an example with static x264 libs, and like 'blahdblah' already said... I think you just need to setup your lib paths correctly in the CC and LINK phases. Notice the 'cflags' and 'ldflags' switches at the bottom of the link.
I don't mean to complicate matters by introducing an android example , but it may help to look at this instance of 'config_ffmpeg'.
OTHER TIPS
are you just trying to decode h264, we have a framework based on ffmpeg .8, which seems a little more stable than the latest
www.github.com/mooncatventures-group