CentOS 6.X手动安装最新版ffmpeg和mencoder

一、准备所要用的包。放到centos的桌面

①ffmpeg-3.1.tar.gz

下载地址:https://ffmpeg.org/download.html#releases

②lame-3.99.5.tar.gz

下载地址:https://sourceforge.net/projects/lame/files/lame/3.99/

③MPlayer-1.3.0.tar.gz

下载地址:http://www.mplayerhq.hu/MPlayer/releases/

④x264-snapshot-20161014-2245.tar.bz2

下载地址:ftp://ftp.videolan.org/pub/videolan/x264/snapshots/(我用的)

或者官网:http://www.videolan.org/developers/x264.html

⑤xvidcore-1.3.4.tar.gz

下载地址:http://downloads.xvid.org/downloads/xvidcore-1.3.4.tar.gz

⑥yasm-1.3.0.tar.gz

下载地址:http://yasm.tortall.net/Download.html

⑦libpng-1.2.43.tar.bz2

下载地址:http://download.chinaunix.net/download/0006000/5976.shtml

⑧zlib-1.2.8.tar.gz

下载地址:http://www.zlib.net/

或者:http://download.chinaunix.net/download/0013000/12241.shtml

二、进入root用户的Terminal,安装所下载的包。(务必按顺序安装)

①安装lame

    cd /root/Desktop/

    tar -zxvf lame-3.99.5.tar.gz -C /usr/

    cd /usr/lame-3.99.5/

    ./configure

    Make && make install

②安装x264, 提示yasm可先安装yasm。

    cd /root/Desktop/

    tar -jxvf x264-snapshot-20161014-2245.tar.bz2 -C /usr/

    cd /usr/x264-snapshot-20161014-2245/

    ./configure –enable-shared

    Make && make install

③安装xvid

    cd /root/Desktop/

    tar -zxvf xvidcore-1.3.4.tar.gz -C /usr/

    cd /usr/xvidcore-1.3.4/build/generic

    ./configure

    Make && make install

④安装yasm

    cd /root/Desktop/

    tar -zxvf yasm-1.3.0.tar.gz -C /usr/

    cd /usr/yasm-1.3.0/

    ./configure

    Make && make install

⑤安装zlib(一定要先安装zlib,才能安装libpng。否则安装libpng会报错)

cd /root/Desktop/

tar -zxvf zlib-1.2.8.tar.gz -C /usr/

    cd /usr/zlib-1.2.8/

    ./configure

    Make && make install

⑥安装libpng

cd /root/Desktop/

tar -jxvf libpng-1.2.43.tar.bz2 -C /usr/

    cd /usr/libpng-1.2.43/

    ./configure

    Make && make install

⑦安装Mplayer(内包含mencoder所以无需重新安装)

cd /root/Desktop/

tar -zxvf MPlayer-1.3.0.tar.gz -C /usr/

    cd /usr/MPlayer-1.3.0/

    ./configure

    Make && make install

⑧安装ffmpeg

cd /root/Desktop/

tar -zxvf ffmpeg-3.1.tar.gz -C /usr/

    cd /usr/ ffmpeg-3.1/

    ./configure --enable-shared --enable-gpl --enable-libx264 --enable-libxvid --enable-zlib --enable-libmp3lame

    Make && make install

三、安装完后运行命令报错情况。

    ①tmux: error while loading shared libraries: libxvidcore.so.4: cannot open shared object file: No such file or directory

原因:一种是操作系统里没有该共享库,二种是该共享库安装了,但是运行命令却报错。

    第一种需要自行下载所要的库。比如现在我的就是没有下载xvid库。

    第二种就是用命令找到该文件的位置。如:find / -name libxvidcore.so.4显示出目录为:/usr/local/lib/libxvidcore.so.4。然后将该目录(而不是文件)加载到共享库配置文件。具体命令如下:

# cat /etc/ld.so.conf
# echo "
/usr/local/lib/" >> /etc/ld.so.conf
# ldconfig

②具体安装时错误,请查看该文件下的config.log。

四、查看mencoder支持转码格式。

    ①支持音频格式:mencoder -oac help

    ②支持视频格式:mencoder -ovc help

 

五、自动安装方法。

1、将安装包都放到CentOS的root根目录下。

2、将ffmpeg_mencoder_install.sh放到CentOS的桌面。

3、打开Teriminal运行source /root/Desktop/ffmpeg_mencoder_install.sh 命令,即可。

4、等待命令执行完成即可。

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值