Skip to content
thomshutt-fastlyPublic

About

Learning tool to subscribe to a simple MoQ video stream and describe / debug the message flow

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

moqsub (MoQ Subscriber Utility)

moqsub is a learning-focused Go CLI for subscribing to Media over QUIC (MoQT) tracks over raw QUIC, with protocol-level visibility.

Goals

  • Hand-rolled draft-16 and draft-18 subscriber behavior over quic-go.
  • Rich protocol debugging across setup, request, and data channels.
  • Pipe received object payloads to stdout, ffmpeg, or ffplay.
  • Subscriber-only scope: no publisher and no relay implementation.

Current Scope

Implemented:

  • Raw QUIC session dialing that negotiates ALPN between moqt-18 and moqt-16 (or pins one via --alpn), selecting the matching draft's wire format and session model.
  • draft-18: client SETUP on its own control stream + peer control stream parsing; each SUBSCRIBE on a fresh request stream with SUBSCRIBE_OK / REQUEST_ERROR replies implied by that stream.
  • draft-16: CLIENT_SETUP/SERVER_SETUP and every SUBSCRIBE / SUBSCRIBE_OK / REQUEST_ERROR / GOAWAY multiplexed on one shared control stream, correlated by explicit Request ID.
  • Incoming unidirectional stream dispatch, including subgroup data stream parsing (SUBGROUP_HEADER + subgroup object fields).
  • Object payload forwarding to configured output sink.
  • Runtime summary counters (bytes, objects, groups, gap hints, resets, first-object latency).
  • Explorable rich HTML session log with spec links that follow whichever draft was negotiated.

Not implemented yet:

  • WebTransport.
  • Fetch and datagram object handling.
  • Draft compatibility shims for drafts other than -16/-18 (e.g. draft-14).
  • Publishing functionality.

Build

go build ./cmd/moqsub

Usage

Basic run (stdout payload):

./moqsub \
  --relay moqt://localhost:4443 \
  --namespace anon/bbb \
  --output stdout

Pipe payload to ffplay:

./moqsub \
  --relay moqt://localhost:4443 \
  --namespace anon/bbb \
  --output ffplay

Flags

  • --relay: moqt:// URI for raw QUIC relay endpoint.
  • --namespace: Slash-delimited track namespace fields.
  • --alpn: Pin a specific ALPN protocol (moqt-18 or moqt-16). If unset, both are offered and the server's choice determines which draft's wire format is used.
  • --insecure: Skip TLS cert verification (local/testing only).
  • --output: stdout|ffmpeg|ffplay|command.
  • --ffmpeg-cmd: Command for --output=ffmpeg.
  • --ffplay-cmd: Command for --output=ffplay.
  • --pipe-cmd: Command for --output=command.
  • --log-format: text|json.
  • --rich-log: Write an explorable single-file HTML log of every MoQ message exchanged (with field breakdowns, explanations, and spec links) to the given path.

moqsub

moqsub

About

Learning tool to subscribe to a simple MoQ video stream and describe / debug the message flow

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages