アイビスヘッダー

IBS

2011年8月12日金曜日

CentOS5.6 x86_64 に ffmpeg0.8.2 とsegmenter を導入する

CentOS5.6(x86_64) に ffmpeg0.8.2 と segmenter の導入に成功したので公開します。


■必須パッケージの導入

zlib
# yum install zlib-devel

glib2
# yum install glib2-devel

gcc
# yum install gcc
# yum install gcc-c++

git(epel)
# yum install git

yasm(epel)
x264、WebMで必要。SSE高速化。
# yum install yasm
# yum install yasm-devel


■ソースからの導入

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

faad
# wget http://sourceforge.net/projects/faac/files/faad2-src/faad2-2.7/faad2-2.7.tar.gz/download
# tar xvfz faad2-2.7.tar.gz
# cd faad2-2.7
# ./configure
# make
# make install

lame mp3
# wget http://sourceforge.net/projects/lame/files/lame/3.98.4/lame-3.98.4.tar.gz/download
# tar xvfz lame-3.98.4.tar.gz
# cd lame-3.98.4
# ./configure
# make
# make install

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

libogg有効化
# vi /etc/ld.so.conf
/usr/local/lib 追記
# /sbin/ldconfig

theora
# wget http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.gz
# tar xvfz libtheora-1.1.1.tar.gz
# cd libtheora-1.1.1
# ./configure
# make
# make install

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

xvid
# wget http://downloads.xvid.org/downloads/xvidcore-1.2.2.tar.gz
# tar xvfz xvidcore-1.2.2.tar.gz
# cd xvidcore
# cd build
# cd generic
# ./configure
# make
# make install

gpac
# wget http://downloads.sourceforge.net/gpac/gpac-0.4.5.tar.gz
# wget http://downloads.sourceforge.net/gpac/gpac_extra_libs-0.4.5.tar.gz
# tar xvfz gpac-0.4.5.tar.gz
# tar xvfz gpac_extra_libs-0.4.5.tar.gz
# cd gpac
# cp -r ../gpac_extra_libs/* extra_lib/
# chmod 755 configure
# ./configure
# make lib
# make apps
# make install-lib
# make install

x264
# git clone git://git.videolan.org/x264.git x264
# cd x264
# ./configure --enable-shared
# make
# make install

webm
# wget http://webm.googlecode.com/files/libvpx-v0.9.7.tar.bz2
# tar jxvf libvpx-v0.9.7.tar.bz2
# cd libvpx-v0.9.7
# ./configure --enable-pic
# make
# make install

ffmpeg
# wget http://www.ffmpeg.org/releases/ffmpeg-0.8.2.tar.gz
# tar xvfz ffmpeg-0.8.2.tar.gz
# cd ffmpeg-0.8.2
# ./configure --enable-gpl --enable-nonfree --enable-pthreads --enable-libfaac --enable-libmp3lame --enable-shared --enable-libx264 --enable-libvpx --enable-libxvid --enable-libtheora --enable-libvorbis --enable-postproc
# make
# make install
警告が多数表示されますが、エラーがなければOKです。

segmenter
# mkdir segmenter
# cd segmenter
# wget http://svn.assembla.com/svn/legend/segmenter/Makefile
# wget http://svn.assembla.com/svn/legend/segmenter/segmenter.c
# vi segmenter.c
53行目 case CODEC_TYPE_AUDIO: → case AVMEDIA_TYPE_AUDIO:
65行目 case CODEC_TYPE_VIDEO: → case AVMEDIA_TYPE_VIDEO:
242行目 ofmt = guess_format("mpegts", NULL, NULL); → ofmt = av_guess_format("mpegts", NULL, NULL);
260行目 case CODEC_TYPE_VIDEO: → case AVMEDIA_TYPE_VIDEO:
265行目 case CODEC_TYPE_AUDIO: → case AVMEDIA_TYPE_AUDIO:
320行目 if (packet.stream_index == video_index && (packet.flags & PKT_FLAG_KEY)) { → if (packet.stream_index == video_index && (packet.flags & AV_PKT_FLAG_KEY)) {

# make
# make install


0 件のコメント: