How to install ffmpeg, mplayer, mencoder, ffmpeg-php on centos 5.x

13. November 2011 SysAdmin 0

>

In this how to i will describe how to install ffmpeg, mplayer, mencoder, flvtool2, ffmpeg-php with all supported codecs to convert / manipulate videos easily on CentOS 5.x. If you want to run sites like youtube e.g www.indianpad.in, www.danceindiadance.in this howto will help you to install the base for your software. There are many other way to perform this but this works for me, so i want to share.

###

RPMForge repository (http://dag.wieers.com) is the biggest rpm respository for RHEL, CentOS for all versions. To enable RPMForge respository run following command to install all necessary files for getting RPMForge repository. The following command directly install rpm from http://da.wieers.com site.
For i386/i686

>

rpm -Uhv [http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm](http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm)
For x86_64

>

rpm -Uhv [http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm](http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm)
This rpm will add necessary files in our repository configuration and can be viewed at **/etc/yum.repos.d/rpmforge.repo**

###

Now we have rpmforge repository, so we will use yum to install ffmpeg, mplayer, mencoder as well as all dependent software.

>

yum -y install ffmpeg ffmpeg-devel mplayer mencoder flvtool2
This command will some time to download and install all packages depends on your internet speed.

###

ffmpeg-php is an extension for [PHP](http://www.php.net/) 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://garr.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.6.0.tbz2
> tar jxvf ffmpeg-php-0.6.0.tbz2
> cd ffmpeg-php-0.6.0
> phpize
> ./configure

After runing ./configure in ffmpeg-php0.6.0, Please fix the Typo 


vi ffmpeg_frame.c
:%s/PIX_FMT_RGBA32/PIX_FMT_RGB32
:wq 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.

>

vi /etc/php.ini
and append following line

>

extension=ffmpeg.so
Restart apache service to take effect of php.ini

>

/etc/init.d/httpd restart
Run following command to ffmpeg module listing in php.

>

php -m | grep ffmpeg
Have a nice streaming. ![:)](http://www.sohailriaz.com/wp-includes/images/smilies/icon_smile.gif)

Leave a Reply

Your email address will not be published.