【环境问题解决】mac上通过homebrew安装ffpmeg关联第三方库时报错

问题:

直接用如下brew命令安装ffmpeg,并用--with-带上若干关联的库,执行会得到错误信息

brew install ffmpeg --with-fdk-aac --with-libass --with-sdl2 --with-webp --with-x265 --with-opus --with-freetyp

报错:


image.png

解决方案--源码安装

#下载源码
git clone https://git.ffmpeg.org/ffmpeg.git  
cd ffmpeg
#进行ffmpeg的编译前配置
./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-hardcoded-tables --enable-libfreetype --enable-libfontconfig --cc=clang --host-cflags= --host-ldflags= --disable-x86asm  

#编译
make
#安装
sudo make install

检查是否安装成功

进入到/usr/local/ffmpeg/bin,如果有ffmpeg、ffmplay、ffprobe,则安装成功


image.png

将/usr/local/ffmpeg/bin加入到环境变量

open ~/.zshrc

#增加一行
export PATH=$PATH:/usr/local/ffmpeg/bin
source ~/.zshrc
#测试是否正常
ffmpeg -h
image.png

如截图问题解决!

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。