ffmpeg ffmpeg-php mplayer mencoder flv2tool libogg libvorbis lame

How to install all the needed dependencies for ClipShare or other flash video conversion scripts.

It assumes you already have Apache and PHP5 installed as those are required dependencies as well. There will also be a guide up for installing PHP5.2.6 from source on CentOS/RHEL soon.

First install subversion and ruby via yum or up2date:

yum -y install subversion ruby

Necessary packages for ffmpeg and ffmpeg-php Install - First run the command uname to find the arch

uname -i
x86_64

Then download rpmforge-release

rpm -Uhv http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm
yum clean all
yum update
yum install ffmpeg ffmpeg-devel
yum install mplayer mencoder
yum install gcc gmake make libcpp libgcc libstdc++ gcc4 gcc4-c++ gcc4-gfortran
yum install subversion ruby ncurses-devel ruby-libs
yum install flvtool2*

 

Run svn checkout:

svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
cd /usr/local/src/mplayer
svn update
cd /usr/local/src

 

Copy codecs for mplayer:

mv /usr/local/src/essential-20061022/* /usr/local/lib/codecs/
chmod -R 755 /usr/local/lib/codecs/

 

If you are using secure tmp:

mkdir /usr/local/src/tmp
chmod 777 /usr/local/src/tmp
export TMPDIR=/usr/local/src/tmp

 

For ffmpeg-php

wget http://downloads.sourceforge.net/project/ffmpeg-php/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2?use_mirror=nchc
tar -xjf ffmpeg-0.5.2.1.tbz2
phpize
./configure
make
make install

Comments

enable extension=ffmpeg.so

You can do php -i | grep -i ini to find the proper location.

Change the extension_dir value as seen below and add the extension as seen below:

extension_dir = "/usr/local/lib/php/extensions/"
extension=ffmpeg.so

Now save and restart apache and test php for ffmpeg on both apache via phpinfo() and from shell:

service httpd restart
php -i | grep -i ffmpeg