How to Install ffmpeg ffmpeg-php CentOS with Cpanel

Posted: 2p in Linux
Tags:

ffmpeg-logo-300x73
Install ffmpeg ffmpeg-php CentOS with Cpanel

FFMPEG is an open source application that allows you to convert video and audio files easily between a variety of different formats. It supports most industry-standard codec and can convert from one file format to another quickly and easily. This guide is intented for the installatiion of ffmpeg, ffmpeg-php, mplayer, mencoder, lame mp3 encoder, flvtool2, libVorbis, and libogg and tested on CentOS 5 with Cpanel.

Atomic Repo

wget -q -O – http://www.atomicorp.com/installers/atomic |sh
rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm

# mkdir -p /usr/local/src/FFMPEG
# cd /usr/local/src/FFMPEG

yum install subversion
yum install ruby
yum install ncurses-devel
yum install nasm
yum install yasm
yum install gcc*

svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
wget http://www.mplayerhq.hu/MPlayer/releases/codecs/essential-20071007.tar.bz2
wget http://rubyforge.org/frs/download.php/17497/flvtool2-1.0.6.tgz
wget http://nchc.dl.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz
wget http://garr.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.6.0.tbz2
wget http://downloads.xvid.org/downloads/xvidcore-1.3.2.tar.gz
wget http://liba52.sourceforge.net/files/a52dec-0.7.4.tar.gz
wget http://nchc.dl.sourceforge.net/project/faac/faad2-src/faad2-2.7/faad2-2.7.tar.gz
wget http://nchc.dl.sourceforge.net/project/faac/faac-src/faac-1.28/faac-1.28.tar.gz
wget http://nchc.dl.sourceforge.net/project/libraw1394/libraw1394/libraw1394-2.0.5.tar.gz
wget http://space.dl.sourceforge.net/project/libdc1394/libdc1394-2/2.2.0/libdc1394-2.2.0.tar.gz
wget http://space.dl.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-0.1.3.tar.gz
wget http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2
wget http://downloads.xiph.org/releases/ogg/libogg-1.3.0.tar.gz
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.3.tar.gz
wget http://www1.mplayerhq.hu/MPlayer/releases/MPlayer-1.0rc4.tar.gz
wget http://openjpeg.googlecode.com/files/openjpeg-1.5.0.tar.gz

tar -xvf essential-20071007.tar.bz2 && tar -xvf flvtool2-1.0.6.tgz && tar -xvf lame-3.99.5.tar.gz && tar -xvf ffmpeg-php-0.6.0.tbz2 && tar -xvf xvidcore-1.3.2.tar.gz && tar -xvf a52dec-0.7.4.tar.gz && tar -xvf faad2-2.7.tar.gz && tar -xvf faac-1.28.tar.gz && tar -xvf libraw1394-2.0.5.tar.gz && tar -xvf libdc1394-2.2.0.tar.gz && tar -xvf opencore-amr-0.1.3.tar.gz && tar -xvf libtheora-1.1.1.tar.bz2 && tar -xvf libogg-1.3.0.tar.gz && tar -xvf libvorbis-1.3.3.tar.gz && tar -xvf MPlayer-1.0rc4.tar.gz && tar -xvf yasm-1.2.0.tar.gz && tar -xvf openjpeg-1.5.0.tar.gz && tar -xvf yasm-1.2.0.tar.gz && tar -xvf openjpeg-1.5.0.tar.gz

mkdir /usr/local/lib/codecs/
cp ./essential-20071007/* /usr/local/lib/codecs/
chmod -R 755 /usr/local/lib/codecs/
##############
# For 64 Bit Systems ALSO do this:
#
mkdir /usr/local/lib64/codecs/
cp ./essential-20071007/* /usr/local/lib64/codecs/
chmod -R 755 /usr/local/lib64/codecs/
##############

cd /usr/local/src/FFMPEG
wget http://www.tortall.net/projects/yasm…m-1.0.1.tar.gz
tar zfvx yasm-1.0.1.tar.gz
cd yasm-1.0.1
./configure
make && make install
yasm –version
cd ..

LIBOGG

cd /opt/FFMPEG/libogg-1.1.3
./configure –enable-shared && make && make install
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH
cd ..

MPLAYER

cd MPlayer-1.0rc3
./configure
&& make &&
make install
cd ..

cd x264
./configure –enable-shared
make
make install
cd ..

cd xvidcore/build/generic
./configure
make
make install
cd ../../../

cd lame-3.98.4
./configure
make
make install
cd ..

cd a52dec-0.7.4
./configure –enable-shared=PKGS
make
make install
cd ..

cd faad2-2.7
autoreconf -vif
./configure
make
make install
cd ..

cd flvtool2-1.0.6
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install

cd faac-1.28
./bootstrap
./configure
make
make install
cd ..

cd libraw1394-2.0.5
./bootstrap
./configure
make
make install
cd ..

cd libdc1394-2.1.2
./configure
make
make install
cd ..

cd opencore-amr-0.1.2
./configure
make
make install
cd ..

cd libogg-1.1.4
./configure
make
make install
cd ..

cd libvorbis-1.2.3
./configure
make
make install
cd ..

cd libtheora-1.1.1
./configure
make
make install
cd ..

export LD_LIBRARY_PATH=/usr/local/lib/
echo /usr/local/lib > /etc/ld.so.conf.d/custom-libs.conf
ldconfig

cd ffmpeg
# ./configure –enable-version3 –enable-libopencore-amrnb –enable-libopencore-amrwb –enable-libfaac –enable-libmp3lame –enable-libtheora –enable-libvorbis –enable-libx264 –enable-libxvid –disable-ffplay –enable-shared –enable-gpl –enable-postproc –enable-nonfree –enable-avfilter –enable-pthreads –enable-libopenjpeg

make
make install
cd ..

ldconfig

*****************************************************
# The following is to add ffmpeg-php if you need that
#
#
cd ffmpeg-php-0.6.0
*****************************************************
# For version 0.6.0 fix a typo in the framer function:
# Copy & Paste each line seperately

vi ffmpeg_frame.c

:%s/PIX_FMT_RGBA32/PIX_FMT_RGB32

:wq
*****************************************************
phpize
./configure
make
make install
cd ..

*****************************************************
#
# your php.ini may be somewhere else:
#
vi /etc/into php.ini
# add the line:
extension=ffmpeg.so

:wq
*****************************************************
/etc/rc.d/init.d/httpd restart

Testing FFmpeg

Verify that FFmpeg is working properly by running the following:

php -m | grep ffmpeg
php -i | grep ffmpeg
php -r ‘phpinfo();’ | grep ffmpeg

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s