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
相关推荐
浩瀚之水_csdn14 小时前
avcodec_parameters_copy详解
linux·人工智能·ffmpeg
开发者导航2 天前
【开发者导航】多功能生成模型开发工具:Diffusers 详细介绍
人工智能·python·学习·macos·信息可视化
未名编程3 天前
Linux / macOS / Windows 一条命令安装 Node.js + npm(极限一行版大全)
linux·macos·node.js
was1723 天前
使用 Mole 进行 macOS 深度清理与系统优化
macos·系统清理·cli 工具
TheMemoryIsLost3 天前
mac系统装docker,不装docker desktop,安装colima
macos·docker·容器
红叶尽染寂绀蓝4 天前
已解决:同一ip下,Mac和Windows同时用vscode连接某个Linux远程服务器后,Mac再次连接时无法正确打开远程文件夹,由于转发设置导致
linux·服务器·windows·vscode·tcp/ip·macos
qq_24218863324 天前
快速搭建跨环境检测服务的步骤
linux·开发语言·windows·python·macos
带娃的IT创业者5 天前
解密OpenClaw系列10-OpenClaw系统要求
人工智能·macos·ios·objective-c·ai智能体·智能体开发·openclaw
不吃鱼的猫7485 天前
【ffplay 源码解析系列】02-核心数据结构详解
c++·ffmpeg·音视频