moq-mux
Media muxers and demuxers for converting existing media formats into MoQ broadcasts.
Overview
moq-mux provides tools for importing media from various container formats:
- fMP4/CMAF - Fragmented MP4 and Common Media Application Format
- HLS - HTTP Live Streaming playlists
- Annex B - H.264/H.265 raw NAL unit streams
This crate is designed for ingesting existing content into the MoQ ecosystem, converting from traditional formats into hang broadcasts.
Installation
Add to your Cargo.toml:
toml
[dependencies]
moq-mux = "0.1"Feature Flags
| Feature | Default | Description |
|---|---|---|
mp4 | ✓ | fMP4/CMAF support |
h264 | ✓ | H.264 codec support |
h265 | ✓ | H.265 codec support |
hls | ✓ | HLS playlist import |
Quick Start
Import fMP4 / HLS
See the moq-cli source for real-world usage of moq-mux for importing fMP4 and HLS streams.
Supported Codecs
Video:
- H.264 (AVC) - requires
h264feature - H.265 (HEVC) - requires
h265feature
Audio:
- AAC
- Opus
Use Cases
- Ingest existing content - Convert VOD files to MoQ broadcasts
- HLS bridge - Re-publish HLS streams over MoQ for lower latency
- Testing - Use sample files for development and testing
- Migration - Transition from traditional streaming to MoQ
Integration with hang
moq-mux produces hang broadcasts with proper catalog and frame metadata. See the hang video example for how to publish a broadcast with proper catalog setup.
API Reference
Full API documentation: docs.rs/moq-mux
Key types:
Fmp4- fMP4/CMAF importerFmp4Config- Configuration for fMP4 importHls- HLS playlist importerDecoder- Codec-specific decoders (AAC, Opus, AVC, HEVC)
CLI Tool
For command-line importing, use moq-cli:
bash
# Install
cargo install moq-cli
# Publish a video file
moq-cli publish video.mp4
# Publish from FFmpeg
ffmpeg -i input.mp4 -f mpegts - | moq-cli publish -Next Steps
- Use hang for media encoding/decoding
- Use moq-lite for the transport layer
- Deploy a relay server