1) Get the latest FFMPEG source code.

svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg

2) Rename ffmpeg directory to something you will remember like ffmpeg_gpl. Try avoiding making changes in your already compiled FFMPEG. You may want to keep two version of FFMPEG one LGPL version and other GPL version. I chose to rename it to ffmpeg_gpl to keep it reminding me that I am using GPL version.

mv ffmpeg-2.4.3 ffmpeg-gpl

3) cd to ffmpeg directory

cd ffmpeg-gpl/

4) Get the latest libx264 in ffmpeg directory. Having it in FFMPEG folder is good idea.

git clone git://git.videolan.org/x264.git

5) Move to x264 folder

cd x264

6) Compile x264 for static libraries

./configure --enable-static --prefix=.

–enable-shared: Add this option for generating shared library

–prefix= Libs and include install path

7) compile and install x264. make install will install to path provided in above step in –prefix

make;make install

8) Compiling FFMPEG with libx264.

9) move to ffmpeg folder and configure it for compiling with libx264.

./configure --enable-gpl --enable-libx264 --enable-pthreads --enable-static --extra-cflags=-I./x264/include --extra-ldflags=-L./x264/lib --extra-libs=-ldl

–enable-static: use this option to link all libraries statically

–extra-cflags: Use this option to include path for libs include folder (other libs like libx264)

–extra-libs: Use this option to include path for libraries

–extra-libs=-ldl

10) Verify FFMPEG is configured with libx264 by verifying configure output section External libraries:

External libraries:
iconv libx264

11) make FFMPEG library

make

12) Done!