Methods of compiling and installing ffmpeg and libx264 in Linux

Recently in the study of TS stream video preparation FFMPEG video format encoding and conversion
Compiling FFMPEG was smooth but integrating with Libx264 was tedious
It took me a long time to find it online
It is hereby sorted here

Operating system: CentOS 6.4 64-bit kernel 2.6.32
Compiling environment: GCC 4.4.7
FFMPEG version: 2.4
X264 version: X264 0.142.2479 DD79A61
YASM version: 1.3

Prepare documents:
Ffmpeg source
Git clone git://

Compile and install procedure:
1. Install YASM

tar zxvf yasm-1.3.0.tar.gz 
cd yasm-1.3.0
 make install
 yasm --version

2. Compile and install X264

cd x264 
./configure --enable-shared --enable-pthread --enable-pic
make install

3. Compile FFMPEG

cd ffmpeg
./configure --enable-libx264 --enable-gpl --enable-shared  --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib --enable-pic
make install

Install well at FFMPEG runtime if prompted

ffmpeg: error while loading shared libraries: cannot open shared object file: No such file or directory

You will need to modify the file: /etc/

Add a line at the end of the file:
Then execute the command:

Rerun the ffmpeg – encoders | grep x264 will find successful installation

Read More: