Skip to main content

Crate ffai_media

Crate ffai_media 

Source
Expand description

§ffai-media

Media ingest/egress for FFai — the libavformat seat.

Policy: all container/codec work routes through remade_ffmpeg_rs (rff-* crates) as the default backend — we own it, it is pure Rust, and it keeps the zero-C/C++ promise. Phase 0 ships native WAV support (the one format every ASR/TTS engine needs on day one); everything else returns a clear “pending rff integration” error rather than silently failing.

Modules§

annexb
AVCC (length-prefixed) H.264 to Annex-B (start-code prefixed).

Structs§

VideoStream
Sample frames from a video at fps frames/second (for Argus video understanding). Pending the rff demux/decode integration. A lazily-decoded video, yielding one frame at a time.

Functions§

load_audio
Load an audio file into a normalized f32 AudioBuffer.
load_image
Decode a still image — PNG and JPEG today; WebP/AVIF/GIF follow.
sample_frames
Every frame at once. Prefer stream_frames — this holds the whole video in memory and exists for callers that genuinely want a Vec.
save_gray16_png
Write a 16-bit grayscale PNG.
save_wav
Write an AudioBuffer as 32-bit float WAV.
stream_frames
Open a video and stream its frames. fps <= 0 keeps every frame.