/* This article can possibly be re-written using the RPMs available from RPMForge. http://wiki.centos.org/AdditionalResources/Repositories/RPMForge */
Below is a step-by-step how-to on installing ffmpeg and ffmpeg-php on CentOS 5.3. The reason we (or anyone really) have not published a script to automate the process is due to the complexity of the installation and the fact that it is very prone to failures along the way, almost always requiring some sort of human intervention. We have attempted to address the most common of issues in this article, but if you find that you're stuck at one that is not mentioned, please feel free to send support an email.
cd /usr/local/src; \ wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.1-p0.tar.gz; \ wget http://www1.mplayerhq.hu/MPlayer/releases/codecs/essential-20061022.tar.bz2; \ wget http://rubyforge.org/frs/download.php/9225/flvtool2_1.0.5_rc6.tgz; \ wget http://downloads.sourceforge.net/project/lame/lame/3.98.4/lame-3.98.4.tar.gz
tar xjvf essential-20061022.tar.bz2; \ tar xzvf flvtool2_1.0.5_rc6.tgz; \ tar xzvf lame-3.98.4.tar.gz; \ tar xzvf ruby-1.9.1-p0.tar.gz
mkdir /usr/local/lib/codecs/ mv essential-20061022/* /usr/local/lib/codecs/ chmod -R 755 /usr/local/lib/codecs/
yum install subversion ncurses-devel automake autoconf libtool* neon neon-devel
no suitable perl(URI) was found for subversion
. If so, run the following and then re-run the yum command above without subversion:wget http://subversion.tigris.org/downloads/subversion-1.5.9.tar.bz2 tar xjvf subversion-1.5.9.tar.bz2 cd subversion-1.5.9 && ./configure --with-apr=/usr/local/apache/bin/ --with-apr-util=/usr/local/apache/bin/ --with-ssl --disable-mod-activation make && make install cd ..
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
/etc/ld.so.conf
and add /usr/local/lib
then run:ldconfig -v
cd /usr/local/src/ruby-1.9.1-p0 ./configure make && make install cd /usr/local/src/lame-3.98.4 ./configure make && make install cd /usr/local/src/flvtool2_1.0.5_rc6 ruby setup.rb config && ruby setup.rb setup && ruby setup.rb install cd /usr/local/src/mplayer ./configure --yasm='' make && make install
rpm -ivh http://kernel.org/pub/software/scm/git/RPMS/i386/git-core-1.5.4.2-1.i386.rpm \ http://kernel.org/pub/software/scm/git/RPMS/i386/perl-Git-1.5.4.2-1.i386.rpm \ http://packages.sw.be/perl-Error/perl-Error-0.17016-1.el5.rf.noarch.rpm
cd /usr/local/src/ffmpeg ./configure --enable-libmp3lame --disable-mmx --enable-shared make && make install
./configure --help
if you'd like to enable additional libraries/codecs. Many will require additional downloads & builds like those above. Note that after each library/codec install, you'll need to run ldconfig -v
.ln -s /usr/local/lib/libavformat.so.50 /usr/lib/libavformat.so.50; \ ln -s /usr/local/lib/libavcodec.so.52 /usr/lib/libavcodec.so.52; \ ln -s /usr/local/lib/libavdevice.so.52 /usr/lib/libavdevice.so.52; \ ln -s /usr/local/lib/libavutil.so.50 /usr/lib/libavutil.so.50; \ ln -s /usr/local/lib/libmp3lame.so.0 /usr/lib/libmp3lame.so.0; \ ln -s /usr/local/lib/libavformat.so.52 /usr/lib/libavformat.so.52; \ ln -s /usr/local/lib/libswscale.so.0 /usr/lib/libswscale.so.0
cd /usr/local/src/ wget "http://downloads.sourceforge.net/project/ffmpeg-php/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2?use_mirror=garr" tar xjvf ffmpeg-php-0.6.0.tbz2 cd ffmpeg-php-0.6.0 phpize ./configure make && make install
cp /usr/local/include/libavcodec/* /usr/local/include/ffmpeg; \ cp /usr/local/include/libavutil/* /usr/local/include/ffmpeg; \ cp /usr/local/include/libavformat/* /usr/local/include/ffmpeg; \ cp /usr/local/include/libavdevice/* /usr/local/include/ffmpeg; \ cp /usr/local/include/libswscale/* /usr/local/include/ffmpeg
;ffmpeg-php extension extension=ffmpeg.so
/etc/init.d/httpd restart
ps auxf|grep http root 5684 0.0 0.0 66064 5052 ? Ss Sep15 0:49 /usr/local/apache/bin/httpd -k start -DSSL nobody 17175 0.0 0.0 66340 4836 ? S 15:32 0:00 \_ /usr/local/apache/bin/httpd -k start -DSSL nobody 17176 0.0 0.0 66344 4768 ? S 15:32 0:00 \_ /usr/local/apache/bin/httpd -k start -DSSL
php -i|grep ffmpeg ffmpegffmpeg support (ffmpeg-php) => enabled ffmpeg-php version => 0.6.0 ffmpeg.allow_persistent => 0 => 0
That's it! Your PHP installation will not have the ability to use ffmpeg functions!