CentOS 6.5安装部署FFmpge切片环境

Linux下ffmpeg的安装


首先要安装各种解码器

1、lame
lame-3.99.5.tar.gz
Url:http://sourceforge.net/project/showfiles.php?group_id=290&package_id=309
安装方法如下:

1     tar -zxvf lame-3.99.5.tar.gz  
2     cd lame-3.99.5  
3     ./configure --enable-shared 
4     make  
5     make install


2、libogg
libogg-1.3.1.tar.gz
Url:http://www.xiph.org/downloads/
安装方法如下:

1    tar xf libogg-1.3.1.tar.gz
2    cd libogg-1.3.1
3    ./configure
4    make && make install


3、libvorbis
libvorbis-1.3.3.tar.gz
Url:http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.3.tar.gz

(libvorbis依赖于libogg, 所以libogg必须先于libvorbis安装)
安装方法如下:

1    tar xf libvorbis-1.3.3.tar.gz 
2    cd libvorbis-1.3.3
3    ./configure 
4     make  
5     make install


4、xvid
xvidcore-1.3.2.tar.gz
Url:http://downloads.xvid.org/downloads/xvidcore-1.3.2.tar.gz
安装方法如下:

1    tar xf xvidcore-1.3.2.tar.gz 
2    cd xvidcore-1.3.2
3    ./configure
4    make && make install


5、x264
latest_x264.tar.bz2 (其中包含的目录是 x264-snapshot-20131023-2245)
Url:http://www.videolan.org/developers/x264.html
ftp://ftp.videolan.org/pub/videolan/x264/snapshots/
安装方法如下:

先安装:yasm,
下载yasm    http://yasm.tortall.net/Download.html

1    tar xf yasm.tar.gz
2    cd yasm
3    ./configure
4    make && make install

latest安装方法如下:

1    tar xf latest_x264.tar.bz2
2    cd latest_x264
3    ./configure
4    make && make install


6、libdts
libdca-0.0.5.tar.bz2
Url: http://www.videolan.org/developers/libdca.html
安装方法

1    ./configure
2    make && make install


7、a52
a52dec-0.7.4.tar.gz           (这个库从2002年就没有更新过了)
http://liba52.sourceforge.net/downloads.html      
安装方法:

1    ./configure
2    make && make install


8、faad2
faad2-2.7.tar.gz
http://www.audiocoding.com/downloads.html
安装方法

1    ./configure
2    make && make install


9、faac
faac-1.28.tar.gz
http://www.audiocoding.com/downloads.html
安装方法:

1    ./configure
2    make && make install

注:在安装make时会报错,需做以下处理:
注释掉faac-1.28/common/mp4v2/mpeg4ip.h 里的第126行
char *strcasestr(const char *haystack, const char *needle);


10、amr-nb
amrnb-11.0.0.0.tar.bz2
http://ftp.penguin.cz/pub/users/utx/amr/ ( 从此处下载最新版本 )
安装方法:

先安装patch:

1    yum -y install patch
2    tar xf amrnb-11.0.0.0.tar.bz2 
3    cd amrnb-11.0.0.0
4    ./configure
5    make && make install


11、amr-wb
amrwb-7.0.0.1.tar.bz2
http://ftp.penguin.cz/pub/users/utx/amr/ ( 从此处下载最新版本 )
安装方法:

1    ./configure
2    make && make install


12、最关键的一步, 安装ffmpeg

 下载地址:http://www.ffmpeg.org/download.html

1   ./configure --prefix=/usr/local/ffmpeg2 --enable-libmp3lame --enable-libvorbis --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libxvid --enable-postproc --enable-ffserver --enable-ffplay
2   make  
3   make install

在./configure的时候会报错, 提示说没有libopencore-amrnb和libopencore-amrwb两个库. 我参考了 [2], 使用如下命令安装它们:

sudo apt-get install libopencore-amrnb-dev libopencore-amrwb-dev

如果./configure的时候加入 --enable-shared, 编译安装没有问题. 但是运行ffmpeg命令就会出错:

relocation error: /usr/local/lib/libavfilter.so.3: symbol sws_get_class, version LIBSWSCALE_2 not defined in file libswscale.so.2 with link time reference;

这时可以参考 [3], 大意是说跟gstreamer的动态库冲突了, 要卸载gstreamer. 但是如果卸载了gstreamer我的多媒体软件多不能用了. 所以我卸载了ffmpeg并重新编译成静态库. 安装完之后, 运行ffmpeg成功, 输出如下:

ffmpeg version 2.0.1 Copyright (c) 2000-2013 the FFmpeg developers                                                      
  built on Oct 25 2013 17:40:51 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)                                              
  configuration: --prefix=/usr/local/ffmpeg2 --enable-libmp3lame --enable-libvorbis --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libxvid --enable-postproc --enable-ffserver --enable-ffplay
  libavutil      52. 38.100 / 52. 38.100
  libavcodec     55. 18.102 / 55. 18.102
  libavformat    55. 12.100 / 55. 12.100
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 79.101 /  3. 79.101
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...


本文出自 “Elephant” 博客,请务必保留此出处http://zlyang.blog.51cto.com/1196234/1709347

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值