MoQ is under active development. APIs and protocols may change between releases.

Skip to content

hang ​

crates.iodocs.rs

The hang media format on top of moq-net: a live catalog describing renditions with WebCodecs-style decoder configs, and containers that carry a timestamp with every frame.

  • Catalog producer and consumer. Typed VideoConfig, AudioConfig and text renditions, the json and binary data track sections, shared video properties (display size, rotation, flip), stalled hints, cross-broadcast rendition references, and the archive entry (timeline track, optional replay path, store URL, and format version). Extend it with your own sections through a lock or #[serde(flatten)], or read unknown sections as raw JSON.
  • Containers. legacy, cmaf, and loc, decoded for you; unknown kinds pass through untouched.
  • Ordered reads a media track as timestamped frames, reorders groups, and skips ones that fall past your max age.
  • Codecs described: H.264, H.265, VP8, VP9, AV1, AAC, Opus, PCM.
bash
cargo add hang

Catalog::<E>::subscribe(&broadcast).await? opens the uncompressed catalog track and returns a typed consumer; consumer.next().await? yields root updates. Updates exceeding catalog::MAX_RENDITIONS are refused with Error::TooManyRenditions. Media retention uses the public container::MAX_AGE constant.

Producing media is usually done through moq-mux (from a container) or moq-video and moq-audio (from a device), which build the catalog for you. Examples: video.rs and subscribe.rs. API: docs.rs/hang. The TypeScript twin is @moq/hang.

Licensed under MIT or Apache-2.0