FFmpeg视频编码器的源码安装


===================================================================================================================

参考地址:
http://www.linuxfromscratch.org/blfs/view/svn/multimedia/ffmpeg.html

yum装依赖包

yum install -y autoconf automake cmake freetype-devel gcc gcc-c++ git libtool make mercurial nasm pkgconfig zlib-devel

 

需要安装的依赖包的个数和名称:

drwxrwxr-x. 16 1000 1000 4096 Mar 21 11:30 fdk-aac-0.1.6
-rw-r--r--. 1 root root 2091618 Mar 20 22:49 fdk-aac-0.1.6.tar.gz
drwx------. 18 1000 1000 4096 Mar 21 13:19 ffmpeg-3.4.2
-rw-r--r--. 1 root root 66590720 Mar 20 22:49 ffmpeg-3.4.2.tar
drwxrwxr-x. 10 1000 1000 4096 Mar 21 11:51 fribidi-1.0.1
-rw-r--r--. 1 root root 2074127 Mar 21 11:51 fribidi-1.0.1.tar.bz2
drwxr-xr-x. 15 1001 1001 4096 Mar 21 11:31 lame-3.100
-rw-r--r--. 1 root root 1524133 Mar 20 22:49 lame-3.100.tar.gz
drwxr-xr-x. 6 501 games 4096 Mar 21 13:05 libass-0.14.0
-rw-r--r--. 1 root root 2304000 Mar 21 11:15 libass-0.14.0.tar
drwxrwxr-x. 7 1000 1000 4096 Mar 21 11:34 libogg-1.3.3
-rw-r--r--. 1 root root 2099200 Mar 20 22:49 libogg-1.3.3.tar
drwxrwxrwx. 11 500 500 4096 Mar 21 13:10 libtheora-1.1.1
-rw-r--r--. 1 root root 6686720 Jan 25 2010 libtheora-1.1.1.tar
drwxr-xr-x. 13 501 games 4096 Mar 21 11:38 libvorbis-1.3.5
-rw-r--r--. 1 root root 7301120 Mar 20 22:49 libvorbis-1.3.5.tar
drwxrwxr-x. 16 root root 4096 Mar 21 11:39 libvpx-1.7.0
-rw-r--r--. 1 root root 2679797 Mar 20 22:49 libvpx-1.7.0.tar.gz
drwxrwsr-x. 22 802 900 4096 Mar 21 11:21 nasm-2.13.03
-rw-r--r--. 1 root root 8130560 Mar 20 22:49 nasm-2.13.03.tar
drwxrwxr-x. 11 1000 1000 4096 Mar 21 11:33 opus-1.2.1
-rw-r--r--. 1 root root 1011070 Mar 20 22:49 opus-1.2.1.tar.gz
drwxr-xr-x. 10 1000 1000 4096 Mar 21 11:25 x264-snapshot-20180212-2245-stable
-rw-r--r--. 1 root root 750755 Mar 20 22:49 x264-snapshot-20180212-2245-stable.tar.bz2
drwxr-xr-x. 6 root root 4096 Mar 21 11:25 x265_2.7
-rw-r--r--. 1 root root 1282742 Mar 20 22:49 x265_2.7.tar.gz
drwxrwxr-x. 13 1000 1000 4096 Mar 21 11:23 yasm-1.3.0
-rw-r--r--. 1 root root 1492156 Mar 20 22:49 yasm-1.3.0.tar.gz

cd nasm-2.13.03

./configure --prefix=/usr/local/

make && make install

cd yasm-1.3.0

sed -i 's#) ytasm.*#)#' Makefile.in

./configure --prefix=/usr/local/

make && make install

cd x264-snapshot-20180212-2245-stable

./configure --prefix=/usr/local/ --enable-shared --disable-cli

make && make install

cd x265_2.7

mkdir bld

cd bld/

cmake -DCMAKE_INSTALL_PREFIX=/usr/local/ ../source

make && make install

cd fdk-aac-0.1.6

./configure --prefix=/usr/local/ --disable-static

make && make install

cd lame-3.100

case $(uname -m) in i?86) sed -i -e 's/<xmmintrin.h/&.nouse/' configure ;; esac

./configure --prefix=/usr/local/ --enable-mp3rtp --disable-static

make && make install

cd opus-1.2.1

./configure --prefix=/usr/local/ --disable-static --docdir=/usr/local/share/doc/opus-1.2.1

make

make install

cd libogg-1.3.3

./configure --prefix=/usr/local/ --disable-static --docdir=/usr/local/share/doc/libogg-1.3.3

make && make install

cd libvorbis-1.3.5

sed -i '/components.png \\/{n;d}' doc/Makefile.in

vi /etc/ld.so.conf

添加:

/usr/local/lib

ldconfig -v

./configure --prefix=/usr/local/ --disable-static

make && make install

cd libvpx-1.7.0

sed -i 's/cp -p/cp/' build/make/Makefile

mkdir libvpx-build

cd libvpx-build/

../configure --prefix=/usr/local/ --enable-shared --disable-static

make && make install

cd fribidi-1.0.1

./configure --prefix=/usr/local/

make && make install

cd libass-0.14.0

export PKG_CONFIG=/usr/bin/pkg-config

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig

./configure --prefix=/usr/local/ --disable-static --disable-require-system-font-provider

make && make install

tar xf libtheora-1.1.1.tar

cd libtheora-1.1.1

sed -i 's/png_\(sizeof\)/\1/g' examples/png2theora.c

./configure --prefix=/usr/local/ --disable-static

make && make install

cd ffmpeg-3.4.2

./configure --prefix=/usr/local/ --enable-gpl --enable-version3 --enable-nonfree --disable-static --enable-shared --disable-debug --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --docdir=/usr/local/share/doc/ffmpeg-3.4.2

make && make install

ldconfig -v

ffmpeg -version
ffmpeg version 3.4.2 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-18)
configuration: --prefix=/usr/local/ --enable-gpl --enable-version3 --enable-nonfree --disable-static --enable-shared --disable-debug --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --docdir=/usr/local/share/doc/ffmpeg-3.4.2
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100

 

posted @ 2018-04-22 15:50  迷路的大雁  阅读(232)  评论(0编辑  收藏  举报