SuperAPI AI Directory

ffmpeg-install

General & other

View repository

Updated 10-15 17:34

About this skill

FFmpeg installation and checking skill

Goal: Quickly check and install FFmpeg, supporting major platforms such as macOS, Linux, Windows

Check whether FFmpeg is already installed

# 检查 FFmpeg 命令是否存在
if command -v ffmpeg &> /dev/null; then
    echo "FFmpeg 已安装"
    ffmpeg -version
else
    echo "FFmpeg 未安装,请按下方说明安装"
fi

macOS installation

# 使用 Homebrew 安装(推荐)
brew install ffmpeg

# 或者安装完整版(包含更多编解码器)
brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-libass --with-libquvi --with-libvorbis --with-libvpx --with-opus --with-x265

# 验证安装
ffmpeg -version

Linux installation

Ubuntu/Debian

# 更新软件包列表
sudo apt update

# 安装 FFmpeg
sudo apt install ffmpeg

# 验证安装
ffmpeg -version

CentOS/RHEL

# 安装 EPEL 源
sudo yum install epel-release

# 安装 FFmpeg
sudo yum install ffmpeg ffmpeg-devel

# 验证安装
ffmpeg -version

Arch Linux

# 安装 FFmpeg
sudo pacman -S ffmpeg

# 验证安装
ffmpeg -version

Windows installation

Method 1: Use Chocolatey (recommended)

# 安装 Chocolatey(如果未安装)
# 以管理员身份运行 PowerShell,执行:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

# 安装 FFmpeg
choco install ffmpeg

# 验证安装
ffmpeg -version

Method 2: Use Scoop

# 安装 Scoop(如果未安装)
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression

# 添加 extras 仓库
scoop bucket add extras

# 安装 FFmpeg
scoop install ffmpeg

# 验证安装
ffmpeg -version

Method 3: Manual installation

  1. Visit https://ffmpeg.org/download.html
  2. Download the Windows version of FFmpeg
  3. Extract to a directory (e.g., C:\ffmpeg)
  4. Add C:\ffmpeg\bin to the system PATH environment variable
  5. Restart the terminal and verify the installation:ffmpeg -version

Verify installation

# 查看 FFmpeg 版本
ffmpeg -version

# 查看 FFmpeg 支持的编解码器
ffmpeg -codecs

# 查看 FFmpeg 支持的格式
ffmpeg -formats

# 运行简单测试
ffmpeg -h

Common issues

macOS: brew command not found

# 安装 Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Linux: Permission denied

# 使用 sudo 运行
sudo apt install ffmpeg

Windows: Command not recognized

  • Make sure the FFmpeg bin directory has been added to PATH
  • Restart the terminal or command prompt
  • Verify:echo %PATH% (Windows) or echo $PATH (macOS/Linux)