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
相关推荐
不羁的木木4 小时前
MacOS 安装 OpenClaw 并接入飞书机器人(保姆级教程 + 常见问题解决)
macos·机器人·飞书
AuLuo-4 小时前
openclaw(小龙虾)本地安装部署MAC版本homebrew)
macos
DvLee10245 小时前
让旧Mac再战几年:使用 OpenCore Legacy Patcher 升级不支持的 macOS(完整教程)
macos·macbook·opencore
一只小白菜5 小时前
在 macOS 上配置 OpenClaw 连接本地 Ollama 完整指南
macos
一乐小哥6 小时前
Zsh 与 Bash 配置文件:用法、区别、迁移
macos·shell
黄昏贩卖机7 小时前
mac M芯片安装pytorch
人工智能·pytorch·macos
EZ_Python7 小时前
如何在 Windows 上将 Python 脚本打包为 macOS 原生应用
windows·python·macos
l1t7 小时前
使用ffmpeg把英语四级听力MP3文件转成wav供模型识别
ffmpeg·语音识别
NGBQ121387 小时前
Keep It 2.7.10 全解析:Mac 端专业笔记管理工具深度指南
笔记·macos
米 柴8 小时前
Mac电脑配置环境变量
macos