Expand description
rff-format — the container (muxer/demuxer) abstraction layer (FFmpeg’s
libavformat core, minus the formats themselves).
A container is the file wrapper (AVI, MP4, Matroska, …) that interleaves one or more elementary streams. This crate defines:
Stream— the description of one elementary stream inside a container,Demuxer— reads a container, exposing streams andPackets,Muxer— writes streams + packets back into a container,FormatRegistry— what individual format crates register into.
Concrete formats live in their own crates (rff-format-avi, …).
Modules§
- aac
- AAC configuration helpers shared by containers (MP4
esds, Matroska CodecPrivate, ADTS): the AudioSpecificConfig for AAC-LC. - av1
- AV1 bitstream helpers shared by containers (MP4
av1C, Matroska CodecPrivate): locate the sequence-header OBU and build the AV1CodecConfigurationRecord around it. - avc
- H.264 bitstream helpers shared by demuxers (FFmpeg’s
h264_mp4toannexbbitstream filter plus a minimal SPS reader). - hvc
- HEVC bitstream helpers for containers: the
hvcC(HEVCDecoderConfigurationRecord, ISO/IEC 14496-15 §8.3.3) parser and builder, plus a minimal SPS reader.
Structs§
- Format
- Static description of a container format and its read/write support.
- Format
Registry - Holds every container format known to a running engine.
- MuxCaps
- What a container’s muxer will accept: the machine-readable half of the rules each muxer already enforces when it writes a header.
- Stream
- Description of one elementary stream within a container.
Traits§
- Demuxer
- Reads a container format: parses the header into
Streams, then yieldsPackets until the input is exhausted. - Muxer
- Writes a container format: declare streams, write packets, finalize.
- Read
Seek - A byte source that can also seek — what a local file or an in-memory buffer
offers and a pipe or socket does not. Blanket-implemented for every
Read + Seektype. - Write
Seek - A byte sink that can also seek – a local file, an in-memory buffer; not a
pipe or socket. Blanket-implemented for every
Write + Seektype.
Type Aliases§
- Demuxer
Factory - Factory opening a demuxer over an input byte source.
- Input
- A byte source a demuxer reads from. (
Box<dyn Read + Send>keeps the trait object-safe and lets inputs be files, network streams, or in-memory buffers.) - Muxer
Factory - Factory opening a muxer over an output byte sink.
- Output
- A byte sink a muxer writes to.
- Path
Muxer Factory - Factory opening a muxer that owns its own file set (HLS/DASH write a
playlist/manifest plus many segment files, so a single byte sink cannot
model them). Receives the output path and the format options
(
-hls_time 6→{"hls_time": "6"}). - ProbeFn
- Content sniffer: scores how strongly a byte prefix looks like this format,
0(no match) to100(certain) — mirrors FFmpeg’sAVInputFormat::read_probe. - Seek
Input - A seekable
Input. Formats whose index can sit anywhere in the file (MP4’smoov) use it to read only that index and fetch each payload on demand, instead of buffering the whole file. It upcasts toInputfor formats that only stream. - Seek
Output - A seekable
Output. Containers whose header records sizes or an index that is only known at the end (MP4mdat/moov, Matroska Segment/Cues, AVImovi/idx1, WAVRIFF/data) use it to stream the payload as it arrives and patch the header afterwards, instead of holding the whole output in memory until the trailer (#28). It upcasts toOutputfor muxers that only stream. - Seekable
Demuxer Factory - Factory opening a demuxer over a
SeekInput— registered alongside the format’sDemuxerFactoryby formats that read less when they can seek. - Seekable
Muxer Factory - Factory opening a muxer over a
SeekOutput– registered alongside the format’sMuxerFactoryby formats that can stream when they can seek.