ff-sys
Low-level FFmpeg FFI bindings generated by bindgen. Not intended for direct use; use the higher-level ff-* crates instead.
Project status (as of 2026-03-26): This crate is in an early phase. The high-level API is designed and reviewed by hand; AI is used as an accelerator to implement FFmpeg bindings efficiently. Code contributions are not expected at this time — questions, bug reports, and feature requests are welcome. See the main repository for full context.
Installation Prerequisites
Before building any crate in this workspace, FFmpeg development libraries must be available on your system.
Windows
Install FFmpeg via vcpkg:
Set the VCPKG_ROOT environment variable to your vcpkg installation directory, then pass the toolchain file to Cargo via RUSTFLAGS or .cargo/config.toml.
Linux
macOS
Platform Support
| Platform | Method | Notes |
|---|---|---|
| Windows | vcpkg | ffmpeg:x64-windows triplet required |
| Linux | apt / system libs | Dev packages (-dev) must be installed |
| macOS | Homebrew | brew install ffmpeg |
Wrapper Modules
In addition to the raw bindgen output, ff-sys ships thin safe-wrapper modules that isolate the most error-prone FFmpeg call sequences:
| Module | Wraps |
|---|---|
avcodec |
AVCodecContext, codec open/close |
avformat |
AVFormatContext, demux/mux lifecycle |
swscale |
SwsContext, pixel format conversion |
swresample |
SwrContext, sample format / channel layout conversion |
These modules are pub(crate) to the workspace and are not part of the public API surface.
MSRV
Rust 1.93.0 (edition 2024).
License
MIT OR Apache-2.0