ffmpeg-light
A small Rust crate that wraps a few common FFmpeg tasks without asking you to memorize the entire CLI.
Why this exists
When you just want to probe a file, transcode it to H.264, or grab a thumbnail, the full FFmpeg CLI can feel like overkill. On the other hand, pulling in a massive set of raw bindings is equally daunting. ffmpeg-light sits in the middle: it spawns the ffmpeg/ffprobe binaries you already have installed and gives you a tidy Rust API for the 80% use cases.
This crate is young. Expect the API to move a bit until we get feedback from real projects.
Installation
[]
= "0.1"
You’ll also need the ffmpeg and ffprobe binaries available on your PATH. On macOS that might be brew install ffmpeg; on Windows, grab the latest build and add it to your environment variables.
Quick start
Probe a media file
use probe;
Transcode to H.264 MP4
use TranscodeBuilder;
Grab a thumbnail
use ;
Features
- Media probing built on
ffprobeJSON output. - A
TranscodeBuilderthat covers basic codecs, bitrates, presets, filters, and custom args. - Thumbnail generation with timestamp/size/format controls.
- Simple filter enum so you don’t have to concat raw filter strings.
- Optional logging via the
tracingfeature. - Optional async command execution via the
tokiofeature (roadmap).
Design notes
- The crate shells out to
ffmpeg/ffprobe. That keeps builds fast, works anywhere binaries exist, and avoids shipping unsafe bindings. - We never hand your input to a shell. Every argument is passed directly to
std::process::Command. - If you need the full FFmpeg surface area, you can still drop down to the CLI; this crate is for the frequent, boring chores.
Platform notes
The library is tested on Linux, macOS, and Windows as long as FFmpeg is on PATH. Windows users should prefer paths without spaces or wrap them in PathBuf to avoid quoting issues (the builder handles the quoting, but FFmpeg can still trip over exotic characters).
Roadmap
- Async command helpers behind a
tokiofeature gate. - More preset filters (denoise, deinterlace, etc.).
- Higher-level profiles for “transcode for web” or “extract audio only”.
- Better integration tests once we ship sample fixtures.
License
Licensed under the Apache License, Version 2.0.