当前位置: > CentOS > CentOS教程 >

CentOS编译安装ffmpeg以及相关编码解码器

时间:2017-06-10 12:21来源:linux.it.net.cn 作者:IT

CentOS编译安装ffmpeg是一件很痛苦的过程,因为各种编码器、解码器什么的很繁杂,而且相互依赖关系更复杂。

编译了一天终于把它搞定并基本测试无问题,以下是步骤。

安装yasm

wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz 
tar zxf yasm-1.2.0.tar.gz 
cd yasm-1.2.0 
./configure 
make 
make install

安装frei0r(先安装新版autoconf,这会覆盖掉系统中的旧版本哦)

wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz 
tar zxf autoconf-2.69.tar.gz 
cd autoconf-2.69 
./configure –prefix=/usr 
make 
make install

wget http://files.dyne.org/frei0r/releases/frei0r-plugins-1.4.tar.gz 
tar zxf frei0r-plugins-1.4.tar.gz 
cd frei0r-plugins-1.4 
./configure 
make 
make install

安装gnutls

参考: http://blog.creke.net/800.html

安装mp3lame

wget http://iweb.dl.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz 
tar zxf lame-3.99.5.tar.gz 
cd lame-3.99.5 
make 
make install

安装opencore-amr

wget http://iweb.dl.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-0.1.3.tar.gz 
tar zxf opencore-amr-0.1.3.tar.gz 
./configure –enable-shared 
make 
make install

安装opus

wget http://downloads.xiph.org/releases/opus/opus-1.0.2.tar.gz 
tar zxf opus-1.0.2.tar.gz 
cd opus-1.0.2 
make 
make install

安装rtmpdump

wget http://rtmpdump.mplayerhq.hu/download/rtmpdump-2.3.tgz 
tar zxf rtmpdump-2.3.tgz 
cd rtmpdump-2.3 
make 
make install

安装schroedinger(先安装好orc库)

wget http://code.entropywave.com/download/orc/orc-0.4.17.tar.gz 
tar zxf orc-0.4.17.tar.gz 
cd orc-0.4.17 
./configure 
make 
make install 
/sbin/ldconfig

wget http://diracvideo.org/download/schroedinger/schroedinger-1.0.11.tar.gz 
tar zxf schroedinger-1.0.11.tar.gz 
cd schroedinger-1.0.11 
PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/lib64/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig ./configure 
make 
make install

安装soxr (注:新版libsoxr貌似与当前ffmpeg不兼容,用旧版)

yum install -y xz 
wget http://hivelocity.dl.sourceforge.net/project/soxr/soxr-0.1.0-Source.tar.xz 
xz -d soxr-0.1.0-Source.tar.xz 
tar xf soxr-0.1.0-Source.tar 
cd soxr-0.1.0-Source 
./go 
cd Release/ 
make 
make install 
/sbin/ldconfig

安装speex(先安装libogg库)

wget http://downloads.xiph.org/releases/ogg/libogg-1.3.0.tar.gz 
tar zxf libogg-1.3.0.tar.gz 
./configure 
make 
make install 
/sbin/ldconfig

wget http://downloads.xiph.org/releases/speex/speex-1.2rc1.tar.gz 
tar zxf speex-1.2rc1.tar.gz 
cd speex-1.2rc1 
./configure 
make 
make install

安装theora(先安装好libvorbis库和libsdl库)

wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.3.tar.gz 
tar zxf libvorbis-1.3.3.tar.gz 
./configure 
make 
make install

wget http://www.libsdl.org/release/SDL-1.2.15.tar.gz 
tar zxf SDL-1.2.15.tar.gz 
cd SDL-1.2.15 
./configure 
make 
make install 
/sbin/ldconfig

wget http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2 
tar zjf libtheora-1.1.1.tar.bz2 
./configure 
make 
make install

安装twolame

wget http://downloads.sourceforge.net/twolame/twolame-0.3.13.tar.gz 
tar zxf twolame-0.3.13 
.tar.gz 
cd twolame-0.3.13 
./configure 
make 
make install 
/sbin/ldconfig

安装VisualOn AAC( 注:github的tag和master版均无法autoconf,用zeranoe版代替)

wget wget http://ffmpeg.zeranoe.com/builds/source/external_libraries/vo-aacenc-0.1.2.tar.xz 
xz -d vo-aacenc-0.1.2.tar.xz 
tar xf vo-aacenc-0.1.2.tar 
cd vo-aacenc-0.1.2 
./configure 
make 
make install

安装VisualOn AMR-WB(注:github的tag和master版均无法autoconf,用zeranoe版代替)

wget http://ffmpeg.zeranoe.com/builds/source/external_libraries/vo-amrwbenc-0.1.2.tar.xz 
xz -d vo-amrwbenc-0.1.2.tar.xz 
tar xf vo-amrwbenc-0.1.2.tar 
cd vo-amrwbenc-0.1.2 
./configure

安装libvpx(注:新版libvpx貌似与当前ffmpeg不兼容,用旧版)

wget http://webm.googlecode.com/files/libvpx-v1.1.0.tar.bz2 
tar jxf libvpx-v1.1.0.tar.bz2 
cd libvpx-v1.1.0 
./configure 
make 
make install

安装x264

wget ftp://ftp.videolan.org/pub/x264/snapshots/last_x264.tar.bz2 
tar jxf last_x264.tar.bz2 
cd x264-snapshot-20130311-2245/ 
./configure –enable-shared 
make 
make install

安装xvid

wget http://downloads.xvid.org/downloads/xvidcore-1.3.2.tar.gz 
tar zxf xvidcore-1.3.2.tar.gz 
cd xvidcore 
cd build/generic 
./configure 
make 
make install

最重要的一步——编译安装ffmpeg!

wget http://ffmpeg.org/releases/ffmpeg-1.1.3.tar.gz 
tar zxf ffmpeg-1.1.3.tar.gz 
cd ffmpeg-1.1.3 
PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/lib64/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig ./configure –disable-static –enable-shared –enable-gpl –enable-version3 –enable-bzlib –enable-fontconfig –enable-frei0r –enable-gnutls –enable-libfreetype –enable-libmp3lame –enable-libopencore-amrnb –enable-libopencore-amrwb –enable-libopus –enable-librtmp –enable-libschroedinger –enable-libsoxr –enable-libspeex –enable-libtheora –enable-libtwolame –enable-libvo-aacenc –enable-libvo-amrwbenc –enable-libvorbis –enable-libvpx –enable-libx264 –enable-libxvid –enable-zlib 
make 
make install

注1:

我在编译安装时参考Windows Build:http://ffmpeg.zeranoe.com/builds/。

注2:

与Windows Build相比,以下没有选项开启:

–enable-libgsm –enable-libilbc -enable-libass –enable-libbluray –enable-libcaca –enable-libopenjpeg –disable-w32threads –enable-avisynth –enable-libxavs




(责任编辑:IT)
------分隔线----------------------------
栏目列表
推荐内容