head_hexagonはにらぼ☆てっくtale_hexagon

CentOS6系にffmpegをインストール

Posted by kasuga on 2015/03/16 under server | Be the First to Comment


こんにちはkasugaです。

ffmpegを使うものがあったのでインストールしてみました。

ffmpegインストール準備

$ yum install autoconf automake make gcc gcc-c++ pkgconfig wget libtool zlib-devel
$ yum install git

YASM

$ yum install -y yasm

X264のインストール

$ cd ~/ffmpeg-source
$ git clone git://git.videolan.org/x264.git
$ cd x264
$ ./configure --enable-shared --disable-asm
$ make && make install

libfdk_aac

$ cd ~/ffmpeg-source
$ git clone --depth 1 git://github.com/mstorsjo/fdk-aac.git
$ cd fdk-aac
$ autoreconf -fiv
$ ./configure
$ make && make install

ライブラリ設定

$ export LD_LIBRARY_PATH=/usr/local/lib/
$ echo /usr/local/lib > /etc/ld.so.conf.d/custom-libs.conf
$ ldconfig

ffmpegのインストール

$ cd ~/ffmpeg-source
$ git clone git://source.ffmpeg.org/ffmpeg.git
$ cd ffmpeg

branchの確認

git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/master
remotes/origin/oldabi
remotes/origin/release/0.10
remotes/origin/release/0.11
remotes/origin/release/0.5
remotes/origin/release/0.6
remotes/origin/release/0.7
remotes/origin/release/0.8
remotes/origin/release/0.9
remotes/origin/release/1.0
remotes/origin/release/1.1
remotes/origin/release/1.2
remotes/origin/release/2.0
remotes/origin/release/2.1
remotes/origin/release/2.2
remotes/origin/release/2.3
remotes/origin/release/2.4
remotes/origin/release/2.5
remotes/origin/release/2.6

ブランチの切り替え

$ git checkout -b n2.6 origin/release/2.6

ブランチの確認

$ git branch
master
* n2.6

ffmpegのインストール

$ ./configure --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libx264 \
--enable-shared --arch=x86_64 --enable-pthreads
$ make && make install

こんなエラーが出る場合は
error while loading shared libraries: libavdevice.so.56: cannot open shared object file: No such file or directory


$ ls /usr/local/lib/libav*
/usr/local/lib/libavcodec.a /usr/local/lib/libavdevice.a /usr/local/lib/libavfilter.a /usr/local/lib/libavformat.a /usr/local/lib/libavutil.a
/usr/local/lib/libavcodec.so /usr/local/lib/libavdevice.so /usr/local/lib/libavfilter.so /usr/local/lib/libavformat.so /usr/local/lib/libavutil.so
/usr/local/lib/libavcodec.so.56 /usr/local/lib/libavdevice.so.56 /usr/local/lib/libavfilter.so.5 /usr/local/lib/libavformat.so.56 /usr/local/lib/libavutil.so.54
/usr/local/lib/libavcodec.so.56.26.100 /usr/local/lib/libavdevice.so.56.4.100 /usr/local/lib/libavfilter.so.5.11.102 /usr/local/lib/libavformat.so.56.25.101 /usr/local/lib/libavutil.so.54.20.100
$ ldd `which ffmpeg`
libavdevice.so.52 => not found
libavfilter.so.1 => not found
libavformat.so.52 => not found
libavcodec.so.52 => not found
libswscale.so.0 => not found
libavcore.so.0 => not found
libavutil.so.50 => not found
$ vi /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/local/lib
$ ldconfig
$ ldd `which ffmpeg`
linux-vdso.so.1 => (0x00007fffa47ff000)
libavdevice.so.56 => /usr/local/lib/libavdevice.so.56 (0x00007fe9026aa000)
libavfilter.so.5 => /usr/local/lib/libavfilter.so.5 (0x00007fe902359000)
libavformat.so.56 => /usr/local/lib/libavformat.so.56 (0x00007fe901f95000)
libavcodec.so.56 => /usr/local/lib/libavcodec.so.56 (0x00007fe900c17000)
libpostproc.so.53 => /usr/local/lib/libpostproc.so.53 (0x00007fe9009cb000)
libswresample.so.1 => /usr/local/lib/libswresample.so.1 (0x00007fe9007b0000)
libswscale.so.3 => /usr/local/lib/libswscale.so.3 (0x00007fe90052f000)
libavutil.so.54 => /usr/local/lib/libavutil.so.54 (0x00007fe9002cc000)
libm.so.6 => /lib64/libm.so.6 (0x00007fe900047000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fe8ffe2a000)
libc.so.6 => /lib64/libc.so.6 (0x00007fe8ffa96000)
libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x00007fe8ff877000)
libxcb-shm.so.0 => /usr/lib64/libxcb-shm.so.0 (0x00007fe8ff675000)
libxcb-xfixes.so.0 => /usr/lib64/libxcb-xfixes.so.0 (0x00007fe8ff46f000)
libxcb-shape.so.0 => /usr/lib64/libxcb-shape.so.0 (0x00007fe8ff26b000)
libbz2.so.1 => /lib64/libbz2.so.1 (0x00007fe8ff05a000)
libz.so.1 => /lib64/libz.so.1 (0x00007fe8fee44000)
libx264.so.146 => /usr/local/lib/libx264.so.146 (0x00007fe8fea8b000)
libfdk-aac.so.1 => /usr/local/lib/libfdk-aac.so.1 (0x00007fe8fe7da000)
librt.so.1 => /lib64/librt.so.1 (0x00007fe8fe5d1000)
/lib64/ld-linux-x86-64.so.2 (0x00007fe9028c6000)
libXau.so.6 => /usr/lib64/libXau.so.6 (0x00007fe8fe3ce000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fe8fe1c9000)

“CentOS6系にffmpegをインストール” への 1 件のコメント

  1. […] こちらのページを参考に修正 […]

コメントを残す