What is FFmpeg?
FFmpeg is a very fast video and audio converter. It can also convert between arbitrary sample rates and resize video on the fly with a high quality polyphase filter.
Installtion
First we need to install dependencies.
wget http://dl.fedoraproject.org/pub/epel/6/i386/yasm-1.2.0-1.el6.i686.rpm
rpm -Uvh yasm-1.2.0-1.el6.i686.rpm
cd /usr/local/src
wget http://easynews.dl.sourceforge.net/sourceforge/lame/lame-3.99.5.tar.gz
wget http://downloads.xiph.org/releases/ogg/libogg-1.3.1.tar.gz
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.3.tar.gz
wget http://rubyforge.org/frs/download.php/17497/flvtool2-1.0.6.tgz
wget http://www.mplayerhq.hu/MPlayer/releases/codecs/essential-20071007.tar.bz2
wget http://sourceforge.net/projects/ffmpeg-php/files/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2/download
Untar all the mocules we have downloaded.
tar -zxvf libogg-1.3.1.tar.gz
tar -zxvf libvorbis-1.3.3.tar.gz
tar -zxvf flvtool2-1.0.6.tgz
tar -jxvf essential-20071007.tar.bz2
tar -jxvf ffmpeg-php-0.6.0.tbz2
mkdir /usr/local/lib/codecs/
yum -y install gcc gmake make libcpp libgcc libstdc++ gcc4 gcc4-c++ gcc4-gfortran subversion ncurses-devel -y
/scripts/installruby
DOWNLOAD FFMPEG and MPLAYER
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
cd /usr/local/src/mplayer
svn update
cd /usr/local/src/
mv /usr/local/src/essential-20071007/* /usr/local/lib/codecs/
chmod -R 755 /usr/local/lib/codecs/
LAME
cd /usr/local/src/lame-3.99.5
./configure
make && make install
LIBOGG
cd /usr/local/src/libogg-1.3.1
./configure --enable-shared && make && make install
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH
LIBVORBIS
cd /usr/local/src/libvorbis-1.3.3
./configure && make && make install
FLVTOOL2
cd /usr/local/src/flvtool2-1.0.6
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install
MPLAYER
cd /usr/local/src/mplayer
./configure && make && make install
FFMPEG
cd /usr/local/src/ffmpeg/
export TMPDIR=~/tmp-ffmpeg
mkdir $TMPDIR
./configure --enable-libmp3lame --enable-libvorbis --disable-mmx --enable-shared
make
make install
rm -rf $TMPDIR
export TMPDIR=
export LD_LIBRARY_PATH=/usr/local/lib/
ln -s /usr/local/lib/libavformat.so.52.93.0 /usr/lib/libavformat.so.52
ln -s /usr/local/lib/libavcodec.so.52.108.0 /usr/lib/libavcodec.so.52
ln -s /usr/local/lib/libavutil.so.50.36.0 /usr/lib/libavutil.so.50
ln -s /usr/local/lib/libmp3lame.so.0.0.0 /usr/lib/libmp3lame.so.0
ln -s /usr/local/lib/libavformat.so.52.93.0.51 /usr/lib/libavformat.so.52
FFMPEG-PHP
cd /usr/local/src/ffmpeg-php-0.6.0
vi ffmpeg_frame.c
:%s/PIX_FMT_RGBA32/PIX_FMT_RGB32
:wq
phpize
./configure
make
make install
Then add the follwing line to php.ini file.
extension="/usr/local/lib/php/extensions/no-debug-non-zts-20090626/ffmpeg.so"
RESTART APACHE
/scripts/restartsrv httpd