A safe, high-level Rust API over FFmpeg for building media applications.
https://docs.rs/avio ↗// readme
avio
A safe, high-level Rust API over FFmpeg: an editing engine on top of a family of model-free FFmpeg primitive crates.
Status: avio is pre-1.0. The API is still evolving and may change between minor versions.
What is avio?
- Safe by default: every unsafe FFmpeg call is encapsulated, so application code never needs
unsafe. - Ergonomic: builder APIs, typed formats, and errors that carry human-readable context instead of raw FFmpeg return codes.
- Two layers: an opinionated editing engine on top of model-free FFmpeg primitives, so you can adopt the whole engine or depend on a single
ff-*crate (see Design Philosophy). - Focused: a foundation for video delivery services and video editing applications in Rust; it does not try to cover every FFmpeg feature.
use ff_probe::open;
use ff_decode::VideoDecoder;
use ff_encode::{VideoEncoder, VideoCodec, AudioCodec, BitrateMode};
// Inspect a media file
let info = open("input.mp4")?;
if let Some(v) = info.primary_video() {
println!("{}x{} @ {:.2} fps", v.width(), v.height(), v.fps());
}
// Decode frames
let mut decoder = VideoDecoder::open("input.mp4").build()?;
while…