关于ffmpeg的安装详细步骤和说明

关于ffmpeg的安装详细步骤和说明



一、windows安装:

直接下载地址:

https://ffmpeg.zeranoe.com/builds/

https://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-20160316-git-d0a9114-win64-static.7z

解压后即可使用:


ffmpeg -i C:\ffmpeg\test.avi -b:v 640k c:\ffmpeg\output.ts



二、linux源码安装:

如下:

下载 源码包:ffmpeg-2.8.6.tar.bz2

1.从网络上下载到的源码包,然后解压到指目录 


  假设下载目录 /opt/soft

  cd /opt/soft

  解压包:

  tar -jxvf ffmpeg-2.8.6.tar.bz2

   进入解压后目录

  cd ffmpeg-2.8.6

 执行

./configure --enable-shared --prefix=/usr/local/ffmpeg

提示出错:

yasm/nasm not found or too old. Use --disable-yasm 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 "config.log" produced by configure as this will help
solve the problem.


按照提示需要安装yasm

使用如下
yum install yasm


安装完成后,继续执行

./configure --enable-shared --prefix=/usr/local/ffmpeg


时间比较长,需要等待几分钟

然后执行下面

make

make install

时间比较长,需要等待几分钟

执行过程没有报错,则成功安装

检查是否安装成功:


/usr/local/ffmpeg/bin/ffmpeg --version

报错如下:

/usr/local/ffmpeg/bin/ffmpeg: error while loading shared libraries: libavdevice.so.56: cannot open shared object file: No such file or directory


提示库文件找不到。

修改文件/etc/ld.so.conf 内容增加/usr/local/ffmpeg/lib/

vim /etc/ld.so.conf



include ld.so.conf.d/*.conf
/usr/local/ffmpeg/lib/


使修改生效

ldconfig


执行 /usr/local/ffmpeg/bin/ffmpeg --version

则返回



配置环境变量 path

export PATH=/usr/local/ffmpeg/bin/:$PATH

env

则在任何目录都可以执行 ffmpeg --version


测试执行转码:

ffmpeg -i test.avi -b:v 640k output.ts



=====================================================================
只测试了windows
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值