平衡点
2008/09/25
_ 某所に ffmpeg を install ちう.
root 権限が無いので, ビルドしまくり.コーデックが沢山あって面倒だにゃぁ. イロイロ試行錯誤していたら, こんなエントリが.
なるほどー.
というわけで, ちょっと弄って某所で仕込み. ほとんど全て --prefix=${HOME} みたいなのをつければ良いだけ, かと思いきや, CFLAGS で -L${HOME}/lib -I${HOME}/include みたいなが必要(あたりまえ).
#------------------------------------------------------------- # config #------------------------------------------------------------- INSTALL_PREFIX=${HOME} ADD_PATH=${INSTALL_PREFIX}/bin #------------------------------------------------------------- # Version #------------------------------------------------------------- A52_SRC=a52dec-0.7.4 DIRAC_SRC=dirac-0.10.0 FAAC_SRC=faac-1.26 FAAD_SRC=faad2-2.6.1 GSM_SRC=gsm-1.0.12 AMRNB_SRC=amrnb-7.0.0.2 AMRWB_SRC=amrwb-7.0.0.3 LAME_SRC=lame-3.97 YASM_SRC=yasm-0.7.1 OGG_SRC=libogg-1.1.3 VORVIS_SRC=libvorbis-1.2.0 XVID_SRC=xvidcore-1.1.3 #------------------------------------------------------------- # main #------------------------------------------------------------- all: build-depend ffmpeg build-depend: yasm a52 dirac faac faad gsm ogg amrnb amrwb mp3lame x264 nut theora vorbis xvid clean: yasm-clean a52-clean dirac-clean faad-clean faac-clean gsm-clean ogg-clean amrnb-clean amrwb-clean mp3lame-clean x264-clean nut-clean theora-clean vorbis-clean xvid-clean distclean: yasm-distclean a52-distclean dirac-distclean faac-distclean faad-distclean gsm-distclean ogg-distclean amrnb-distclean amrwb-distclean mp3lame-distclean x264-distclean nut-distclean theora-distclean vorbis-distclean xvid-distclean #------------------------------------------------------------- # ffmpeg #------------------------------------------------------------- ffmpeg: ffmpeg-build ffmpeg-repos: @if [ ! -d $@ ]; then \ svn co svn://svn.mplayerhq.hu/ffmpeg/trunk $@ ;\ fi ;\ cd ffmpeg-repos && svn update ffmpeg-build: ffmpeg-repos cd $< ;\ export PATH=${PATH}:${ADD_PATH} ;\ LDFLAGS="-L${INSTALL_PREFIX}/lib" \ CFLAGS="-I${INSTALL_PREFIX}/include -L${INSTALL_PREFIX}/lib" \ PKG_CONFIG_PATH=${INSTALL_PREFIX}/lib/pkgconfig \ ./configure --prefix=${INSTALL_PREFIX} \ --enable-gpl \ --enable-nonfree \ --enable-postproc \ --enable-avfilter \ --enable-avfilter-lavf \ --enable-liba52 \ --enable-liba52bin \ --enable-libamr-nb \ --enable-libamr-wb \ --enable-libdirac \ --enable-libfaac \ --enable-libfaad \ --enable-libfaadbin \ --enable-libgsm \ --enable-libmp3lame \ --enable-libnut \ --enable-libtheora \ --enable-libvorbis \ --enable-libx264 \ --enable-libxvid ;\ make && make install ffmpeg-clean: cd ffmpeg-repos ;\ make clean #------------------------------------------------------------- # liba52 #------------------------------------------------------------- a52: liba52.a ${A52_SRC}.tar.gz: @if [ ! -f $@ ]; then \ wget http://liba52.sourceforge.net/files/$@ ; \ fi ;\ tar xf $@ liba52.a: ${A52_SRC}.tar.gz cd ${A52_SRC} ;\ ./configure --prefix=${INSTALL_PREFIX} ;\ make && make install a52-clean: cd ${A52_SRC} && make distclean a52-distclean: rm -rf ${A52_SRC}* #------------------------------------------------------------- # dirac #------------------------------------------------------------- dirac: libdirac_decoder.a ${DIRAC_SRC}.tar.gz: @if [ ! -f $@ ]; then \ wget http://downloads.sourceforge.net/dirac/$@ ;\ fi ;\ tar xf $@ libdirac_decoder.a: ${DIRAC_SRC}.tar.gz cd ${DIRAC_SRC} ;\ ./configure --prefix=${INSTALL_PREFIX} ;\ make && make install dirac-clean: cd ${DIRAC_SRC} && make clean dirac-distclean: rm -rf ${DIRAC_SRC}* #------------------------------------------------------------- # faac #------------------------------------------------------------- faac: libfaac.a ${FAAC_SRC}.tar.gz: if [ ! -f $@ ]; then \ wget http://downloads.sourceforge.net/faac/$@ ; \ fi ;\ tar xf $@ libfaac.a: ${FAAC_SRC}.tar.gz cd faac &&./bootstrap ;\ ./configure --prefix=${INSTALL_PREFIX} && make && make install faac2-clean: cd faac && make clean faac-distclean: rm -rf faac* #------------------------------------------------------------- # faad #------------------------------------------------------------- faad: libfaad.a ${FAAD_SRC}.tar.gz: if [ ! -f $@ ]; then \ wget http://downloads.sourceforge.net/faac/$@ ; \ fi ;\ tar xf $@ libfaad.a: ${FAAD_SRC}.tar.gz cd faad2 &&./bootstrap ;\ ./configure --prefix=${INSTALL_PREFIX} && make && make install faad-clean: cd faad2 && make clean faad-distclean: rm -rf faad2* #------------------------------------------------------------- # gsm #------------------------------------------------------------- gsm: libgsm.a ${GSM_SRC}.tar.gz: if [ ! -f $@ ]; then \ wget http://kbs.cs.tu-berlin.de/~jutta/gsm/$@ ; \ fi ;\ tar xf $@ libgsm.a: ${GSM_SRC}.tar.gz cd gsm-1.0-pl12 && make && \ make install INSTALL_ROOT=${INSTALL_PREFIX} \ GSM_INSTALL_LIB=${INSTALL_PREFIX}/lib \ GSM_INSTALL_INC=${INSTALL_PREFIX}/include gsm-clean: cd gsm-1.0-pl12 && make clean gsm-distclean: rm -rf gsm-1.0-pl12* #------------------------------------------------------------- # amrnb #------------------------------------------------------------- amrnb: libamrnb.a ${AMRNB_SRC}.tar.bz2: @if [ ! -f $@ ]; then \ wget http://ftp.penguin.cz/pub/users/utx/amr/$@ ;\ fi ;\ tar xf $@ libamrnb.a: ${AMRNB_SRC}.tar.bz2 cd ${AMRNB_SRC} ;\ ./configure --prefix=${INSTALL_PREFIX} && make && make install amrnb-clean: cd ${AMRNB_SRC} && clean amrnb-distclean: rm -rf ${AMRNB_SRC}* #------------------------------------------------------------- # abrwb #------------------------------------------------------------- amrwb: libamrwb.a ${AMRWB_SRC}.tar.bz2: @if [ ! -f $@ ]; then \ wget http://ftp.penguin.cz/pub/users/utx/amr/$@ ;\ fi ;\ tar xf $@ libamrwb.a: ${AMRWB_SRC}.tar.bz2 cd ${AMRWB_SRC} ;\ ./configure --prefix=${INSTALL_PREFIX} && make && make install amrwb-clean: cd ${AMRWB_SRC} && clean amrwb-distclean: rm -rf ${AMRWB_SRC}* #------------------------------------------------------------- # mp3lame #------------------------------------------------------------- mp3lame: libmp3lame.a ${LAME_SRC}.tar.gz: @if [ ! -f $@ ]; then \ wget http://downloads.sourceforge.net/lame/$@ ;\ fi ;\ tar xf $@ libmp3lame.a: ${LAME_SRC}.tar.gz cd ${LAME_SRC} ;\ ./configure --prefix=${INSTALL_PREFIX} && make && make install mp3lame-clean: cd ${LAME_SRC} && make clean mp3lame-distclean: rm -rf ${LAME_SRC}* #------------------------------------------------------------- # yasm #------------------------------------------------------------- yasm: ${YASM_SRC} ${YASM_SRC}.tar.gz: @if [ ! -f $@ ]; then \ wget http://www.tortall.net/projects/yasm/releases/$@ ; \ fi ; tar xf $@ ${YASM_SRC}: ${YASM_SRC}.tar.gz cd $@ ;\ ./configure --prefix=${INSTALL_PREFIX} && make && make install yasm-clean: cd ${YASM_SRC} && make clean yasm-distclean: rm -rf ${YASM_SRC}* #------------------------------------------------------------- # x264 #------------------------------------------------------------- x264: yasm libx264.a x264-git: @if [ ! -d $@ ]; then \ git clone git://git.videolan.org/x264.git ; \ mv x264 $@ ; \ fi ;\ cd $@ && git pull libx264.a: x264-git cd $< ;\ export PATH=${PATH}:${ADD_PATH} ;\ ./configure --prefix=${INSTALL_PREFIX} \ --enable-shared \ --enable-pthread ;\ make && make install x264-clean: cd x264-git && make clean x264-distclean: rm -rf x264-git #------------------------------------------------------------- # nut #------------------------------------------------------------- nut: libnut.a libnut-svn: @if [ ! -d $@ ]; then \ svn co svn://svn.mplayerhq.hu/nut/src/trunk $@ ;\ fi ;\ cd $@ && svn up libnut.a: libnut-svn cd $< && make && make install PREFIX=${INSTALL_PREFIX} nut-clean: cd libnut-svn && make clean nut-distclean: rm -rf libnut-svn* #------------------------------------------------------------- # ogg #------------------------------------------------------------- ogg: libogg.a ${OGG_SRC}.tar.gz: @if [ ! -f $@ ]; then \ wget http://downloads.xiph.org/releases/ogg/$@ ;\ fi ;\ tar xvf $@ libogg.a: ${OGG_SRC}.tar.gz cd ${OGG_SRC} ;\ ./configure --prefix=${INSTALL_PREFIX} && make && make install ogg-clean: cd ${OGG_SRC} && make clean ogg-distclean: rm -rf ${OGG_SRC}* #------------------------------------------------------------- # theora #------------------------------------------------------------- theora: ogg libtheora.a theora-svn: @if [ ! -d $@ ]; then \ svn co http://svn.xiph.org/trunk/theora $@ ;\ fi ;\ cd $@ && svn up libtheora.a: theora-svn cd $< ;\ ./autogen.sh ;\ ./configure \ --prefix=${INSTALL_PREFIX} \ --with-ogg=${INSTALL_PREFIX} ;\ make && make install theora-clean: cd theora-svn && make clean theora-distclean: rm -rf theora-svn* #------------------------------------------------------------- # vorbis #------------------------------------------------------------- vorbis: libvorbis.a ${VORVIS_SRC}.tar.gz: @if [ ! -f $@ ]; then \ wget http://downloads.xiph.org/releases/vorbis/$@ ; \ fi ;\ tar xf $@ libvorbis.a: ${VORVIS_SRC}.tar.gz cd ${VORVIS_SRC} ;\ ./configure --prefix=${INSTALL_PREFIX} && make && make install vorbis-clean: cd ${VORVIS_SRC} && make clean vorbis-distclean: rm -rf ${VORVIS_SRC}* #------------------------------------------------------------- # xvid #------------------------------------------------------------- xvid: yasm libxvidcore.4.a ${XVID_SRC}.tar.gz: @if [ ! -f $@ ]; then \ wget http://downloads.xvid.org/downloads/$@ ;\ fi ;\ tar xf $@ libxvidcore.4.a: ${XVID_SRC}.tar.gz cd ${XVID_SRC}/build/generic ;\ ./bootstrap.sh ;\ export PATH=${PATH}:${ADD_PATH} ;\ ./configure --prefix=${INSTALL_PREFIX} ;\ make && make install xvid-clean: cd ${XVID_SRC}/build/generic && make clean xvid-distclean: rm -rf ${XVID_SRC}*
やっつけだけど, とりあえず動いたから正義. 書いてから思ったけれど, distclean は結構危険ですな. typo していなくて良かった.
... icc でコンパイルすると高速になったりするんだろうか?