Installing FFMpeg on CentOS/RedHat 5.x successfully

Share this post:

My primary Linux distribution of choice is CentOS. CentOS is an Enterprise-class Linux Distribution derived from sources freely provided to the public by RedHat. Thus CentOS is merely speaking a copy of RedHat and provides the same stability and security.

The trade off with stability and security is, that you mostly run packages which are not cutting edge and thus you run into issues where you need the cutting edge. This is the case with FFMpeg.

There is a DAG repository that give you FFMpeg in the yum installation, but that version is not working with libx264 or libfaac and still uses the older way of and might break some applications.

Thus I set out to find the best way to install FFMpeg. Since FFMpeg depends on a lot of external libraries we first have to install this external libraries.

Please follow the below steps one by one to install FFMpeg on CentOS/RedHat 5.x. successfully. Some of these libraries might be older (some even from 2008), thought I used what worked best for me and were stable in production environment.

Lets create a directory first
mkdir -p /opt/ffmpeg-packages
cd /opt/ffmpeg-packages

Installing FAAD2
wget http://downloads.sourceforge.net/faac/faad2-2.6.1.tar.gz
tar zxf faad2-2.6.1.tar.gz
cd faad2
autoreconf -vif
./configure –disable-drm –disable-mpeg4ip
make && make install

Installing FAAC
wget http://downloads.sourceforge.net/faac/faac-1.26.tar.gz
tar zxfv faac-1.26.tar.gz
cd faac
./bootstrap
./configure –disable-mp4v2
make && make install

Installing LAME
wget http://superb-east.dl.sourceforge.net/sourceforge/lame/lame-3.98b8.tar.gz
tar zxfv lame-3.98b8.tar.gz
cd lame-3.98b8
./configure
make && make install

Installing yasm
wget http://www.tortall.net/projects/yasm/releases/yasm-0.7.0.tar.gz
tar zfvx yasm-0.7.0.tar.gz
cd yasm-0.7.0
./configure
make && make install

Installing x264

FFMpeg requires that you get the latest x264 codec. Thus we use the latest from their GIT repository.

git clone git://git.videolan.org/x264.git
cd x264
./configure –enable-shared –prefix=/usr && make && sudo make install

Installing Xvid
wget http://downloads.xvid.org/downloads/xvidcore-1.2.1.tar.gz
tar zxfv xvidcore-1.2.1.tar.gz
cd xvidcore/build/generic
./configure
make && make install

Installing FFmpeg

For FFMPEG, you will need to get the latest out of SVN.

svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
cd ffmpeg
./configure –enable-gpl –enable-postproc –enable-nonfree –enable-postproc
–enable-libfaad –enable-avfilter –enable-pthreads –enable-libxvid
–enable-libx264 –enable-libmp3lame –enable-libfaac –disable-ffserver –disable-ffplay
make
make install

The “make” of FFmpeg can take up to 5 minutes, so please be patience. I also disable “FFServer” and “FFplay” on my servers. Please adjust to your environment.

Hope this helps.

Over 10 years in business.

Self-funded. No investors. No bullshit.

More than 3,000 customers worldwide.

Helpmonks - no bullshit customer engagement service

Growth starts with action

Empower your team and delight your customers.

Helpmonks - email management for small businesses