Deru Knowledgebase
Search:     Advanced search
Browse by category:
Contact Us

Steps to install FFMPEG as an module in PHP

Add comment
Views: 860
Votes: 0
Comments: 0
Posted: 14 Aug, 2009
by: Nini E.
Updated: 27 Aug, 2010
by: Joseph S.
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. It has methods for returning frames from movie files as images that can be manipulated using PHP's image functions. This works well for automatically creating thumbnail images from movies. FFMPEG-PHP is also useful for reporting the duration and bit-rate of audio files (mp3, wma...). FFMPEG-PHP can access many of the video formats supported by FFMPEG (mov, avi, mpg, wmv...)

The following step shows the installation of FFMPEG using RPM. You can follow the steps below to add it with PHP as a module.
NOTE : You should have root privilege for doing this.

For installing FFMPEG, do the following steps:

   1. cd /root
   2. wget http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
   3. rpm -vi rpmforge-release-0.3.6-1.el5.rf.i386.rpm
   4. rm -f /root/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
   5. yum -y install ffmpeg ffmpeg-devel mplayer mencoder flvtool2 libogg libvorbis lame
   6. yum clean all


Here I am using the version 0.5.3 of FFMPEG-PHP. Follow the steps to install FFMPEG-PHP:

   1. wget http://internap.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.5.3.tbz2
   2. tar jxf ffmpeg-php-0.5.3.tbz2
   3. cd ffmpeg-php-0.5.3
   4. /usr/local/bin/phpize
   5. ./configure
   6. make
   7. make install
   8. echo "extension=ffmpeg.so" >> /usr/local/lib/php.ini
   9. cd /root
  10. rm -rf ffmpeg-php-0.5.3 ffmpeg-php-0.5.3.tbz2


    At the end restart HTTP service (or apache):

            service httpd restart

    The following command will help you to check the installation of ffmpeg is correct or not:

            ffmpeg -i inputfile.avi flashfile.flv
  
    where, inputfile.avi is the input file and flashfile.flv is the output file.
Others in this Category
document Running php4 and php5 together in server
document changing php values using .htaccess
document Track the "nobody mail senders" using PHP
document Using Curl to call a URL
document use Curl to POST data to a form.
document How to use curl to get the file contents
document Fixing libxml, php bug and issues with HTML entities by downgrading libxml
document Mambo Admin "All contents Item" - join error
document How to install SSH2 for PHP Shell?
document Album access issue in Gallery
document How to install APC (Alternative PHP Cache)
document Upgrade from PHP4 to PHP5: Backward Incompatible Changes
document CAPCHA implementation in the Contact Page submission form



RSS