Skip to content

moq-mux

crates.iodocs.rsLicense: MIT

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

FeatureDefaultDescription
mp4fMP4/CMAF support
h264H.264 codec support
h265H.265 codec support
hlsHLS 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 h264 feature
  • H.265 (HEVC) - requires h265 feature

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 importer
  • Fmp4Config - Configuration for fMP4 import
  • Hls - HLS playlist importer
  • Decoder - 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

Licensed under MIT or Apache-2.0