mac编译ffmpeg

- code:

bash 复制代码
git clone https://git.ffmpeg.org/gitweb/ffmpeg.git

- 编译安装

https://trac.ffmpeg.org/wiki/CompilationGuide

- 使用homebrew安装dependency

bash 复制代码
brew install automake fdk-aac git lame libass libtool libvorbis libvpx \
opus sdl shtool texi2html theora wget x264 x265 xvid nasm openssl rtmpdump

其中,

  • ​x264 encodes H.264 video. Use --enable-gpl --enable-libx264.
  • ​fdk-aac encodes AAC audio. Use --enable-libfdk-aac.
  • ​libvpx is a VP8 and VP9 encoder. Use --enable-libvpx.
  • ​libvorbis encodes Vorbis audio . Requires ​libogg. Use --enable-libvorbis.
  • ​libopus encodes Opus audio.
  • ​LAME encodes MP3 audio. Use --enable-libmp3lame.
  • ​libass is a subtitle renderer. Use --enable-libass.
  • openssl and rtmpdump is used for --enable-librtmp.

- configure

因为`openssl安装在/usr/local/opt/openssl@3/`文件夹下,`pkg-config --list-all | grep ssl`找不到libssl, 所以添加PKG_CONFIG_PATH:`export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/opt/openssl@3//lib/pkgconfig`

bash 复制代码
./configure  --prefix=/usr/local/ffmpeg --enable-openssl --enable-librtmp --enable-gpl --enable-nonfree --enable-libass \
--enable-libfdk-aac --enable-libfreetype --enable-libmp3lame \
--enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libopus --enable-libxvid --samples=fate-suite

出错查看ffbuild/config.log,有具体的错误原因

- make and install

bash 复制代码
make
sudo make install
相关推荐
树下水月10 小时前
关于使用ffmpeg的一些使用方法
ffmpeg
憧憬成为原神糕手15 小时前
FFmpeg 音视频开发笔记(一):H.264 解码为 YUV
笔记·ffmpeg·音视频
阳光开朗男孩19 小时前
FFmpeg从入门到精通-1.ffmpeg简介
ffmpeg
pop_xiaoli1 天前
【iOS】SDWebImage源码
macos·ios·objective-c·cocoa
时空自由民.1 天前
ESP ADF音频篇章
macos·音视频·xcode
lijfrank2 天前
Mac卸载NTFS工具后无法读取硬盘?我的2天排错心路与终极解决方案
macos·ntfs
吃鱼的灰太狼2 天前
Mac本地部署大模型|Ollama+Gemma4/Qwen3.5新手零失败教程,彻底告别Token消耗✨
macos
代码的小搬运工2 天前
Masonry学习
学习·macos·cocoa
yangSnowy2 天前
mac系统安装hyperf框架swoole扩展
后端·macos·swoole
EVE จุ๊บ3 天前
如何修改mac上的jmeter堆内存
jmeter·macos