这应该是最新的,大部分来自官方,就像我微信朋友圈分享的一句话:看技术文档,还是多看官方的吧,别找网上中文翻译了那些“高手”十个有九个自己也不知道在干嘛~
安装基础包
yum install autoconf automake cmake freetype-devel gcc gcc-c++ git libtool make mercurial nasm pkgconfig zlib-devel
创建源码目录
mkdir ~/ffmpeg_sources
Yasm (x264和FFmpeg采用Yasm汇编编译)
cd ~/ffmpeg_sourcesgit clone --depth 1 git://github.com/yasm/yasm.gitcd yasmautoreconf -fiv./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin"makemake installmake distclean
libx264 (H.264 视频编码器)
cd ~/ffmpeg_sourcesgit clone --depth 1 git://git.videolan.org/x264cd x264PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --enable-staticmakemake install
libx265 (H.265/HEVC 视频编码器)
cd ~/ffmpeg_sourceshg clone https://bitbucket.org/multicoreware/x265cd ~/ffmpeg_sources/x265/build/linuxcmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DENABLE_SHARED:bool=off ../../sourcemakemake install
libfdk_aac (AAC 音频编码器)
cd ~/ffmpeg_sourcesgit clone --depth 1 git://git.code.sf.net/p/opencore-amr/fdk-aaccd fdk-aacautoreconf -fiv./configure --prefix="$HOME/ffmpeg_build" --disable-sharedmakemake install
libmp3lame (MP3 音频编码器)
cd ~/ffmpeg_sourcescurl -L -O http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gztar xzvf lame-3.99.5.tar.gzcd lame-3.99.5./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --disable-shared --enable-nasmmakemake install
libopus (音频编码、解码器)
cd ~/ffmpeg_sourcesgit clone http://git.opus-codec.org/opus.gitcd opusautoreconf -fiv./configure --prefix="$HOME/ffmpeg_build" --disable-sharedmakemake install
libogg (Ogg 流库. libtheora 和 libvorbis所需组件)
cd ~/ffmpeg_sourcescurl -O http://downloads.xiph.org/releases/ogg/libogg-1.3.2.tar.gztar xzvf libogg-1.3.2.tar.gzcd libogg-1.3.2./configure --prefix="$HOME/ffmpeg_build" --disable-sharedmakemake install
libvorbis (Vorbis 音频编码器)
cd ~/ffmpeg_sourcescurl -O http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.4.tar.gztar xzvf libvorbis-1.3.4.tar.gzcd libvorbis-1.3.4LDFLAGS="-L$HOME/ffmeg_build/lib" CPPFLAGS="-I$HOME/ffmpeg_build/include" ./configure --prefix="$HOME/ffmpeg_build" --with-ogg="$HOME/ffmpeg_build" --disable-sharedmakemake install
libvpx (VP8/VP9 音频编码器)
cd ~/ffmpeg_sourcesgit clone --depth 1 https://chromium.googlesource.com/webm/libvpx.gitcd libvpx./configure --prefix="$HOME/ffmpeg_build" --disable-examplesmakemake install
FFmpeg
cd ~/ffmpeg_sourcesgit clone https://git.ffmpeg.org/ffmpeg.git ffmpegcd ffmpegPKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --bindir="$HOME/bin" --pkg-config-flags="--static" --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265makemake install
最后测试一下 ffmpeg --help