FFMPEG安装教程

本文参考:

https://blog.csdn.net/makymilk/article/details/107400119

害怕链接失效,所以自己写一个备份。

一、下载安装包

git clone https://git.ffmpeg.org/ffmpeg.git  --config http.proxy= --config http.sslVerify=false

二、编译安装

进入刚才下载的ffmpeg目录

./configure --prefix=/usr/local/ffmpeg --enable-debug=3 --enable-shared --disable-static

指令解释:

--prefix=/user/local/ffmpeg指定目录

--enable-debug=3 调试等级

--enable-shared 生成动态库

--disable-static 不允许生成静态库

编译

make -j 4

安装

sudo make install

配置环境变量:

vim ~/.bashrc 
export PATH="$PATH:/usr/local/ffmpeg/bin"
source ~/.bashrc 

验证是否安装成功:

cluo@cluo:~/ffmpeg$ ffmpeg 
ffmpeg version N-106738-g3946cb02fc Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
  configuration: --prefix=/usr/local/ffmpeg --enable-debug=3 --enable-shared --disable-static
  libavutil      57. 24.101 / 57. 24.101
  libavcodec     59. 27.100 / 59. 27.100
  libavformat    59. 23.100 / 59. 23.100
  libavdevice    59.  6.100 / 59.  6.100
  libavfilter     8. 37.100 /  8. 37.100
  libswscale      6.  6.100 /  6.  6.100
  libswresample   4.  6.100 /  4.  6.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'

ok了

三、编译报错解决

错误:

nasm/yasm not found or too old. Use --disable-x86asm for a crippled build.

解决方法:需要安装yasm的汇编编译器

sudo apt-get install yasm

错误:

ffmpeg: error while loading shared libraries: libavdevice.so.58: cannot open shared object file: No such file or directory

解决方法:

vim ~/.bashrc
export LD_LIBRARY_PATH=/usr/local/ffmpeg/lib/
source  ~/.bashrc

错误:

 gcc is unable to create an executable file

解决方法:

sudo apt-get install gcc
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

永不秃头的程序员

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值