Overview
The FFmpeg module ensures FFmpeg is available for video processing and composition. It automatically downloads a static FFmpeg build when needed.Functions
ensureFfmpeg
Ensures FFmpeg is available, downloading it if necessary.Path to the FFmpeg executable.
- Returns
FFMPEG_PATHenvironment variable if set - Checks
FFMPEG_CACHE_DIRfor a previously downloaded build - Downloads the appropriate FFmpeg build for your platform
- Falls back to system-installed FFmpeg if download fails
Constants
FFMPEG_CACHE_DIR
Directory where FFmpeg binaries are cached.~/.webreel/bin/ffmpeg.
Platform Support
FFmpeg is automatically downloaded from trusted sources:macOS (Intel and Apple Silicon)
Builds from evermeet.cx, which is linked from the official FFmpeg website. Apple Silicon Macs run the Intel build via Rosetta 2.Linux (x64 and arm64)
Builds from BtbN/FFmpeg-Builds, which are:- Linked from the official FFmpeg website
- Built via GitHub Actions with reproducible builds
- GPL-licensed with all codecs enabled
Windows (x64)
Builds from BtbN/FFmpeg-Builds with the same guarantees as Linux.Environment Variables
| Variable | Description |
|---|---|
FFMPEG_PATH | Path to an FFmpeg executable to use instead of downloading |
Usage in Composition
The Recorder and compose functions automatically call ensureFfmpeg internally. You typically don’t need to call it directly:Direct Usage
If you need to run FFmpeg commands directly:Cache Management
FFmpeg binaries are cached in~/.webreel/bin/ffmpeg/ to avoid repeated downloads. To force a fresh download:
Binary Details
The downloaded FFmpeg builds include:- All common codecs (H.264, H.265, VP9, AV1, etc.)
- Hardware acceleration support where available
- Full filter support for complex compositions
- Static linking for portability