Skip to content

Add MSF (MOQT Streaming Format) catalog support#993

Draft
kixelated wants to merge 1 commit intomainfrom
claude/add-msf-catalog-support-3QIV2
Draft

Add MSF (MOQT Streaming Format) catalog support#993
kixelated wants to merge 1 commit intomainfrom
claude/add-msf-catalog-support-3QIV2

Conversation

@kixelated
Copy link
Collaborator

Summary

This PR adds support for the MSF (MOQT Streaming Format) catalog format as defined in draft-ietf-moq-msf-00. An MSF catalog track (msf.json) is now published alongside the native hang catalog (catalog.json), allowing the same media configuration to be described in both formats.

Key Changes

  • New MSF catalog module (rs/hang/src/catalog/msf.rs):

    • Implements MsfCatalog and MsfTrack types with proper serialization/deserialization
    • Provides conversion from hang Catalog to MsfCatalog via From trait
    • Handles video and audio renditions with appropriate metadata (codec, dimensions, bitrate, etc.)
    • Base64-encodes initialization data when present
    • Assigns render groups and alternate groups for synchronized playback and quality switching
    • Includes comprehensive unit tests for conversion and JSON roundtrip
  • Updated catalog producer (rs/hang/src/catalog/producer.rs):

    • CatalogProducer now manages both hang and MSF catalog tracks
    • CatalogGuard publishes both catalogs on drop when mutations occur
    • MSF catalog is automatically derived from the hang catalog data
  • Updated catalog root (rs/hang/src/catalog/root.rs):

    • Added DEFAULT_MSF_NAME constant and default_msf_track() method for MSF track definition
  • Updated examples and CLI:

    • video.rs example now inserts both catalog tracks into the broadcast
    • moq-cli publish command inserts both catalog tracks
    • libmoq publish implementation updated to handle MSF track
  • Dependencies:

    • Added base64 = "0.22" for encoding initialization data

Implementation Details

  • MSF tracks use "loc" packaging mode and are marked as live streams
  • Video renditions are assigned to render group 1 with alternate group 1 (if multiple video tracks exist)
  • Audio renditions are assigned to render group 1 with alternate group 1 (if multiple audio tracks exist)
  • Both catalogs are published together whenever the catalog is modified, ensuring consistency

https://claude.ai/code/session_01G5w463kcSQrXJ3XMZchLL3

Whenever a hang catalog.json track is published, an msf.json track is
now published alongside it containing the equivalent MSF-format catalog.
The conversion lives in a single place (hang::catalog::msf::MsfCatalog)
so both formats stay in sync automatically.

Changes:
- New rs/hang/src/catalog/msf.rs with MsfCatalog/MsfTrack types and
  From<&Catalog> conversion
- CatalogProducer now owns an msf_track and CatalogGuard publishes both
  formats on drop
- All publish call-sites (moq-cli, libmoq, video example) insert the
  msf_track into the broadcast
- Added base64 dependency for initData encoding

https://claude.ai/code/session_01G5w463kcSQrXJ3XMZchLL3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants