
install ffmpeg with codecs on Linux Redhat / CentOS
this guide is from http://wiki.razuna.com/display/ecp/FFMpeg+Installation+on+CentOS+and+RedHat
There are a couple of different ways to install FFMpeg and the required libraries. We are showing both ways here.
Recommended way
Install the additional repo
rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
Update repository
yum -y update
Install all necessary packages
yum install SDL-devel a52dec a52dec-devel alsa-lib-devel faac faac-devel faad2 faad2-devel yum install freetype-devel giflib gsm gsm-devel imlib2 imlib2-devel lame lame-devel libICE-devel libSM-devel libX11-devel yum install libXau-devel libXdmcp-devel libXext-devel libXrandr-devel libXrender-devel libXt-devel yum install libid3tag libogg-devel libvorbis-devel mesa-libGL-devel mesa-libGLU-devel xorg-x11-proto-devel xvidcore xvidcore-devel zlib-devel yum install amrnb-devel amrwb-devel yum install libtheora libtheora-devel yum install glibc gcc gcc-c++ autoconf automake libtool yum install subversion yum install ncurses-devel yum install libdc1394 libdc1394-devel yum install yasm nasm
Install the essential codecs from FFmepg
wget http://www3.mplayerhq.hu/MPlayer/releases/codecs/all-20071007.tar.bz2
bunzip2 all-20071007.tar.bz2; tar xvf all-20071007.tar
mkdir /usr/local/lib/codecs/
mkdir /usr/local/lib64/codecs/
cp all-20071007/* /usr/local/lib/codecs/
cp all-20071007/* /usr/local/lib64/codecs/
chmod -R 755 /usr/local/lib/codecs/
chmod -R 755 /usr/local/lib64/codecs/
Grab FFmpeg
svn checkout -r 20525 svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
Grab the x264 library
wget ftp://ftp.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20091031-2245.tar.bz2
bunzip2 x264-snapshot-20091031-2245.tar.bz2; tar xvf x264-snapshot-20091031-2245.tar
Make sure x264 has not been installed
yum erase x264*
Compile x264
cd x264 ./configure --enable-shared --prefix=/usr make make install
Compile FFmpeg (the configure options have to be on one line)
cd ffmpeg ./configure --enable-gpl --enable-nonfree --enable-postproc --enable-libfaad --enable-avfilter --enable-pthreads \ --enable-libxvid --enable-libx264 --enable-libmp3lame --enable-libfaac --disable-ffserver --disable-ffplay \ --enable-libtheora --enable-libvorbis --disable-ffplay --enable-shared --enable-avfilter-lavf --arch=x86_64 make make install
(The –arch=x86_64 option should only be used if you are on a 64Bit System!)
Edit ld.so.conf
vi /etc/ld.so.conf
add this new line
/usr/local/lib
Activate the shared libraries
ldconfig
That’s it. This should give you a full functional FFMpeg installation for Razuna. Test it now with;
ffmpeg
This should give you the following back (yours might vary a bit);
FFmpeg version SVN-r20525, Copyright (c) 2000-2009 Fabrice Bellard, et al. configuration: --enable-gpl --enable-nonfree --enable-postproc --enable-libfaad --enable-avfilter --enable-pthreads --enable-libxvid --enable-libx264 --enable-libmp3lame --enable-libfaac --disable-ffserver --disable-ffplay --enable-libamr-nb --enable-libamr-wb --enable-libtheora --enable-libvorbis --disable-ffplay --enable-shared libavutil 50. 4. 0 / 50. 4. 0 libavcodec 52.39. 0 / 52.39. 0 libavformat 52.39. 2 / 52.39. 2 libavdevice 52. 2. 0 / 52. 2. 0 libavfilter 1. 8. 0 / 1. 8. 0 libswscale 0. 7. 1 / 0. 7. 1 libpostproc 51. 2. 0 / 51. 2. 0
(your output might vary a bit)
Try to convert a movie with;
ffmpeg -i movie.mov -vcodec libx264 -vpre hq -acodec libfaac movie.mp4
If above fails you can try to compile each library on your own.
Please follow the below steps one by one to install FFMpeg on CentOS/RedHat 5.x. successfully.
Getting Started
razuna:$ razuna:$ mkdir -p ./tmp/ffmpeg-packages razuna:$ cd ./tmp/ffmpeg-packages
Installing a52
razuna:$ wget http://liba52.sourceforge.net/files/a52dec-0.7.4.tar.gz
razuna:$ tar -zxf a52dec-0.7.4.tar.gz
razuna:$ cd a52dec-0.7.4
razuna:$ ./configure --enable-shared=PKGS
razuna:$ make && make install
razuna:$ cd ..
Installing FAAD2
razuna:$ wget http://downloads.sourceforge.net/faac/faad2-2.6.1.tar.gz
razuna:$ tar zxf faad2-2.6.1.tar.gz
razuna:$ cd faad2
razuna:$ autoreconf -vif
razuna:$ ./configure --disable-drm --disable-mpeg4ip
razuna:$ make && make install
razuna:$ cd ..
Installing FAAC
razuna:$ wget http://downloads.sourceforge.net/faac/faac-1.26.tar.gz
razuna:$ tar zxfv faac-1.26.tar.gz
razuna:$ cd faac
razuna:$ ./bootstrap
razuna:$ ./configure --disable-mp4v2
razuna:$ make && make install
razuna:$ cd ..
Installing LAME
razuna:$ wget http://superb-east.dl.sourceforge.net/sourceforge/lame/lame-3.98b8.tar.gz
razuna:$ tar zxfv lame-3.98b8.tar.gz
razuna:$ cd lame-3.98b8
razuna:$ ./configure
razuna:$ make && make install
razuna:$ cd ..
Installing yasm
YASM is a modular assembler, it is required by the x264 package.
razuna:$ wget http://www.tortall.net/projects/yasm/releases/yasm-0.7.0.tar.gz
razuna:$ tar zfvx yasm-0.7.0.tar.gz
razuna:$ cd yasm-0.7.0
razuna:$ ./configure
razuna:$ make && make install
razuna:$ cd ..
Installing x264
razuna:$ git clone git://git.videolan.org/x264.git
razuna:$ cd x264
razuna:$ ./configure --enable-shared --prefix=/usr && make && sudo make install
Installing Xvid
razuna:$ wget http://downloads.xvid.org/downloads/xvidcore-1.2.1.tar.gz razuna:$ tar zxfv xvidcore-1.2.1.tar.gz razuna:$ cd xvidcore-1.2.1/build/generic razuna:$ ./configure razuna:$ make && make install razuna:$ cd ../../..
Installing FFmpeg
For FFMPEG, you will need to get the latest out of SVN. FFMPEG doesn’t ever make releases. To do so, run:
(the configure options have to be on one line)
razuna:$ svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
razuna:$ cd ffmpeg
razuna:$ ./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
razuna:$ make
razuna:$ make install