IT戦記

プログラミング、起業などについて書いているプログラマーのブログです😚

ffmpeg 再インストール


なんか、使いたいコーデックがある度に入れ直すのが面倒なので、コーデックのダウンロードからそれぞれのビルドまでやる Makefile を作った。
自分の環境専用だけど、これがあれば make ってやるだけで全部入るので楽チン

all: ffmpeg-repos /usr/local/lib/libfaad.dylib /usr/local/lib/liba52.la /usr/local/lib/libdirac_decoder.dylib /usr/local/lib/libfaac.dylib /usr/local/lib/libgsm.a /usr/local/lib/libamrnb.dylib /usr/local/lib/libamrwb.dylib /usr/local/lib/libmp3lame.dylib /usr/local/lib/libx264.a /usr/local/lib/libnut.a /usr/local/lib/libtheora.dylib /usr/local/lib/libvorbis.dylib /usr/local/lib/libxvidcore.4.dylib 
	cd ffmpeg-repos && PKG_CONFIG_PATH=/usr/local/lib/pkgconfig sh configure --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 && sudo make install


# ffmpeg-repos
ffmpeg-repos:
	svn co svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg-repos


# faad2
faad2-2.6.1.tar.gz:
	wget http://downloads.sourceforge.net/faac/faad2-2.6.1.tar.gz

faad2: faad2-2.6.1.tar.gz
	tar xvfz faad2-2.6.1.tar.gz

/usr/local/lib/libfaad.dylib: faad2
	cd faad2 && ./bootstrap && ./configure && make && sudo make install


# liba52
a52dec-0.7.4.tar.gz:
	wget http://liba52.sourceforge.net/files/a52dec-0.7.4.tar.gz

a52dec-0.7.4: a52dec-0.7.4.tar.gz
	tar xvfz a52dec-0.7.4.tar.gz

/usr/local/lib/liba52.la: a52dec-0.7.4
	cd a52dec-0.7.4 && ./configure && make && sudo make install


# libdirac
dirac-0.10.0.tar.gz:
	wget http://downloads.sourceforge.net/dirac/dirac-0.10.0.tar.gz

dirac-0.10.0: dirac-0.10.0.tar.gz
	tar xvfz dirac-0.10.0.tar.gz 

/usr/local/lib/libdirac_decoder.dylib: dirac-0.10.0
	cd dirac-0.10.0 && ./configure && make && sudo make install


# faac2
faac-1.26.tar.gz:
	wget http://downloads.sourceforge.net/faac/faac-1.26.tar.gz

faac: faac-1.26.tar.gz
	tar xvfz faac-1.26.tar.gz

/usr/local/lib/libfaac.dylib: faac
	cd faac && ./bootstrap && ./configure && make && sudo make install


# libgsm
gsm-1.0.12.tar.gz:
	wget http://kbs.cs.tu-berlin.de/~jutta/gsm/gsm-1.0.12.tar.gz

gsm-1.0-pl12: gsm-1.0.12.tar.gz
	tar xvfz gsm-1.0.12.tar.gz

/usr/local/lib/libgsm.a: gsm-1.0-pl12
	cd gsm-1.0-pl12 && make && sudo cp lib/libgsm.a /usr/local/lib/ && sudo cp inc/gsm.h /usr/local/include/


# libamrnb
amrnb-7.0.0.2.tar.bz2:
	wget http://ftp.penguin.cz/pub/users/utx/amr/amrnb-7.0.0.2.tar.bz2

amrnb-7.0.0.2: amrnb-7.0.0.2.tar.bz2
	tar xvfj amrnb-7.0.0.2.tar.bz2

/usr/local/lib/libamrnb.dylib: amrnb-7.0.0.2
	cd amrnb-7.0.0.2 && ./configure && make && sudo make install


# libamrwb
amrwb-7.0.0.3.tar.bz2:
	wget http://ftp.penguin.cz/pub/users/utx/amr/amrwb-7.0.0.3.tar.bz2

amrwb-7.0.0.3: amrwb-7.0.0.3.tar.bz2
	tar xvfj amrwb-7.0.0.3.tar.bz2

/usr/local/lib/libamrwb.dylib: amrwb-7.0.0.3
	cd amrwb-7.0.0.3 && ./configure && make && sudo make install


# libmp3lame
lame-3.97.tar.gz:
	wget http://downloads.sourceforge.net/lame/lame-3.97.tar.gz

lame-3.97: lame-3.97.tar.gz
	tar xzf lame-3.97.tar.gz

/usr/local/lib/libmp3lame.dylib: lame-3.97
	cd lame-3.97 && ./configure && make && sudo make install


# libx264
x264:
	git clone git://git.videolan.org/x264.git

/usr/local/lib/libx264.a: x264
	cd x264 && ./configure && make && sudo make install

# libnut
libnut:
	svn co svn://svn.mplayerhq.hu/nut/src/trunk libnut

/usr/local/lib/libnut.a: libnut
	cd libnut && make && sudo make install

# libogg
libogg-1.1.3.tar.gz:
	wget http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz

libogg-1.1.3: libogg-1.1.3.tar.gz
	tar xvf libogg-1.1.3.tar.gz

/usr/local/lib/libogg.dylib: libogg-1.1.3
	cd libogg-1.1.3 && ./configure && make && sudo make install

# libtheora
theora:
	svn co http://svn.xiph.org/trunk/theora theora

/usr/local/lib/libtheora.dylib: theora /usr/local/lib/libogg.dylib
	cd theora && ./autogen.sh && ./configure && make && sudo make install


# libvorbis
libvorbis-1.2.0.tar.gz:
	wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.0.tar.gz

libvorbis-1.2.0: libvorbis-1.2.0.tar.gz
	tar xvfz libvorbis-1.2.0.tar.gz

/usr/local/lib/libvorbis.dylib: libvorbis-1.2.0
	cd libvorbis-1.2.0 && ./configure && make && sudo make install


# libxvid
xvidcore-1.1.3.tar.gz:
	wget http://downloads.xvid.org/downloads/xvidcore-1.1.3.tar.gz

xvidcore-1.1.3: xvidcore-1.1.3.tar.gz
	tar xvf xvidcore-1.1.3.tar.gz

/usr/local/lib/libxvidcore.4.dylib: xvidcore-1.1.3
	cd xvidcore-1.1.3/build/generic && ./bootstrap.sh && ./configure --disable-assembly && make && sudo make install