rff-core
The dependency-free core of remade_ffmpeg_rs — the media primitives every
other layer is written against: frames, packets, codec/pixel/sample enums,
rationals, dictionaries and the shared error type. FFmpeg's libavutil, in safe
Rust with a single dependency (thiserror).
- Frames —
VideoFrame(planar/packed pixels,PixelFormat),AudioFrame(interleavedf32,SampleFormat), unified by theFrameenum. - Packets —
Packetwith PTS/DTS, duration, stream index andPacketFlags(keyframe et al.). - Identifiers —
CodecId,MediaType,PixelFormat,SampleFormat. - Plumbing —
Rationaltimebases,Dictionaryfor FFmpeg-style-key valueoptions, andError/Resultwith theAgain/Eofdrain protocol every codec follows. - No I/O, no codecs, no allocator tricks — just the vocabulary types, so every downstream crate agrees on what a frame is.
Usage
use ;
Error::Again means "feed more input" and Error::Eof means "flushed and fully
drained" — the same EAGAIN/EOF contract FFmpeg uses, and the one every
rff-codec-* and rff-format-* crate implements.
Part of Remade With Rust
This crate is one layer of
remade_ffmpeg_rs — a
ground-up, permissively-licensed Rust rebuild of FFmpeg: a drop-in
ffmpeg/ffprobe CLI on pure-Rust codecs, with no copyleft. Most users want
the remade-ffmpeg engine facade or the
rff-cli binaries rather than this crate
directly.
Also check out our sister project
FFAI — media for an AI-first
world — and the rest of
github.com/remade-with-rust, including
the standalone codec crates
rusty_h264,
rusty_vp9,
rusty_mp3,
rusty_aac,
rusty-opus,
rusty_vorbis, and the
rusty-av1-toolkit forks.
About Mata Network
Mata Network builds sovereign, self-hostable infrastructure. Remade With Rust is our open-source home for the permissively-licensed building blocks that work depends on.
License
Apache-2.0. See the workspace LICENSE.