Install FFMPEG


Atomic Repo 
( Because we are going to install a bunch of apps and modules and your default repo probably don’t have it at all )
#wget -q -O - http://www.atomicorp.com/installers/atomic | sh

Install git ( We will need it for installing the “x264″ library )

Add repository

#rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm

Install the latest version of git
#yum install --enablerepo=webtatic git-all

If not working try the below ( If you are installing it under cPanel system. You will get some dependency error and that is because cPanel by default have some packages in “yum exclude” list )
#yum --disableexcludes=main --enablerepo=webtatic install git-all

Make our system ready
#yum install pkgconfig nasm gcc.x86_64 gcc-c++.x86_64 php-gd.x86_64 ruby php-devel.x86_64
Note : If your system is 32bit. Remove that “.x86_64″ from the above packages.

Let’s start the installation:
#mkdir /opt/FFMPEG; cd /opt/FFMPEG
Download:
( If some links are not working, try to download from other available links for the packages. :)

#svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
or
#svn checkout svn://svn.mplayerhq.hu/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://voxel.dl.sourceforge.net/project/libdc1394/libdc1394-2/2.2.0/libdc1394-2.2.0.tar.gz
#wget http://nchc.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


Download x264
#git clone git://source.ffmpeg.org/x264.git
Do not try unless git doesn't work out 
ftp://ftp.videolan.org/pub/x264/snapshots/last_x264.tar.bz2
#git clone http://git.chromium.org/webm/libvpx.git

Untar the packages
#tar -xvf *.bz2&& tar -xvf *.tbz2&& tar -xvf *.bz2

Configure the supporting modules and applications:
Install Yasam
#cd yasm-1.2.0
#./configure
#make
#make install

Setting up Mplayer codec
#cd ..
#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/
Configure x264
#cd x264 
#./configure --enable-shared 
#make 
#make install 
cd ..

If git not working. download this and compile :
wget ftp://ftp.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20080630-2245.tar.bz2

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

Configure Lame
#cd lame-3.99.5
#./configure
#make
#make install
#cd .. 

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

Configure Faad
#cd faad2-2.7
#./configure
#make
#make install
#cd .. 

Configure Faac
#cd faac-1.28
#./configure
#make
#make install
#cd .. 

Configure Libraw
#cd libraw1394-2.0.5
#./configure
#make
#make install
#cd .. 

Configure Libdc
#cd libdc1394-2.2.0
#./configure
#make
#make install
#cd .. 

Configure OpencoreAMR
#cd opencore-amr-0.1.3
#./configure
#make
#make install
#cd ..  

Configure Libogg
#cd libogg-1.3.0
#./configure
#make
#make install
#cd ..
#echo /usr/local/lib >> /etc/ld.so.conf; ldconfig 


Configure Libvorbis
#cd libvorbis-1.3.3
#./configure
#make
#make install
#cd .. 

Configure Libtheora
#cd libtheora-1.1.1
#./configure
#make
#make install
#cd .. 

Configure Flvtools
#cd flvtool2-1.0.6
#ruby setup.rb config
#ruby setup.rb setup
#ruby setup.rb install 

Configure OPenJPEG
#cd openjpeg-1.5.0
#./configure
#make
#make install
#cd .. 

Configuree MP4box
#yum install freetype-devel.x86_64 SDL-devel.x86_64 freeglut-devel.x86_64

Note : If your system is 32bit. Remove that “.x86_64″ from the above packages.
#export LD_LIBRARY_PATH=/usr/local/lib/echo /usr/local/lib > /etc/ld.so.conf.d/custom-libs.conf
#ldconfig

Configure ffmpeg
#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

( When configuring if you get some errors regarding unsupported features, remove that from the above and recompile. Also so let me know the error and we will find a solution )
#make
#make install

Configure FFMPEG-PHP module
#cd ffmpeg-php-0.6.0

Note: For version 0.6.0 copy & paste each line given below separately to fix a typo in the framer function:
#vi ffmpeg_frame.c
:%s/PIX_FMT_RGBA32/PIX_FMT_RGB32
:wq
Now continue with the compilation.
#phpize
#./configure
#make
#make install
#cd ..

Add the module details in the php.ini file. Your php.ini may be somewhere else.
Find it by running the below command:
#php -i | grep php.ini
#vim php.ini

Add the line:
extension=ffmpeg.so

Restart Apache:
 #/etc/init.d/httpd restart

Install Mplayer
#./configure
#make
#make install
Verify the working

Verify the working
#ffmpegphp -i | grep ffmpeg
#php -m | grep ffmpeg
#which ffmpeg
#which lame
#which mencoder
#which mplayer
#which faac
#which faad
#which x264
#which a52dec
#which flvtool2


:)

No comments:

Post a Comment