ffmpegをソースからコンパイル

Ubuntu12.04LTS上でffmpegをソースからビルドした手順に関するメモ

参考サイト

https://trac.ffmpeg.org/wiki/UbuntuCompilationGuide

必要なライブラリを事前にインストールする

> sudo apt-get install libass-dev libgpac-dev libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libx11-dev libxext-dev libxfixes-dev texi2html zlib1g-dev

Yasmというアセンブラ?をまずはビルド

> wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
> tar xzvf yasm-1.3.0.tar.gz
> cd yasm-1.3.0
> ./configure –prefix=/home/share/Temp/ffmpeg/build –bindir=/home/share/Temp/ffmpeg/bin  
> make  
> make install

libx264

 > wget http://download.videolan.org/pub/x264/snapshots/last_x264.tar.bz2  
 > tar xjvf last_x264.tar.bz2  
 > cd x264-snapshot-20140323-2245/  
 > ./configure –prefix=/home/share/Temp/ffmpeg/build –bindir=/home/share/Temp/ffmpeg/bin –enable-static  
 > make  
 > make install  
 > make distclean

libfdk-aac

 > wget -O fdk-aac.zip https://github.com/mstorsjo/fdk-aac/zipball/master  
 > unzip fdk-aac.zip  
 > cd mstorsjo-fdk-aac-2f29dd4/  
 > autoreconf -fiv  
 > ./configure –prefix=/home/share/Temp/ffmpeg/build –disable-shared  
 > make  
 > make install  
 > make distclean

libmp3lame

 > sudo apt-get install libmp3lame-dev

libopus

 > wget http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz  
 > tar xzvf opus-1.1.tar.gz  
 > cd opus-1.1  
 > ./configure –prefix=/home/share/Temp/ffmpeg/build –disable-shared  
 > make  
 > make install  
 > make distclean
```bash

> libvpx  
```bash
 wget http://webm.googlecode.com/files/libvpx-v1.3.0.tar.bz2  
 tar xjvf libvpx-v1.3.0.tar.bz2  
 cd libvpx-v1.3.0  
 ./configure –prefix=/home/share/Temp/ffmpeg/build –disable-examples  
 > make

ffmpeg

 > wget http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2  
 > tar xjvf ffmpeg-snapshot.tar.bz2  
 > cd ffmpeg  
 > ./configure –prefix=/home/share/Temp/ffmpeg/build –extra-cflags=-I/home/share/Temp/ffmpeg/build/include –extra-ldflags=-L/home/share/Temp/ffmpeg/build/lib –bindir=/home/share/Temp/ffmpeg/bin –enable-gpl –enable-libass –enable-libfdk-aac –enable-libmp3lame –enable-libopus –enable-libtheora –enable-libvorbis –enable-libvpx –enable-libx264 –enable-nonfree –extra-libs=-ldl  
 > make  
 > make install  
 > make distclean

確認

 > ./ffmpeg -version  
 ffmpeg version 2.2.git  
 built on Mar 25 2014 02:08:55 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)  
 configuration: –prefix=/home/share/Temp/ffmpeg/build –extra-cflags=-I/home/share/Temp/ffmpeg/build/include –extra-ldflags=-L/home/share/Temp/ffmpeg/build/lib –bindir=/home/share/Temp/ffmpeg/bin –enable-gpl –enable-libass –enable-libfdk-aac –enable-libmp3lame –enable-libopus –enable-libtheora –enable-libvorbis –enable-libvpx –enable-libx264 –enable-nonfree –extra-libs=-ldl  
 libavutil 52. 67.100 / 52. 67.100  
 libavcodec 55. 52.103 / 55. 52.103  
 libavformat 55. 34.101 / 55. 34.101  
 libavdevice 55. 11.100 / 55. 11.100  
 libavfilter 4. 3.100 / 4. 3.100  
 libswscale 2. 5.102 / 2. 5.102  
 libswresample 0. 18.100 / 0. 18.100  
 libpostproc 52. 3.100 / 52. 3.100