mediaway-container
Status: early development (
0.x). Not recommended for production; public APIs may change without notice. Part of the Mediaway media stack.
The Mediaway container facade: shared mux/demux traits plus Mediaway-typed modules for
eight container formats — mp4, webm, wav, adts, mp3, ogg, flv, ts. Each
module is a sans-io state machine over the workspace's format cores, speaking
mediaway_common's StreamInfo/Packet types so apps can swap formats behind one
interface.
Quick start
use ;
use mp4;
// Typestate mux: register tracks, begin, push packets, collect bytes.
let mut muxer = new;
let v_track = muxer.add_track?;
let mut muxer = muxer.begin; // Open -> Live
muxer.push_packet?;
muxer.flush;
let mut mp4_bytes = Vecnew;
muxer.poll_bytes;
// Streaming demux: feed bytes, poll packets.
let mut demux = new;
demux.push_bytes;
while let Some = demux.poll_packet
Status
Status marks: ✅ first-class (tests for claimed scope) · ⚡ Zero-Copy path (no payload copy; implies ✅) · 🆗 best-effort / prototype · 🛠️ planned · ❌ attempted and genuinely blocked · 👻 not exercisable yet (no hardware / device / session available)
| Format | Module | Status | Notes |
|---|---|---|---|
| MP4 / fMP4 | mp4 |
✅ | Mux + demux + ClearKey CENC; Muxer::with_placements records each sample's payload offset + length; HEVC and Opus (dOps) tracks are written correctly |
| WebM | webm |
✅ | Mux + demux (full Matroska-profile demux) |
| WAV / RIFF (PCM) | wav |
✅ | Mux + demux; own method shape (size known up front) |
| ADTS (raw AAC) | adts |
✅ | Mux/Demux traits |
| MP3 | mp3 |
✅ | Demux only; no Mux fit (per-frame padding bit) |
| Ogg | ogg |
✅ | Mux/Demux; codec from OpusHead/Vorbis id header |
| FLV | flv |
✅ | Codec-aware mux + demux (AVC video, AAC/MP3 audio) |
| MPEG-TS | ts |
✅ | Demux only; mux exposes per-PID write_access_unit |
VP8 CodecKind mapping |
— | ✅ | CodecKind::Vp8 exists; WebM VP8 demux/mux is wired |
| Replay ring | replay |
✅ | ReplayRing<P = Bytes> keeps the last N seconds of encoded packets and cuts the last M at a keyframe, in decode order, as a rebased packet sequence a fresh muxer writes standalone. StoredPayload keeps only file locations, not payloads (ADR-0004) |
| Muxer open phase | MuxOpen |
✅ | Names the add_track → begin phase every muxer has, plus FIRST_TRACK_ID, Mux::set_track_extra_data (a no-op for containers that commit headers at begin, e.g. WebM) and ContainerError |
Docs
docs/roadmap.md— stages, deferred items, design decisions- Sans-IO cores:
iso-bmff,ebml-webm,riff-wave-core,adts-core,mpeg-audio,ogg-core,flv-core,mpeg-ts-core - Root README — container support matrix
Contributing
Contributions are welcome — open an issue or pull request at github.com/nyxways/mediaway.
License
MIT OR Apache-2.0.