ffmpeg linux 慢_FFMPEG系列二:linux下下载编译安装ffmpeg(超详细附采坑完整版)

此步骤也可以使用git clone下载源码包,本质上是一样的

二、使用xftp将源码包ffmpeg-4.0.tar.xz上传至linux主机(直接使用linux命令下载到linux也可以)

三、将上传至/usr/local/ffmpeg的源码包解压

cd /usr/local/ffmpeg

tar xvJf ffmpeg-4.0.tar.xz

四、 进入解压后目录,输入如下命令/usr/local/ffmpeg为自己指定的安装目录

cd ffmpeg-4.0

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

gcc is unable to create an executable file.

If gcc is a cross-compiler, use the --enable-cross-compile option.

Only do this if you know what cross compiling means.

C compiler test failed.

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.

[csy@root@instance-m4tjyg0q ffmpeg-4.0]#

五、解决报错gcc is unable to create an executable file C compiler test failed.之后再次执行之前的命令

cd ffmpeg-4.0

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

回车之后,可能会等待一段时间,耐心等候

六、执行make(编译)

make

此过程有点久,会编译各个库文件

七、执行make install(安装)

八、安装之后,执行

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

九、解决上述问题之后

再次输入/usr/local/ffmpeg/installlocation/bin/ffmpeg --version 又报错

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

提示库文件找不到 修改文件/etc/ld.so.conf 内容增加/usr/local/ffmpeg/lib/ vim /etc/ld.so.conf 输入i才能插入编辑

最后文件内容是

include ld.so.conf.d/*.conf

/usr/local/ffmpeg/lib/

添加之后按esc再:wq保存退出。

再输入ldconfig使修改生效。

这样错误就解决了,再回答第八步输入 /usr/local/ffmpeg/installlocation/bin/ffmpeg --version

可见ffmpeg安装成功,接下来配置环境变量 path(不配置的haul只能每次cd /usr/local/ffmpeg/installlocation/bin/ 才能执行命令)

第十步:配置ffmpeg环境变量

详细查看:[linux下ffmpeg -bash: ffmpeg: command not found及环境变量设置]()

十一步:测试

cd到有gif文件的目录 cd /usr/local/java/apache-tomcat-8.5.24/webapps/it399/src/ffmpeg/temp/gif2video

输入命令 ffmpeg -f gif -i test.gif test.mp4 回车之后输入命令或者xftp客户端查看该目录下文件,可见已经成功将test.gif转成了test.mp4

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值