Video Codecs Installations: MPlayer+flvtool2+lame+ffmpeg-php+libogg+libvorbis

wordpress Hosting

 Get all the source files
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://sourceforge.net/projects/ffmpeg-php/files/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2/download
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

 Extract all the source files
bunzip2 essential-20061022.tar.bz2; tar xvf essential-20061022.tar
tar zxvf flvtool2_1.0.5_rc6.tgz
tar zxvf lame-3.97.tar.gz
bunzip2 ffmpeg-php-0.5.0.tbz2; tar xvf ffmpeg-php-0.5.0.tar
tar zxvf libogg-1.1.3.tar.gz
tar zxvf libvorbis-1.1.2.tar.gz

 Create the codecs directory & import them
mkdir /usr/local/lib/codecs/
mv essential-20061022/* /usr/local/lib/codecs/
chmod -R 755 /usr/local/lib/codecs/

 install SVN/Ruby (Depends on OS, this is for RHEL/CentOS)
yum install subversion
yum install ruby
yum install ncurses-devel

Get the latest FFMPEG/MPlayer from the subversion
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer

 Compile LAME
cd /root/download/lame-3.97
./configure
make
make install

 Compile libOGG
cd /root/download/libogg-1.1.3
./configure
make
make install

Compile libVorbis
cd /root/download/libvorbis-1.1.2
./configure
make
make install

 Compile flvtool2
cd /root/download/flvtool2_1.0.5_rc6
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install

 Compile MPlayer
cd /root/download/mplayer
./configure
make
make install

 Compile FFMPEG
cd /root/download/ffmpeg
./configure –enable-libmp3lame –enable-libvorbis –disable-mmx –enable-shared  –enable-gpl
echo ‘#define HAVE_LRINTF 1’ >> config.h
make
make install

Configuration files

 Changed php.ini file:
safe_mode = off
max_execution_time = 1000 (recommended to prevent timeouts during video upload/conversion)
session.gc_maxlifetime = 14000 (recommended to prevent session expires during video upload)
open_basedir = (no value)
output_buffering = on
upload_max_filesize = 100M (recommended maximum video upload size in MB)
post_max_size = 100M (recommended maximum video upload size in MB)

 Changed httpd.conf
Timeout 500000

 Changed my.cnf
wait_timeout=28800
connect_timeout=28800
max_allowed_packet=150M

 Changed /etc/ld.so.conf
added the following line: /usr/local/lib

ln -s /usr/local/lib/libavdevice.so.52
ln -s /usr/local/lib/libavformat.so.52
ln -s /usr/local/lib/libavcodec.so.51
ln -s /usr/local/lib/libavutil.so.49
ln -s /usr/local/lib/libmp3lame.so.0
ln -s /usr/local/lib/libvorbisenc.so.2
ln -s /usr/local/lib/libvorbis.so.0
ln -s /usr/local/lib/libogg.so.0


Cpanel Hosting