FFmpeg环境搭建

1、从github上下载ffmpeg源码,首先安装yasm,否则运行 ./configure 会报下面的错误:

N85-87HP6:~/opensource/FFmpeg-release-4.1$ ./configure 
nasm/yasm not found or too old. Use --disable-x86asm for a crippled build.

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.

安装yasm步骤,源码下载地址http://yasm.tortall.net/Download.html

tar -xvzf yasm-1.3.0.tar.gz
cd yasm-1.3.0/
./configure
make
make install

2、返回ffmpeg源码目录,编译安装

./configure --enable-shared --prefix=/home/xxxxxx/ffmpeg
make
make install

3、配置环境
将lib目录加载到链接到系统库中,系统ld目录列表在/etc/ld.so.conf中,打开文件会发现,里面引用了/etc/ld.so.conf.d/下面所有的.conf文件,只需要创建一个文件并写入lib路径即可,
执行命令: vim /etc/ld.so.conf.d/ffmpeg.conf
然后添加一行内容: /home/xxxxxx/ffmpeg/lib 之后保存并退出,然后执行 ldconfig 使配置生效
在这里插入图片描述
通过命令查看ffmpeg安装情况:
在这里插入图片描述
4、使用命令行工具 ffmpeg -i 59cbb31588870.mp4 59cbb31588870.avi

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值