Category Archives: installing ffmpeg

How To Install FFmpeg, Mplayer, Mencoder, FFmpeg-PHP on a CentOS server

I tried first to use the installer of ScriptMantra but for some reason there were errors sometimes the Liba52, sometimes the Mplayer were not installed, so I just gave up and used the autoinstaller just to remove all traces of ffmpeg on the server, then I used the yum to install it, it was quicker and everything was installed, lets go step by step then.

Install ffmpeg, mplayer, mencoder with all supported modules.

# yum -y install ffmpeg ffmpeg-devel mplayer mencoder flvtool2

it will download everything to your server and install it, depending on your server connection to the internet, but on my server it was very quick perhaps 10 minutes.

Install FFMPEG-PHP

ffmpeg-php is an extension for PHP that adds an easy to use, object-oriented API for accessing and retrieving information from video and audio files. ffmpeg-devel and php-devel is needed to compile ffmpeg-php from source code. Use following steps to install ffmpeg-php

# cd /usr/src
# wget http://downloads.sourceforge.net/project/ffmpeg-php/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2?use_mirror=ignum
# tar jxvf ffmpeg-php-0.6.0.tbz2
# cd ffmpeg-php-0.6.0
# phpize
# ./configure
# make
# make install

It will copy the ffmpeg.so module in php default module location. Now you have to edit php.ini file to enable ffmpeg-php support in it by using ffmpeg.so module.

Go to your server php.ini normally it should be on /usr/local/lib and add the following line at the bottom:

extension=ffmpeg.so

Restart Apache, you can use the WHM or enter the command in shell

# /etc/init.d/httpd restart

Now run following command to ffmpeg module listing in php.

#php -m | grep ffmpeg

Thats it! Easy no?