当前位置:   article > 正文

macOS 安装brew和ffmpeg_mac brew ffmpeg

mac brew ffmpeg

terminal中运行:

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
  • 1

我选择的清华大学的源。

brew install ffmpeg
  • 1

报错:

fatal: not in a git directory
Error: Command failed with exit 128: git
  • 1
  • 2

原因请看brew -v,不安全的repository。

% brew -v
Homebrew 3.5.10-129-g79c6ab2
fatal: unsafe repository ('/opt/homebrew/Library/Taps/homebrew/homebrew-core' is owned by someone else)
To add an exception for this directory, call:

	git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-core
Homebrew/homebrew-core (no Git repository)
fatal: unsafe repository ('/opt/homebrew/Library/Taps/homebrew/homebrew-cask' is owned by someone else)
To add an exception for this directory, call:

	git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-cask
Homebrew/homebrew-cask (no Git repository)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12

调用提示中的git config --global --add safe.directory homebrew-core目录git config --global --add safe.directory homebrew-cask目录即可。
再次运行brew install ffmpeg ,安装成功。

% ffmpeg
ffmpeg version 5.1.1 Copyright (c) 2000-2022 the FFmpeg developers
  built with Apple clang version 13.1.6 (clang-1316.0.21.2.5)
  • 1
  • 2
  • 3

ffmpg把m3u8转码为mp4:

ffmpeg -i "https://xx.ts.m3u8?ver=4" out.mp4
  • 1
本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/544559
推荐阅读
相关标签
  

闽ICP备14008679号