This howto is written for Ubuntu 8.10 and is verified to work on 8.2.2009.
I found numerous tutorials on this subject out there but they all failed me, but combination of them all was successful. So fallowing is made from 10 different tutorials.
And for all those who will ask why not just apt-get php5-ffmpeg, answer is so we can configure ffmpeg with libs and options we need.
준비
apt-get update
파일 다운로드
cd /usr/local/src
wget http://www3.mplayerhq.hu/MPlayer/releases/codecs/essential-20071007.tar.bz2
wget http://rubyforge.org/frs/download.php/17497/flvtool2-1.0.6.tgz
wget http://easynews.dl.sourceforge.net/sourceforge/lame/lame-3.97.tar.gz
wget http://superb-west.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.6.0.tbz2
wget http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.0.tar.gz
wget http://ftp.penguin.cz/pub/users/utx/amr/amrnb-7.0.0.2.tar.bz2
wget http://ftp.penguin.cz/pub/users/utx/amr/amrwb-7.0.0.3.tar.bz2
wget http://downloads.xiph.org/releases/theora/libtheora-1.0beta3.tar.gz
압축해제
tar zxvf lame-3.97.tar.gz
tar zxvf libogg-1.1.3.tar.gz
tar zxvf libvorbis-1.2.0.tar.gz
tar zxvf flvtool2-1.0.6.tgz
tar jxvf essential-20071007.tar.bz2
tar jxvf ffmpeg-php-0.6.0.tbz2
bzip2 -cd amrnb-7.0.0.2.tar.bz2 | tar xvf -
bzip2 -cd amrwb-7.0.0.3.tar.bz2 | tar xvf -
tar zxvf libtheora-1.0beta3.tar.gz
Ruby on Rails, Subversion & ncurses 설치
apt-get install subversion ruby libcurses-ruby
Mplayer, FFmpeg 다운로드
저장소에서 체크아웃 받은 후 최신버전으로 업데이트합니다.
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
cd /usr/local/src/mplayer
svn update
코덱 복사
mkdir /usr/local/lib/codecs
mv /usr/local/src/essential-20071007/* /usr/local/lib/codecs/
chmod -R 755 /usr/local/lib/codecs/
임시 디렉토리(TMP) 생성
mkdir /usr/local/src/tmp
chmod 777 /usr/local/src/tmp
export TMPDIR=/usr/local/src/tmp
라이브러리 설치
각 디렉토리에서 컴파일 후 설치합니다.
./configure && make && make install
- lamemp3 설치
- libogg 설치
- libvorbis 설치
- AMR 설치
- libtheora 설치
flvtool2 설치
cd /usr/local/src/flvtool2-1.0.6/
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install
Mplayer & Mencoder 설치
{주의} H.264 인코딩 시 x264 라이브러리를 설치한 후 추가해야 합니다. : Mencoder Shell Script와 라이브러리 추가
cd /usr/local/src/mplayer
./configure --enable-jpeg
make && make install
FFmpeg 설치
cd /usr/local/src/ffmpeg/
./configure --enable-libmp3lame --enable-libvorbis --disable-mmx --enable-shared --enable-libamr-nb --enable-libamr-wb --enable-nonfree --enable-libtheora
make
make install
{주의} 설치도중 라이브러리를 찾을 수 없는 에러가 발생할 수 있습니다. 이 경우 심볼릭 링크를 통해 라이브러리 경로를 지정해 줍니다.
ln -s /usr/local/lib/[YOUR LIB NAME] /usr/lib/[YOUR LIB NAME]
FFmpeg-php 설치
cd /usr/local/src/ffmpeg-php-0.6.0/
phpize
./configure --with-ffmpeg=/usr/local/ffmpeg
make
make install
php.ini 에 모듈을 추가한 후 웹 서버를 다시 시작합니다.
echo 'extension=ffmpeg.so' >> /etc/php5/apache2/php.ini
/etc/init.d/apache2 restart