Chicago Based WordPress, Web Hosting and Website Development

Need help with your website? Give Us a Call: 773.634.9792

Installing ffmpeg on Centos Cpanel server

ssh into the server using the root password for the server.
copy all the lines following

cd /usr/local/src

wget http://www3.mplayerhq.hu/MPlayer/releases/codecs/essential-20061022.tar.bz2
wget http://rubyforge.org/frs/download.php/9225/flvtool2_1.0.5_rc6.tgz
wget http://easynews.dl.sourceforge.net/sourceforge/lame/lame-3.97.tar.gz
wget http://downloads.sourceforge.net/project/ffmpeg-php/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2
wget http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.1.2.tar.gz
wget http://www3.mplayerhq.hu/MPlayer/releases/codecs/essential-20061022.tar.bz2
wget http://ftp.penguin.cz/pub/users/utx/amr/amrnb-6.1.0.4.tar.bz2

bunzip2 amrnb-6.1.0.4.tar.bz2
tar zxvf flvtool2_1.0.5_rc6.tgz
tar zxvf lame-3.97.tar.gz
tar zxvf libogg-1.1.3.tar.gz
tar zxvf libvorbis-1.1.2.tar.gz
bunzip2 essential-20061022.tar.bz2
tar jxvf ffmpeg-php-0.6.0.tbz2

sed -i -e’s/^exclude=.*//’ /etc/yum.conf; yum update
mkdir /usr/local/lib/codecs/
mv essential-20061022/* /usr/local/lib/codecs/

yum install subversion
yum install ruby
yum install ncurses-devel

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

Fix few Lib issues for next steps
Add this line in /etc/ld.so.conf via pico /etc/ld.so.conf
/usr/local/lib
then run
ldconfig -v

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

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

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

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

Compile MPlayer
cd /usr/local/src/mplayer
./configure
make
make install

Compile AMR for 3gp conversion
cd /usr/local/src/amrnb-6.1.0.4
./configure
make
make install

Compile FFMPEG
mkdir /usr/local/temp
chmod 777 /usr/local/temp
cd /usr/local/src/ffmpeg
./configure –enable-libmp3lame –enable-libvorbis –disable-mmx –enable-shared
make
make install

Finalize the codec setups
ln -s /usr/local/lib/libavformat.so.50 /usr/lib/libavformat.so.50
ln -s /usr/local/lib/libavcodec.so.51 /usr/lib/libavcodec.so.51
ln -s /usr/local/lib/libavutil.so.49 /usr/lib/libavutil.so.49
ln -s /usr/local/lib/libmp3lame.so.0 /usr/lib/libmp3lame.so.0
ln -s /usr/local/lib/libavformat.so.51 /usr/lib/libavformat.so.51
ln -s /usr/local/lib/libamrnb.so.2 /usr/lib/libamrnb.so.2

Few tasks before compiling FFMPEG-PHP
yum install automake
yum install autoconf
yum install libtool

Compile FFMPEG-PHP
cd /usr/local/src/ffmpeg-php-0.5.0
phpize
./configure
make
make install
nano /usr/local/lib/php.ini
add

service httpd restart

To verify that the above things do work

You can test it like this

ldd ./ffmpeg
php -i | grep -i ffmpeg

If it returns this message

ffmpeg
ffmpeg support (ffmpeg-php) => enabled
ffmpeg-php version => 0.5.0
ffmpeg.allow_persistent => 0 => 0

Then its done :)

Live Help

Search Our Site