7.9.09

:: install ffmpeg and ffmpeg-php

:: what is
please take a look at this.

:: compile and install dependency packages
[ compile and installing yasm ]
[ linux:download ] # wget http://www.tortall.net/projects/yasm/releases/yasm-0.8.0.tar.gz
[ linux:download ] # tar -xzf yasm-0.8.0.tar.gz
[ linux:download ] # cd yasm-0.8.0/
[ linux:yasm-0.8.0 ] # ./configure
[ linux:yasm-0.8.0 ] # make && make install

[ compile and installing faad2 ]
[ linux:download ] # wget http://downloads.sourceforge.net/faac/faad2-2.7.tar.bz2
[ linux:download ] # tar -xjf faad2-2.7.tar.bz2
[ linux:download ] # cd faad2-2.7/
[ linux:faad2-2.7 ] # ./configure
[ linux:faad2-2.7 ] # make && make install

[ compile and installing faac ]
[ linux:download ] # wget http://downloads.sourceforge.net/faac/faac-1.28.tar.bz2
[ linux:download ] # tar -xjf faac-1.28.tar.bz2
[ linux:download ] # cd faac-1.28/
[ linux:faac-1.28 ] # ./configure
[ linux:faac-1.28 ] # make && make install

[ compile and installing lame ]
[ linux:download ] # wget http://sourceforge.net/projects/lame/files/lame/3.98.2/lame-398-2.tar.gz/download
[ linux:download ] # tar -xzf lame-398-2.tar.gz
[ linux:download ] # cd lame-398-2/
[ linux:lame-398-2 ] # ./configure
[ linux:lame-398-2 ] # make && make install

[ compile and installing x264 ]
[ linux:download ] # git clone git://git.videolan.org/x264.git
[ linux:download ] # cd x264/
[ linux:x264 ] # ./configure --enable-shared
[ linux:x264 ] # make && make install

[ compile and installing xvid ]
[ linux:download ] # wget http://downloads.xvid.org/downloads/xvidcore-1.2.2.tar.gz
[ linux:download ] # tar -xzf xvidcore-1.2.2.tar.gz
[ linux:download ] # cd xvidcore/build/generic/
[ linux:generic ] # ./configure
[ linux:generic ] # make && make install
[ linux:generic ] # ldconfig

[ compile and install libogg ]
[ linux:download ] # wget http://downloads.xiph.org/releases/ogg/libogg-1.1.4.tar.gz
[ linux:download ] # tar -xzf libogg-1.1.4.tar.gz
[ linux:download ] # cd libogg-1.1.4/
[ linux:libogg-1.1.4/ ] # ./configure
[ linux:libogg-1.1.4/ ] # make && make install

[ compile and installing libvorbis ]
[ linux:download ] # wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.3.tar.gz
[ linux:download ] # tar -xzf libvorbis-1.2.3.tar.gz
[ linux:download ] # cd libvorbis-1.2.3/
[ linux:libvorbis-1.2.3 ] # ./configure
[ linux:libvorbis-1.2.3 ] # make && make install

[ compile and installing libtheora ]
[ linux:download ] # wget http://downloads.xiph.org/releases/theora/libtheora-1.0.tar.bz2
[ linux:download ] # tar -xjf libtheora-1.0.tar.bz2
[ linux:download ] # cd libtheora-1.0/
[ linux:libtheora-1.0 ] # ./configure
[ linux:libtheora-1.0 ] # make && make install

:: compile and install ffmpeg
[ linux:download ] # svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
[ linux:download ] # cd ffmpeg/
[ linux:ffmpeg ] # ./configure --enable-shared --prefix=/usr --enable-gpl --enable-postproc --enable-nonfree --enable-postproc --enable-libfaad --enable-avfilter --enable-pthreads --enable-libxvid --enable-libx264 --enable-libmp3lame --enable-libfaac --enable-libvorbis --enable-libtheora
[ linux:ffmpeg ] # make && make install
[ linux:ffmpeg ] # ldconfig

:: compile and install ffmpeg-php
[ linux:download ] # wget http://sourceforge.net/projects/ffmpeg-php/files/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2/download
[ linux:download ] # tar -xjf ffmpeg-php-0.6.0.tbz2 -C /usr/local/php5/include/php/ext/
[ linux:download ] # cd /usr/local/php5/include/php/ext/ffmpeg-php-0.6.0/
[ linux:ffmpeg-php-0.6.0 ] # /usr/local/php5/bin/phpize
[ linux:ffmpeg-php-0.6.0 ] # vi ffmpeg_frame.c
#
# Please run this command on vi command mode :
# ( press Esc then : then %s/PIX_FMT_RGBA32/PIX_FMT_RGB32 than Return )
#
:%s/PIX_FMT_RGBA32/PIX_FMT_RGB32

[ linux:ffmpeg-php-0.6.0 ] # ./configure --with-php-config=/usr/local/php5/bin/php-config
[ linux:ffmpeg-php-0.6.0 ] # make && make install
[ linux:ffmpeg-php-0.6.0 ] # vi /usr/local/php5/etc/php.ini
;
; add ffmpeg.so on end of php.ini file
;
extension=/usr/local/php5/lib/php/extensions/no-debug-non-zts-20090626/ffmpeg.so

:: testing ffmpeg-php
[ linux:ffmpeg-php-0.6.0 ] # /usr/local/php5/bin/php -i | grep ffmpeg
ffmpeg
ffmpeg-php version => 0.6.0-svn
ffmpeg-php built on => Sep 8 2009 03:04:48
ffmpeg-php gd support => enabled
ffmpeg libavcodec version => Lavc52.35.0
ffmpeg libavformat version => Lavf52.38.0
ffmpeg swscaler version => SwS0.7.1
ffmpeg.allow_persistent => 0 => 0
ffmpeg.show_warnings => 0 => 0
:: links
+ GoogleLinux
+ Thenitai