macOS 安装brew和ffmpeg
Posted lilongsy
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了macOS 安装brew和ffmpeg相关的知识,希望对你有一定的参考价值。
在terminal
中运行:
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
我选择的清华大学的源。
brew install
报错:
fatal: not in a git directory
Error: Command failed with exit 128: git
原因请看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)
调用提示中的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)
ffmpg把m3u8转码为mp4:
ffmpeg -i "https://xx.ts.m3u8?ver=4"
以上是关于macOS 安装brew和ffmpeg的主要内容,如果未能解决你的问题,请参考以下文章