mac下编译ffmpeg

1、源码地址下载

下载地址
git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg

2、进入下载目录

cd ffmpeg目录

3、configure配置

./configure --prefix=/usr/local/ffmpeg --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libx264 --enable-libx265 --enable-filter=delogo --enable-debug --disable-optimizations --enable-libspeex --enable-videotoolbox --enable-shared --enable-pthreads --enable-version3 --enable-ffplay --enable-hardcoded-tables --cc=clang --host-cflags= --host-ldflags= --disable-x86asm

4、编译

执行make命令进行编译。

make

5、进行ffmpeg的安装

make install

6、编译过程中错误

6.1、ERROR: libfdk_aac not found
6.1.1、库未安装
  源码方式编译安装

git clone git://github.com/mstorsjo/fdk-aac
autoreconf -i
./configure
make&&make install

  brew 安装

brew install fdk-aac

6.1.2、库已安装
如果

6.2、ERROR: speex not found using pkg-config
查看日志 ffbuild/config.log

pkg-config --exists --print-errors speex
Package speex was not found in the pkg-config search path.
Perhaps you should add the directory containing `speex.pc'
to the PKG_CONFIG_PATH environment variable
No package 'speex' found
ERROR: speex not found using pkg-config

安装speex

brew install speex

6.3、ERROR: libx264 not found
源码安装

git clone https://code.videolan.org/videolan/x264.git
./configure --enable-static --enable-shared --disable-asm --disable-avs
make&&make install

brew 安装

brew install x264

6.4、ERROR: x265 not found using pkg-config
brew 安装

brew install x265

6.5、编译ffplay需要sdl2的支持

brew  install sdl2

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值