Ubuntuで最新版のFFmpegを使えるようにする
参考元:[FFmpeg][Ubuntu] Ubuntu にFFmpegをインストール – wadslog
Ubuntu標準のFFmpegはライセンスの関係からかなりのコーデックが無効化されている上、バージン自体もかなり古いまま止まっているため、最新版のソースコードからビルドすることにした。
参考元でインストールしているAMR-NB/AMR-WBは携帯用の動画(3gpp)で使用されているコーデックのようなので今回は見送り。
x264のインストール
- x264のビルドにはyasmが必要だが、apt-getで入手できるものはエラーがでるため、ソースコードからビルドする。
$ wget http://www.tortall.net/projects/yasm/releases/yasm-0.7.1.tar.gz $ tar zxvf yasm-0.7.1.tar.gz $ cd yasm-0.7.1 $ ./configure $ make $ sudo make install
- x264のソースコードを入手し、ビルドする。
$ wget ftp://ftp.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20080920-2245.tar.bz2 $ tar jxvf x264-snapshot-20080920-2245.tar.bz2 $ cd x264-snapshot-20080920-2245 $ ./configure --eneble-shared $ make $ sudo make install
FFmpegのインストール
- FFmpegの最新版ソースコードを入手するため、subversionをインストールしておく。
$ sudo apt-get install subversion
- FFmpegのビルドに必要なファイルをapt-getよりインストールする。
$ sudo apt-get build-dep ffmpeg
- libx264-devは上記で準備したx264と競合して実行時にエラーが出るため、アンインストールしておく。
$ sudo apt-get remove --purge libx264-dev
$ svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg $ cd ffmpeg $ ./configure --enable-gpl --enable-nonfree --enable-postproc --enable-swscale --enable-pthreads --enable-libvorbis --enable-libtheora --enable-libmp3lame --enable-libfaac --enable-libfaad --enable-libxvid --enable-libx264 --enable-shared --disable-debug --prefix=/usr/local $ make $ sudo make install