美文网首页
mac下编译ffmpeg

mac下编译ffmpeg

作者: sunjc53yy | 来源:发表于2020-06-15 07:39 被阅读0次

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

参考:https://www.imooc.com/article/253497

相关文章

网友评论

      本文标题:mac下编译ffmpeg

      本文链接:https://www.haomeiwen.com/subject/kuitvhtx.html