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
相关推荐
aqi002 小时前
FFmpeg开发笔记(六十六)Windows给FFmpeg集成LC3音频的编码器liblc3
ffmpeg·音视频·直播·流媒体
2501_9222329415 小时前
Mac电脑 系统监测工具 System Dashboard Pro
macos
向上的车轮21 小时前
FFmpeg是什么?
ffmpeg
道剑剑非道21 小时前
QT开发技术【ffmpeg EVideo录屏软件 一】
开发语言·qt·ffmpeg
aqi001 天前
FFmpeg开发笔记(六十五)Linux给FFmpeg集成LC3音频的编码器liblc3
ffmpeg·音视频·直播·流媒体
大猩猩爱分享1 天前
Mac安装docker desktop
macos·docker
伊织code1 天前
pmset - 控制 macOS 系统电源、睡眠、唤醒与节能
macos·命令·电源·睡眠·节能·唤醒·pmset
serve the people1 天前
在mac上安装sh脚本文件
macos
莫邪博客1 天前
解决蓝牙MAC 地址倒序问题
macos
草明1 天前
macOS 查看当前命令行的ruby的安装目录
开发语言·macos·ruby