Skip to content

feat(egress): generic TS output sink (UDP/RTP/FEC/ST 2022-7) + PCR-aware pacing #1839

Description

@t0ms

Context

#1828 added SRT egress (MoQ broadcast -> moq_mux::ts::Export -> SRT messages), but the
wiring is SRT-specific and its review explicitly deferred pacing: send timestamps use
Instant::now() rather than media PTS, so a tune-in keyframe burst is released as a burst,
and "a proper fix needs a PTS-exposing API change in moq_mux::Export". #1799 also lists
RTP/UDP, FEC, ST 2022-7, and multicast as broadcast egress needs. This issue proposes a
small shared egress abstraction so transports are pluggable, plus the PCR-aware pacing the
SRT work punted on. Part of #1799; builds on #1828.

Proposal

1. PCR-aware pacing + a PTS-exposing Export API (do first)

2. A generic egress sink

  • A small trait, output sink, that consumes paced TS packets/bytes (+ timing) and writes
    them to a transport. Refactor feat(moq-srt): serve broadcasts back out over SRT (m=request egress) #1828's SRT path to be one implementation.
  • Backends, in order:
    1. raw UDP (unicast + multicast)
    2. RTP/UDP (RFC 2250 MP2T payload), unicast + multicast
    3. RTP + FEC (SMPTE 2022-1 / Pro-MPEG COP3 column+row)
    4. ST 2022-7 seamless protection switching (dual-path hitless merge)
    • (SRT stays as the existing sink.)

Where it lives

A dedicated egress crate, or extend the egress shape moq-srt introduced; the relay core
stays media-agnostic. Coordinate with moq-srt (which is dev).

Branch

dev to sit alongside moq-srt egress. The moq_mux::Export timing-API addition is
additive (non-breaking).

Notes

A private reference implementation of RTP, FEC (2022-1), PCR pacing, and a decoder-safe
start gate exists; offered as design background and a starting point, not a wholesale
merge, real upstreaming carries standards-conformance (RFC 2250, SMPTE 2022-1/-7) and
interop tests (TSDuck, a hardware IRD).
(Written by Claude)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions