CentOS7部署ffmpeg及各种编码器

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/s295580857/article/details/70262780

FFmpeg 是什么?


FFmpeg是一个开源免费跨平台的视频和音频流方案,属于自由软件,采用LGPL或GPL许可证(依据你选择的组件)。它提供了录制、转换以及流化音视频的完整解决方案。它包含了非常先进的音频/视频编解码库libavcodec,为了保证高可移植性和编解码质量,libavcodec里很多codec都是从头开发的。
FFmpeg在Linux平台下开发,但它同样也可以在其它操作系统环境中编译运行,包括Windows、Mac OS X等。
FFmpeg是一套可以用来记录、转换数字音频、视频,并能将其转化为流的开源计算机程序。它包括了目前领先的音/视频编码库libavcodec。


所需包下载:

lame-3.99.5.tar.gz
下载地址:http://download.csdn.net/detail/tonylllz/8130303

===

libogg-1.1.3.tar.gz
下载地址:http://download.csdn.net/detail/tonylllz/8140185

===

libvorbis-1.1.2.tar.gz
下载地址:http://download.csdn.net/detail/tonylllz/8140981

===

xvidcore-1.1.3.tar.gz
下载地址:http://download.csdn.net/detail/tonylllz/8130305

===

yasm-1.2.0.tar.gz
下载地址:http://download.csdn.net/detail/tonylllz/8141119

===

last_x264.tar.bz2
下载地址:http://download.csdn.net/detail/tonylllz/8130309

===

libdca-0.0.2.tar.gz
下载地址:http://download.csdn.net/detail/tonylllz/8140985

===

a52dec-0.7.4.tar.gz
下载地址:http://download.csdn.net/detail/tonylllz/8141129

===

faad2-2.7.tar.gz
下载地址:http://download.csdn.net/detail/tonylllz/8141143

===

faac-1.28.tar.gz
下载地址:http://downloads.sourceforge.net/faac/faac-1.28.tar.gz

===

amrnb-11.0.0.0.tar.bz2
下载地址:http://download.csdn.net/detail/tonylllz/8141183

===

amrwb-11.0.0.0.tar.bz2
下载地址:http://download.csdn.net/detail/tonylllz/8141001

===

opencore-amr-0.1.5.tar.gz(编译ffmpeg时会有报错,所以这个包须在ffmpeg前安装)
下载地址:http://sourceforge.net/projects/opencore-amr/files/opencore-amr/

===

ffmpeg-2.4.3.tar.bz2
下载地址:http://download.csdn.net/detail/tonylllz/8130313

===

安装解码器

lame-3.99.5.tar.gz

tar zxvf  lame-3.99.5.tar.gz  
cd lame-3.99.5  
./configure --enable-shared --prefix=/usr  
make && make install

libogg-1.1.3.tar.gz

tar zxvf libogg-1.1.3.tar.gz  
cd libogg-1.1.3  
./configure --prefix=/usr   
make && make install

libvorbis-1.1.2.tar.gz

tar zxvf libvorbis-1.1.2.tar.gz  
cd libvorbis-1.1.2  
./configure --prefix=/usr  
make && make install

xvidcore-1.1.3.tar.gz

tar zxvf xvidcore-1.1.3.tar.gz  
cd xvidcore-1.1.3/build/generic    
./configure --prefix=/usr  
make && make install

在安装 x264时,在进行环境配置时,系统提示配置不成功,因为x264需要使用yasm进行编译,而且yasm版本至少为1.2,故必须先安装yasm

yasm-1.2.0.tar.gz

mkdir -p /usr/local/bin/yasm
tar zxvf yasm-1.2.0.tar.gz  
cd yasm-1.2.0  
./configure --prefix=/usr/local/bin/yasm PATH=$PATH:/usr/local/bin/yasm/bin  
make && make install

last_x264.tar.bz2

tar jxvf last_x264.tar.bz2  
cd x264-snapshot-20141105-2245  
 ./configure --prefix=/usr --enable-shared  --disable-asm  
make && make install

libdca-0.0.2.tar.gz

tar zxvf libdca-0.0.2.tar.gz  
cd libdts-0.0.2  
./configure --prefix=/usr  
make && make install

a52dec-0.7.4.tar.gz

tar zxvf a52dec-0.7.4.tar.gz  
cd a52dec-0.7.4  
./configure --prefix=/usr  
make && make install

faad2-2.7.tar.gz

tar zxvf faad2-2.7.tar.gz  
cd faad2-2.7  
autoreconf -vif  
./configure --prefix=/usr --with-mp4v2 --enable-shared  
make && make install

faac-1.28.tar.gz

tar zxvf faac-1.28.tar.gz  
cd faac-1.28  
./bootstrap  
./configure --prefix=/usr  
make && make install

amrnb-11.0.0.0.tar.bz2

tar jxvf amrnb-11.0.0.0.tar.bz2  
cd amrnb-11.0.0.0  
 ./configure --prefix=/usr --enable-shared  
make && make install

amrwb-11.0.0.0.tar.bz2

tar jxvf amrwb-11.0.0.0.tar.bz2  
cd amrwb-11.0.0.0  
./configure --prefix=/usr  
make && make install

opencore-amr-0.1.5.tar.gz

tar zxvf opencore-amr-0.1.5.tar.gz
cd opencore-amr-0.1.5
./configure
make && make install

ffmpeg-2.4.3.tar.bz2

tar jxvf ffmpeg-2.4.3.tar.bz2
cd ffmpeg-2.4.3
./configure --prefix=/usr --enable-gpl --enable-shared --enable-libmp3lame  --enable-libvorbis --enable-libopencore-amrnb  --enable-libopencore-amrwb --disable-yasm --enable-version3 --enable-nonfree --enable-libx264 --enable-libfaac
make && make install
可能出现的错误消息:

1.ffmpeg: error while loading shared libraries: libavdevice.so.56: cannot open shared object file: No such file or directory


此情况是因为ffmpeg未找到相关依赖包,可以通过以下方法解决:
先find / -type f -name libavdevice.so.56 得到该文件的目录地址;
然后 vim /etc/ld.so.conf 将上述目录添加到最后一行并保存退出;
再 ldconfig 使配置生效,即可;

猜你喜欢

转载自blog.csdn.net/s295580857/article/details/70262780