Recent twitter entries...

  •  

Installing FFMpeg on CentOS/RedHat 5.x successfully

Posted by Nitai | Posted in linux | Posted on 24-02-2009

10

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.

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

Comments (10)

# some little fixing:
# …
# installing xvid
wget http://downloads.xvid.org/downloads/xvidcore-1.2.1.tar.gz
tar zxfv xvidcore-1.2.1.tar.gz
#cd xvidcore-1.2.1/build/generic # folder does not exist
cd xvidcore/build/generic
./configure
make && make install
# …
# Installing FFmpeg
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
cd ffmpeg
#./configure –enable-gpl –enable-postproc –enable-nonfree –enable-postproc –enable-libfaad –enable-swscale –enable-avfilter –enable-pthreads –enable-libxvid –enable-libx264 –enable-libmp3lame –enable-libfaac –disable-ffserver –disable-ffplay # option –enable-swscale does not exist anymore
./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

by the way…
your blog-text-parser rewrites the – - to –

here’s how to fix that with some sed magic:

sed -e ’s/–/- -/g’ #pipe the commands to be rewritten to this command and remove the space between – -

OR

paste “./configure –enable-gpl –enable-postproc…” in a vim editor window
enter following command “:%s/–/- -/g”
# also without the space between the two dashes

Thanks for the feedback. I updated the post accordingly.

this is good, how to uninstall everything?

Guess, if the distro does include an uninstall script to use that one, else to clear the paths :-)

[...] two other posts on FFmpeg entitled “Installing ffmpeg on CentOS 5” and “SELinux with ffmpeg” already explained in deep how to get FFmpeg up and [...]

Hi;

In making of ffmpeg I got the following error:

/usr/local/..my path ../ffmpeg/libavcodec/libx264.c:286: undefined reference to `x264_encoder_open_83'

I checked libx264.c file which contained x264_encoder_open not x264_encoder_open_83

Any help?

Thanks

Ali

Thanks Richard;

LAME was updated already, however I reinstalled it, but the problem did not resolved

You sometimes need to move to an older version of x264 to get it to work correctly. Sometimes it is a try and error game (unfortunately).

Write a comment