linux如何编译ffmpeg,Linux编译ffmpeg

编译:(更多参数见./configure --help):最终编译完成后位于/usr/local/ffmpeg下

cd ffmpeg

#可选参数 --disable-static --enable-shared :默认配置是生成静态链接库so,添加此配置即生成动态库

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

make -j 4

make install

编译出现的错误:

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.

//未安装gcc:

sudo apt-get install gcc

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是汇编编译器,ffmpeg为了提高效率使用了汇编指令,如MMX和SSE等。所以系统中未安装yasm

sudo apt install yasm

缺少make:

sudo apt install make

在home或者etc目录下的.profile文件中进行环境配置:

配置path:

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

配置pkg_config_path:

export PKG_CONFIG_PATH=/usr/local/ffmpeg/lib/pkgconfig

配置完成后要source .profile生效配置:具体可以通过echo $PATH查看是否生效,pkg同理。

make install完成后就会在指定目录生成编译后资源(/usr/local/ffmpeg)

a74d67aa8892

image.png

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值