LoginSignup
20
16

More than 5 years have passed since last update.

Amazon Linux の /usr/local/ にFFmpegをインストールする

Last updated at Posted at 2014-11-19

AWSにはElastic Transcode があるのだが、諸事情でLinuxにEncodeソフトを入れなければならなくなった。
・・・で、Amazon Linux にFFmpegを入れようとしたときのメモです

いろいろググッてたら・・

Amazon Linux 2013.09 に FFmpeg をインストールする

・・・を書かれていたので、参考にさせていただきました~ (´ω`)ノ

Amazon Linux だったが、上記の方も書かれているとおり、Compile FFmpeg on CentOSに記載されている通りでインストールは成功ました。

ライブラリ・インストールのところで、いくつかのライブラリはgitからの取得に変わっていたので、この度、投稿させて頂きました。

注意..

以下のコマンドはroot権限が前提です
sudo するなどして実行してください。 @date: 2016/03/30

Get the Dependencies

yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel
mkdir /usr/local/src/ffmpeg_sources

Yasm

cd /usr/local/src/ffmpeg_sources
git clone --depth 1 git://github.com/yasm/yasm.git
cd yasm
autoreconf -fiv
./configure --prefix="/usr/local/ffmpeg_build" --bindir="/usr/local/bin"
make
make install
make distclean

libx264

cd /usr/local/src/ffmpeg_sources
git clone --depth 1 git://git.videolan.org/x264
cd x264
./configure --prefix="/usr/local/ffmpeg_build" --bindir="/usr/local/bin" --enable-static
make
make install
make distclean

libfdk_aac

cd /usr/local/src/ffmpeg_sources
git clone --depth 1 git://git.code.sf.net/p/opencore-amr/fdk-aac
cd fdk-aac
autoreconf -fiv
./configure --prefix="/usr/local/ffmpeg_build" --disable-shared
make
make install
make distclean

libmp3lame

cd /usr/local/src/ffmpeg_sources
curl -L -O http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz
tar xzvf lame-3.99.5.tar.gz
cd lame-3.99.5
./configure --prefix="/usr/local/ffmpeg_build" \
            --bindir="/usr/local/bin" \
            --disable-shared --enable-nasm
make
make install
make distclean

libopus

cd /usr/local/src/ffmpeg_sources
git clone git://git.opus-codec.org/opus.git
cd opus
autoreconf -fiv
./configure --prefix="/usr/local/ffmpeg_build" --disable-shared
make
make install
make distclean

libogg

cd /usr/local/src/ffmpeg_sources
curl -O http://downloads.xiph.org/releases/ogg/libogg-1.3.2.tar.gz
tar xzvf libogg-1.3.2.tar.gz
cd libogg-1.3.2
./configure --prefix="/usr/local/ffmpeg_build" --disable-shared
make
make install
make distclean

libvorbis

cd /usr/local/src/ffmpeg_sources
curl -O http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.4.tar.gz
tar xzvf libvorbis-1.3.4.tar.gz
cd libvorbis-1.3.4
./configure --prefix="/usr/local/ffmpeg_build" \
            --with-ogg="/usr/local/ffmpeg_build" \
            --disable-shared
make
make install
make distclean

libvpx

cd /usr/local/src/ffmpeg_sources
git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git
cd libvpx
./configure --prefix="/usr/local/ffmpeg_build" --disable-examples
make
make install
make clean

FFmpeg

cd /usr/local/src/ffmpeg_sources
git clone --depth 1 git://source.ffmpeg.org/ffmpeg
cd ffmpeg
PKG_CONFIG_PATH="/usr/local/ffmpeg_build/lib/pkgconfig" \
       ./configure --prefix="/usr/local/ffmpeg_build" \
       --extra-cflags="-I/usr/local/ffmpeg_build/include" \
       --extra-ldflags="-L/usr/local/ffmpeg_build/lib" \
       --bindir="/usr/local/bin" \
       --enable-gpl \
       --enable-nonfree \
       --enable-libfdk_aac \
       --enable-libmp3lame \
       --enable-libopus \
       --enable-libvorbis \
       --enable-libvpx \
       --enable-libx264
make
make install
make distclean
hash -r

以上で完了です。
思ったより簡単にインストールさせることができました。

$ ffmpeg -L
ffmpeg version git-2014-11-19-484d42a Copyright (c) 2000-2014 the FFmpeg developers
  built on Nov 19 2014 11:26:48 with gcc 4.8.2 (GCC) 20140120 (Red Hat 4.8.2-16)
  configuration: --prefix=/usr/local/ffmpeg_build --extra-cflags=-I/usr/local/ffmpeg_build/include --extra-ldflags=-L/usr/local/ffmpeg_build/lib --bindir=/usr/local/bin --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264
  libavutil      54. 14.100 / 54. 14.100
  libavcodec     56. 12.101 / 56. 12.101
  libavformat    56. 14.100 / 56. 14.100
  libavdevice    56.  3.100 / 56.  3.100
  libavfilter     5.  2.103 /  5.  2.103
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
This version of ffmpeg has nonfree parts compiled in.
Therefore it is not legally redistributable.
20
16
4

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
20
16