Skip to main content

Crate rff_core

Crate rff_core 

Source
Expand description

rff-core — shared primitives for Remade FFmpeg (Rust).

This is the equivalent of FFmpeg’s libavutil: the small, dependency-free vocabulary that every other crate speaks. Codecs, formats, the engine, the CLI and the server all build on the types defined here.

Nothing in this crate performs encoding or decoding — it only defines the data that flows between those stages (Packets of compressed bytes, Frames of raw samples) and the way errors are reported (Error).

Re-exports§

pub use dict::Dictionary;
pub use error::Error;
pub use error::Result;
pub use frame::AudioFrame;
pub use frame::Frame;
pub use frame::VideoFrame;
pub use media::CodecId;
pub use media::ColorRange;
pub use media::MediaType;
pub use media::PixelFormat;
pub use media::SampleFormat;
pub use packet::Packet;
pub use packet::PacketFlags;
pub use rational::Rational;

Modules§

dict
A small ordered string→string map for codec/format options — the role AVDictionary plays in FFmpeg (e.g. -crf 23, -preset fast). Ordered so that iteration (and any serialized form) is deterministic.
error
Unified error type for the whole workspace.
frame
A Frame is a chunk of raw, decoded data — pixels for video, samples for audio. It flows decoder → (filters) → encoder. Analogous to AVFrame.
media
Core media enumerations: media types, codec identifiers, and raw sample layouts (pixel formats for video, sample formats for audio).
packet
A Packet is a chunk of compressed data for one stream — the unit that flows demuxer → decoder and encoder → muxer. Analogous to AVPacket.
rational
Exact rational numbers, used for time bases and frame rates — exactly the role AVRational plays in FFmpeg. Storing time as a rational avoids the drift you get from representing e.g. 1/30000 as a float.