centos6.3安装ffmpeg+x264

一.编译安装过程

注意是参考[1],但有问题。

  1. 安装nasm
    wget https://www.nasm.us/pub/nasm/releasebuilds/2.14/nasm-2.14.tar.gz
    tar xvf nasm-2.14.tar.gz
    cd nasm-2.14/
    ./configure --enable-shared --prefix=/home/work/zxc/video_install/ffmpeg/x64/
    make && make install
    export PATH=$PATH:/home/work/zxc/video_install/ffmpeg/x64/bin
    或者修改/etc/profile,执行source /etc/profile
  2. 安装x264
    wget http://download.videolan.org/pub/videolan/x264/snapshots/last_stable_x264.tar.bz2
    bzip2 -d last_stable_x264.tar.bz2
    tar -xvf last_stable_x264.tar
    cd x264-snapshot-20181112-2245-stable/
    ./configure --enable-shared --prefix=/home/work/zxc/video_install/ffmpeg/x64/
    make && make install
  3. 安装ffmpeg
    wget https://ffmpeg.org/releases/ffmpeg-4.1.tar.bz2
    bzip2 -d ffmpeg-4.1.tar.bz2
    tar -xvf ffmpeg-4.1.tar
    cd ffmpeg-4.1/
    ./configure --enable-shared --enable-gpl --enable-libx264 --prefix=/home/work/zxc/video_install/ffmpeg/x64/ --extra-cflags=-I/home/work/zxc/video_install/ffmpeg/x64/include --extra-ldflags=-L/home/work/zxc/video_install/ffmpeg/x64/lib
    make && make install

二.ffmpeg编译安装报错

(1)执行ffmpeg报错, ffmpeg: error while loading shared libraries: libavdevice.so.55: cannot open shared object file: No such file or directory。
原因:没有添加编解码器库 ldconfig 路径
解决方法:参考[2],编辑/etc/ld.so.conf,然后执行ldconfig保存,我这里发现两个地方有libavdevice.so文件,都添加才执行ffmpeg成功。

# vim /etc/ld.so.conf
/usr/local/lib
/home/work/zxc/video_install/ffmpeg/x64/lib

另外,需要注意如果想用ffplay播放视频,是需要图形界面的,linux不支持。

三.references

[1] https://blog.csdn.net/smilefyx/article/details/32714743
[2] https://stackoverflow.com/questions/12901706/ffmpeg-error-in-linux ffmpeg出错解决

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值