Install FFMPEG and all its modules FFMPEG-PHP on Linux

1.Create a new Directory under the src folder 

mkdir /usr/local/src/ffmpeg
cd /usr/local/src/ffmpeg

2.Download all the Sources 

3.Uncompress 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

4.Create the new codecs directory and move the codecs 
mkdir /usr/local/lib/codecs/
mv essential-20061022/* /usr/local/lib/codecs/
chmod -R 755 /usr/local/lib/codecs/

5.Install SVN and Ruby 
yum install subversion
yum install ruby
yum install ncurses-devel

6.Download the latest FFMPEG and Mplayer from the subversion 
svn checkout svn:// ffmpeg
svn checkout svn:// mplayer

7.Compile LAME 
cd /usr/local/src/ffmpeg/lame-3.97
make install

8.Compile libOGG 
cd /usr/local/src/ffmpeg/libogg-1.1.3
make install

9.Compile libVorbis 
cd /usr/local/src/ffmpeg/libvorbis-1.1.2
make install

10.Compile flvtool2 
cd /usr/local/src/ffmpeg/flvtool2_1.0.5_rc6
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install

11.Compile MPlayer 
cd /usr/local/src/ffmpeg/mplayer
make install

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

13.Create symblinks 
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/

14.Compile FFMPEG-PHP 
cd /usr/local/src/ffmpeg/ffmpeg-php-0.5.0
make install

15.Install FFMPEG-PHP (make sure the php.ini path is correct.)

Get correct php.ini path add the extesion Usually it is given as and the extension_dir=/usr/local/lib/php/extensions/

Make sure that the is in /usr/local/lib/php/extensions/
echo ‘extension=/usr/local/lib/php/extensions/no-debug-non-zts-20020429/’>>

Or the best way is to check the path for extension_dir in php.ini Then locate the file Copy the file to extension_dir and add the line

in php.ini

16.Restart Apache to load FFMPEG-PHP 
service httpd restart

17.Verify the installation 
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

Then everything is installed and working. FFMPEG, FFMPEG-PHP, MPlayer, MEncoder, flv2tool, LAME MP3 encoder & libOGG.

Leave a comment

Leave your opinion

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

  • Recent Posts

  • Advertisements
%d bloggers like this: