ABHIONLINUX
Site useful for linux administration and web hosting

2011/09/19

ffmpeg-php installation

Download the latest ffmpeg-php. You can download it using

# wget http://sourceforge.net/projects/ffmpeg-php/files/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2/download
# tar -xvjf ffmpeg-php-0.6.0.tbz2
# phpize
# ./configure --enable-shared
# make
# make install

Once the installation is completed, you need to add the ffmpeg.so file in your php.ini

Locate you php.ini using
#  php -i | grep php.ini
Configuration File (php.ini) Path => /usr/local/lib
Loaded Configuration File => /usr/local/lib/php.ini

# vi /usr/local/lib/php.ini

add the following line to your php.ini file.
extension=”ffmpeg.so”

restart apache
#/etc/init.d/http restart

You can check the ffmpeg-php module using the command


# php -m | grep ffmpeg
ffmpeg


Common issues in installing ffmpeg-php
1. While running make, you will get an error
make: *** [ffmpeg_frame.lo] Error 1

Fix: Copy the file ffmpeg_frame.loT to ffmpeg_frame.lo
#cp ffmpeg_frame.loT ffmpeg_frame.lo
This should fix the above issue.

2. After enabling ffmpeg in php.ini, you can get an error 
php: symbol lookup error: /usr/local/lib/php/extensions/no-debug-non-zts-
20060613/ffmpeg.so: undefined symbol: register_ffmpeg_frame_class

Fix : Goto ffmpeg-php installation folder and open the file ffmpeg_frame.c and replace  all
PIX_FMT_RGBA32 with  PIX_FMT_RGB32

cd /usr/local/src/ffmpeg-php
# vi ffmpeg_frame.c
:%s/PIX_FMT_RGBA32/PIX_FMT_RGB32

:wq!

then you need to compile ffmpeg

#./configure --enable-shared
#make
#make install


Hope this will help you in installing ffmpeg-php in your server.

flvtool2




wget http://rubyforge.org/frs/download.php/17497/flvtool2-1.0.6.tgz
cd /usr/local/src/flvtool2-1.0.6/
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install

create db and user in mysql

mysql -u root -p
mysql> create database db;
Query OK, 1 row affected (0.00 sec)


mysql> grant all privileges on amarokdb.* to amarokuser@localhost  identified by 'passwd';
Query OK, 0 rows affected (0.00 sec)

FFmpeg installation

Installing a52

wget http://liba52.sourceforge.net/files/a52dec-0.7.4.tar.gz
# tar -zxf a52dec-0.7.4.tar.gz
# cd a52dec-0.7.4
# ./configure --enable-shared=PKGS
# make
# make install



# wget http://sourceforge.net/projects/faac/files/faac-src/faac-1.28/faac-1.28.tar.gz/download
# tar -xvzf faac-1.28.tar.gz
# ./bootstrap
#  ./configure
# make
# make install
# cd ..

installing  faad
 # wget http://sourceforge.net/projects/faac/files/faad2-src/faad2-2.7/faad2-2.7.tar.gz/download
 # tar -xvzf faad2-2.7.tar.gz
]#  autoreconf -vif
# ./configure --disable-drm --disable-mpeg4ip
# make
# make install

installing lame:
# wget http://sourceforge.net/projects/lame/files/lame/3.98.4/lame-3.98.4.tar.gz/download
# tar -xvzf lame-3.98.4.tar.gz
# ./configure
# make
# make install
intall yasm
# wget http://www.tortall.net/projects/yasm/releases/yasm-1.1.0.tar.gz
# tar -xvzf yasm-1.1.0.tar.gz
]# ./configure
#make
# make install

x264
git clone git://git.videolan.org/x264.git
./configure --enable-shared --prefix=/usr
make
make install

xvidcore
wget http://downloads.xvid.org/downloads/xvidcore-1.3.2.tar.gz
 tar -xvzf xvidcore-1.3.2.tar.gz
 cd build/generic/
./configure
make
make install


./configure
make
make install

libraw installation


wget http://sourceforge.net/projects/libraw1394/files/libraw1394/libraw1394-2.0.5.tar.gz/download
 tar -xvzf libraw1394-2.0.5.tar.gz
./configure 
make
make install

wget http://sourceforge.net/projects/libdc1394/files/libdc1394-2/2.1.2/libdc1394-2.1.2.tar.gz/download
./configure
make
make install


wget http://sourceforge.net/projects/opencore-amr/files/opencore-amr/0.1.2/opencore-amr-0.1.2.tar.gz/download
./configure
make
make install

echo y | cp * /usr/local/lib/codecs/
 echo y | cp * /usr/local/lib64/codecs/

libogg
 wget http://downloads.xiph.org/releases/ogg/libogg-1.3.0.tar.gz
./configure
make 
make install

libvorbis
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.2.tar.gz
./configure
make
make install

wget http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.gz
tar -xvzf libtheora-1.1.1.tar.gz
./configure
make
make isntall

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

yum install dirac dirac-devel


./configure --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvpx --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 --extra-cflags=-fPIC






2011/09/16

MP4Box installation


Follow the steps given below to install MP4Box

#cd /usr/local/src/
# wget http://nchc.dl.sourceforge.net/project/gpac/GPAC/GPAC%200.4.5/gpac-0.4.5.tar.gz
# wget http://nchc.dl.sourceforge.net/project/gpac/GPAC%20extra%20libs/GPAC%20extra%20libs%200.4.5/gpac_extra_libs-0.4.5.tar.gz
# tar -zxvf gpac-0.4.5.tar.gz
# tar -zxvf gpac_extra_libs-0.4.5.tar.gz
# cd gpac_extra_libs
# cp -r * /usr/local/src/gpac/extra_lib
# cd gpac
# chmod 755 configure
# ./configure
# make lib
# make apps
# make install lib
# make install
# cp bin/gcc/libgpac.so /usr/lib

# which MP4Box
/usr/local/bin/MP4Box