How to Install requirements on CENTos/debian:

This guide tell you how to install FFmpeg, FLVTOOL2 and all codec you need. It’s pretty easy if you know some basic linux.

Step 1: Create a directory to do our work in
mkdir ~/ffmpeg
cd ~/ffmpeg

Step 2: Get all the source files
wget essential-20061022.tar.bz2
wget flvtool2_1.0.5_rc6.tgz
wget lame/lame-3.97.tar.gz
wget ffmpeg-php/ffmpeg-php-0.5.0.tbz2
wget ogg/libogg-1.1.3.tar.gz
wget vorbis/libvorbis-1.1.2.tar.gz

Step 3: Extract all the source files
bunzip2 essential-20061022.tar.bz2; tar xvf essential-20061022.tar
tar zxvf flvtool2_1.0.5_rc6.tgz
tar zxvf lame-3.97.tar.gz
bunzip2 ffmpeg-php-0.5.0.tbz2; tar xvf ffmpeg-php-0.5.0.tar
tar zxvf libogg-1.1.3.tar.gz
tar zxvf libvorbis-1.1.2.tar.gz

Step 4: Create the codecs directory & import them
mkdir /usr/local/lib/codecs/
mv essential-20061022/* /usr/local/lib/codecs/
chmod -R 755 /usr/local/lib/codecs/

Step 5: Install SVN/Ruby (Depends on OS, this is for RHEL/CentOS)
yum install subversion
yum install ruby
yum install ncurses-devel

Step 6: Get the latest FFMPEG/MPlayer from the subversion
svn checkout svn:// ffmpeg
svn checkout svn:// mplayer

Step 7: Compile LAME
cd ~/ffmpeg/lame-3.97
make install

Step 8: Compile libOGG
cd ~/ffmpeg/libogg-1.1.3
make install

Step 9: Compile libVorbis
cd ~/ffmpeg/libvorbis-1.1.2
make install

Step 10: Compile flvtool2
cd ~/ffmpeg/flvtool2_1.0.5_rc6
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install

Step 11: Compile MPlayer
cd ~/ffmpeg/mplayer
make install

Step 12: Compile FFMPEG
cd ~/ffmpeg/ffmpeg
./configure –enable-libmp3lame –enable-libogg –enable-libvorbis –disable-mmx –enable-shared
echo ‘#define HAVE_LRINTF 1′ >> config.h
make install

Step 13: Finalize the codec setups
ln -s /usr/local/lib/ /usr/lib/
ln -s /usr/local/lib/ /usr/lib/
ln -s /usr/local/lib/ /usr/lib/
ln -s /usr/local/lib/ /usr/lib/
ln -s /usr/local/lib/ /usr/lib/

Step 14: Compile FFMPEG-PHP
cd ~/ffmpeg/ ffmpeg-php-0.5.0
make install

Step 15: Install FFMPEG-PHP (make sure the php.ini path is correct.)
echo ‘extension=/usr/local/lib/php/extensions/ no-debug-non-zts-20020429/’ >> /usr/local/Zend/etc/php.ini

Step 16: Restart Apache to load FFMPEG-PHP (Depends on OS, this is for RHEL/CentOS)
service httpd restart

Step 17: Verify if it works
php -r ‘phpinfo();’ | grep ffmpeg

If you get a few lines such as
ffmpeg support (ffmpeg-php) => enabled
ffmpeg-php version => 0.5.0
ffmpeg.allow_persistent => 0 => 0

Leave a comment

You must be logged in to post a comment.