Installation
FFmpeg CLI
macOS
bash
# Using Homebrew (recommended)
brew install ffmpeg
# Check version
ffmpeg -versionLinux
bash
# Debian / Ubuntu
sudo apt update && sudo apt install ffmpeg
# Fedora
sudo dnf install ffmpeg
# Arch Linux
sudo pacman -S ffmpegWindows
Option 1: Winget (recommended)
powershell
winget install ffmpegOption 2: Chocolatey
powershell
choco install ffmpegOption 3: Scoop
powershell
scoop install ffmpegOption 4: Manual
- Download from gyan.dev or BtbN builds
- Extract to
C:\ffmpeg - Add
C:\ffmpeg\binto PATH
Verify Installation
After installing, verify with:
bash
ffmpeg -version
ffprobe -versionBoth should output version information without errors.
Common Dependencies
For full codec support, install the full suite:
bash
# Ubuntu/Debian
sudo apt install ffmpeg libavcodec-extra
# macOS (Homebrew automatically includes most codecs)
brew install ffmpeg --with-all-codecsGPU Acceleration
NVIDIA (Linux/Windows)
bash
# Linux
sudo apt install nvidia-cuda-toolkit
# Verify hardware acceleration
ffmpeg -hide_banner -encoders | grep nvencmacOS VideoToolbox
bash
# macOS supports hardware encoding out of the box
ffmpeg -hide_banner -encoders | grep videotoolboxfluent-ffmpeg (Node.js)
bash
npm install fluent-ffmpeg
# or
yarn add fluent-ffmpeg
# or
bun add fluent-ffmpegRequires FFmpeg CLI to be installed on the system (the above packages).
@ffmpeg/core (Browser/WASM)
bash
npm install @ffmpeg/ffmpeg @ffmpeg/utilNo system FFmpeg required — everything runs in the browser via WebAssembly.
For Vite projects, add COOP/COEP headers for multi-thread support:
typescript
// vite.config.ts
export default {
server: {
headers: {
'Cross-Origin-Opener-Policy': 'same-origin',
'Cross-Origin-Embedder-Policy': 'require-corp',
}
}
}File Access
Browser FFmpeg cannot read local files directly. Use the File API:
javascript
const input = await fetchFile(fileInput.files[0])
await ffmpeg.writeFile('input.mp4', input)