Expand description
§Muxide
Minimal-dependency pure-Rust MP4 muxer for recording applications.
§Core Invariant
Muxide guarantees that any correctly-timestamped, already-encoded audio/video stream can be turned into a standards-compliant, immediately-playable MP4 without external tooling.
§What Muxide Does
- Accepts encoded H.264/H.265/AV1/VP9 video frames with timestamps
- Accepts encoded AAC/Opus audio frames with timestamps
- Outputs MP4 files with fast-start (moov before mdat) for instant web playback
- Supports B-frames via explicit PTS/DTS
- Supports fragmented MP4 (fMP4) for DASH/HLS streaming
§What Muxide Does NOT Do
- ❌ Encode or decode video/audio (use openh264, x264, etc.)
- ❌ Read or demux MP4 files
- ❌ Fix bad timestamps (rejects invalid input)
- ❌ DRM, encryption, or content protection
- ❌ MKV, WebM, or other container formats
See docs/charter.md and docs/contract.md for full invariants.
§Example
use muxide::api::{MuxerBuilder, VideoCodec};
use std::fs::File;
let file = File::create("out.mp4")?;
let mut muxer = MuxerBuilder::new(file)
.video(VideoCodec::H264, 1920, 1080, 30.0)
.build()?;
// Write frames (encoded elsewhere).
// muxer.write_video(pts_secs, annex_b_bytes, is_keyframe)?;
let _stats = muxer.finish_with_stats()?;Modules§
- api
- codec
- Codec configuration extraction for container muxing.
- fragmented
- Fragmented MP4 (fMP4) support for streaming applications.
- invariant_
ppt - Invariant PPT Testing Framework
- validation
- Input validation utilities for pre-muxing checks.
Macros§
- assert_
invariant - Assert an invariant and log it for contract testing.