以下安装步骤基本来自官网,做个笔记以方便自己以后查看
http://trac.ffmpeg.org/wiki/CompilationGuide
1.安装依赖包
- <span style="font-size:14px;">yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel</span>
2.新建文件夹存放源码
mkdir ~/ffmpeg_sources
3.编译&安装
Yasm
Yasm is an assembler used by x264 and FFmpeg.
- cd ~/ffmpeg_sources
- curl -O http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
- tar xzvf yasm-1.2.0.tar.gz
- cd yasm-1.2.0
- ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin"
- make
- make install
- make distclean
- export "PATH=$PATH:$HOME/bin"
libx264
H.264 video encoder.
- cd ~/ffmpeg_sources
- git clone --depth 1 git://git.videolan.org/x264
- cd x264
- ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --enable-static
- make
- make install
- make distclean
libfdk_aac
AAC audio encoder.
- cd ~/ffmpeg_sources
- git clone --depth 1 git://git.code.sf.net/p/opencore-amr/fdk-aac
- cd fdk-aac
- autoreconf -fiv
- ./configure --prefix="$HOME/ffmpeg_build" --disable-shared
- make
- make install
- make distclean
libmp3lame
Opus audio decoder and encoder.
- cd ~/ffmpeg_sources
- curl -O 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/ffmpeg_build" --disable-shared
- make
- make install
- make distclean
libogg
Ogg bitstream library. Required by libtheora and libvorbis.
- cd ~/ffmpeg_sources
- curl -O http://downloads.xiph.org/releases/ogg/libogg-1.3.1.tar.gz
- tar xzvf libogg-1.3.1.tar.gz
- cd libogg-1.3.1
- ./configure --prefix="$HOME/ffmpeg_build" --disable-shared
- make
- make install
- make distclean
libvorbis
Vorbis audio encoder. Requires libogg.
- cd ~/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="$HOME/ffmpeg_build" --with-ogg="$HOME/ffmpeg_build" --disable-shared
- make
- make install
- make distclean
libvpx
VP8/VP9 video encoder.
- cd ~/ffmpeg_sources
- git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git
- cd libvpx
- ./configure --prefix="$HOME/ffmpeg_build" --disable-examples
- make
- make install
- make clean
注意:由于国内最近无法访问Google所以libvpx无法git clone ,此时可以去别处下载:http://yunpan.cn/QhNk5tDqQV3MM 访问密码 45f6
FFmpeg
cd ~/ffmpeg_sources git clone --depth 1 git://source.ffmpeg.org/ffmpeg cd ffmpeg PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" export PKG_CONFIG_PATH ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --bindir="$HOME/bin" --extra-libs=-ldl --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 make make install make distclean hash -r . ~/.bash_profile
安装结束查看版本: