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
相关推荐
帅得不敢出门5 小时前
macOS苹果电脑运行向日葵远程控制软件闪退
windows·macos·远程控制·向日葵
夏小花花6 小时前
Mac m系列芯片向日葵打不开 解决方案
macos·mac
刹_那7 小时前
MAC 多个版本 JDK进行切换
macos
应凌云7 小时前
Mac环境Neovim 与 LazyVim 安装指南
macos
开开心心loky9 小时前
[iOS] ViewController 的生命周期
macos·ui·ios·objective-c·cocoa
2301_794333919 小时前
Docker Compose 运行 Milvus (Mac) 并与 python 连接测试
macos·docker·milvus
Sammyyyyy9 小时前
macOS是开发的终极进化版吗?
开发语言·macos·开发工具
pop_xiaoli10 小时前
OC-单例模式
macos·objective-c·cocoa
Magnetic_h16 小时前
【iOS】block复习
笔记·macos·ios·objective-c·cocoa
鹅毛在路上了1 天前
C++, ffmpeg, libavcodec-RTSP拉流,opencv实时预览
c++·opencv·ffmpeg