Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
aab6cf6
feat(abr): transcode broadcasts into an ABR ladder beside their source
claude Nov 15, 2026
df0545e
style(abr): gofmt the integration test
claude Nov 15, 2026
ae221e7
feat(playground): adaptive bitrate playback of ABR broadcasts
claude Nov 16, 2026
74eb3b8
fix(abr): satisfy golangci-lint, and note the changes in CHANGELOG
claude Nov 16, 2026
aecac95
fix(abr): review fixes — epoch-scale timestamps, ffmpeg cleanup, HLS …
claude Nov 16, 2026
976da68
refactor(abr): recognize aliases by their redirect, not the /.hls/ pr…
claude Nov 16, 2026
bb09ad7
test(abr): cover the output catalog, renditions, lifecycle and ABR ed…
claude Nov 16, 2026
3096de7
Merge origin/main into the ABR branch
claude Nov 16, 2026
11f24d5
feat(abr): opt broadcasts in beneath /.abr/, as into qumo hls beneath…
claude Nov 17, 2026
70a60bf
feat(abr): transcode browser sources (Annex B H.264, VP9); playground…
claude Nov 17, 2026
39936c9
fix(abr): no /.abr/ mirror of tenant keys; RELAY_SIGNING_KEY for qumo…
claude Nov 17, 2026
47e24e3
feat(token): opt-ins a key holds come from the key set (optIns), so A…
claude Nov 17, 2026
cb495ec
feat(token)!: HLS is an opt-in like ABR: a key holds only what optIns…
claude Nov 17, 2026
d601ea0
feat(ingest): opt RTMP and RTSP streams into HLS and ABR on their pub…
claude Nov 17, 2026
c2451d2
fix(abr): refuse source tracks redirected to another broadcast; share…
okdaichi Nov 17, 2026
a18b91c
Merge branch 'ccr-2161bc2c-wkewvo-abr-optin' into ccr-2161bc2c-wkewvo…
okdaichi Nov 17, 2026
0cdc53a
refactor(ingest): drop checks that cannot fail
okdaichi Nov 17, 2026
c743900
fix(abr): size the source rendition by its decoded video when the cat…
okdaichi Nov 17, 2026
c23518b
fix(abr): refuse an opt-in not spelled exactly as its broadcast's
okdaichi Nov 17, 2026
9bd4589
Merge branch 'ccr-2161bc2c-wkewvo-abr-optin' into ccr-2161bc2c-wkewvo…
okdaichi Nov 17, 2026
b116eee
refactor(relaycred): say whether keep renews a grant or a ticket, not…
okdaichi Nov 17, 2026
5dd46f9
Merge remote-tracking branch 'origin/main' into ccr-2161bc2c-wkewvo
okdaichi Nov 17, 2026
d0009f0
docs(changelog): keep the ABR entries under Unreleased, not v0.21.261118
okdaichi Nov 17, 2026
fb4dd70
Merge remote-tracking branch 'origin/ccr-2161bc2c-wkewvo' into ccr-21…
okdaichi Nov 17, 2026
2216eb6
test(abr): an Annex B source without a catalog size is sized at its f…
okdaichi Nov 17, 2026
e6475f8
Merge remote-tracking branch 'origin/ccr-2161bc2c-wkewvo-abr-optin' i…
okdaichi Nov 17, 2026
ffa3e7a
fix(ingest): refuse an opt-in path with a . or .. segment
okdaichi Nov 17, 2026
61dba27
refactor(abr): drop what nothing needs; a startEncoders test that can…
okdaichi Nov 17, 2026
f5729d5
refactor(playground): ABR tuning as constants; audio-only decoder config
okdaichi Nov 17, 2026
9ff8b35
docs: #describe keeps its comment; a compact ABR CHANGELOG entry
okdaichi Nov 17, 2026
9e79ddd
refactor(ingest): pass optin.Broadcast's ok through, not an empty bro…
okdaichi Nov 17, 2026
94404d5
refactor(relaycred): one presentOn for Keep and Hold
okdaichi Nov 17, 2026
9c75f9c
build(playground): rebuild dist for the ABR controller and catalog ch…
claude Nov 17, 2026
4150410
Merge remote-tracking branch 'origin/ccr-2161bc2c-wkewvo' into ccr-21…
okdaichi Nov 17, 2026
5d72a8a
Merge remote-tracking branch 'origin/ccr-2161bc2c-wkewvo-abr-optin' i…
okdaichi Nov 17, 2026
c7b72ed
Merge origin/main (#602 squashed, #606, #607) into ccr-2161bc2c-wkewv…
okdaichi Nov 17, 2026
ec73d73
docs(changelog): #606 and #607 are unreleased, not in v0.21.261118
okdaichi Nov 17, 2026
61bfc8b
Merge remote-tracking branch 'origin/ccr-2161bc2c-wkewvo-abr-optin' i…
okdaichi Nov 17, 2026
f2874a8
ci: run the full suite now that #604 targets main
okdaichi Nov 17, 2026
98e8b28
test(abr): dial the transcoder over native QUIC in TestABR_PaidOptIn
claude Nov 17, 2026
d69f699
Merge remote-tracking branch 'origin/ccr-2161bc2c-wkewvo-abr-optin' i…
okdaichi Nov 17, 2026
858ae97
Merge origin/main (#604 squashed) into ccr-2161bc2c-wkewvo-ingest-optin
okdaichi Nov 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- **`qumo abr` transcodes broadcasts into an adaptive-bitrate ladder (`internal/abr`).** A publisher opts a broadcast in by announcing it beneath `/.abr/` (`/.abr/live/cam1` for `/live/cam1`), a redirect to it (`internal/optin`, shared with HLS); `qumo abr` then publishes `/live/cam1` + `ABR_SUFFIX` (`.abr`) with the source tracks as they are plus one H.264 rendition per `ABR_LADDER` rung shorter than the source (default `720:2500,360:800`; `ABR_FFMPEG`, `ABR_CODEC`, `ABR_PRESET`), all in one MSF `altGroup` with groups aligned to the source's, so a player can switch at any group boundary. Sources: H.264 (AVCC or Annex B) or VP9, without B-frames. A key holds an opt-in only when its key-set entry lists it (`"optIns": ["hls", "abr"]`, `qumo auth keygen -opt-ins`); the relay refuses other opt-in tokens and revokes a removed one within 30 s. `RELAY_SIGNING_KEY` lets `qumo abr` sign its own relay credential. See `docs/site/content/en/docs/cli/abr.md`.
- **RTMP and RTSP ingest opt streams into HLS and ABR on their publishers' behalf (`internal/ingest`, `INGEST_OPT_IN`).** A pushed or pulled stream can't announce an opt-in itself, so `qumo rtmp`, `qumo rtsp-push` and `qumo rtsp` announce it beside the broadcast (`/.abr/live/cam` for `/live/cam`, the redirect of `internal/optin`) for each egress `INGEST_OPT_IN` lists (`hls`, `abr`; none by default). With auth off every stream is opted in; with auth on, only when a token the publisher presents may publish the opt-in, so the key set's `optIns` decide, as for an MoQ publisher. A push now carries several tokens, each as a `?jwt=` (OBS: Stream Key `cam?jwt=BROADCAST&jwt=OPTIN`, or on the RTSP URL): the broadcast is taken on the first that may publish it, and each opt-in on the first that may publish the opt-in. A refused opt-in leaves the stream on air without it, and an opt-in is withdrawn when its token expires. A push to a path beneath an opt-in directory (`/.abr/live/cam`) is now refused, since the ingest announces opt-ins there. Through a relay with `RELAY_SIGNING_KEY`, the ingest presents a ticket for each opt-in directory beside its credential (`upstream.Config.OptIns`, publishing beneath `/.abr/live/` for `RELAY_PUBLISH=/live/`), retried for as long as the session lasts while the relay refuses it (`relaycred.Hold`).
- **The playground opts a broadcast into ABR, and plays ABR broadcasts adaptively (`playground`).** The publish board's ABR box announces the broadcast's opt-in beneath `/.abr/` beside it, as the HLS scenario does beneath `/.hls/`. A broadcast whose video tracks share an alternate group is played adaptively: the viewer switches renditions at group boundaries, stepping down when frames fall behind their media time to what the rate measured since then carries, and up one rendition after a calm stretch. A step up keeps the old rendition until its last group before the switch has arrived; a step down drops it at once. The subscribe board picks a rendition by hand or automatically, and shows the rendition playing, the receive rate and the lag.
- **`PEERS` names are resolved again while the relay runs, so peers behind a name join and leave without a restart; an entry without a port is an SRV name (`_moqt._udp.hubs.example.com`) (`internal/relay`).** A `PEERS` entry that is neither `host:port` nor a name without a port now stops the relay at startup, and a host that doesn't resolve is retried instead of being dialed by name.
- **The relay re-reads its certificates while it runs (`internal/relay`).** About once a minute it reads `CERT_FILE`/`KEY_FILE`, `PEER_CERT_FILE`/`PEER_KEY_FILE` and `CA_FILE` and compares them with what it holds; what changed is taken from the next TLS handshake on, so cert-manager, a Vault or step-ca agent, or any job that writes the files needs no restart. A public certificate is taken once it parses and matches its key; a peer certificate and the CA together, once they pass the startup checks (issued by the CA, the peering name, valid now). Anything else is logged, once per distinct error rather than at every read, and the certificates in use are kept; renewal tools should replace the files atomically (write, then rename). Sessions already established are untouched. The CA is now checked at each handshake on both sides: as the dialed relay (`GetConfigForClient`) and as the dialer (`VerifyConnection` against the current CA, with the same checks crypto/tls made). The relay's key-set and usage requests are signed with the renewed peer certificate (`reqsign.Signer.Rotate`), and `qumo dns` re-reads its `PEER_CERT_FILE`/`PEER_KEY_FILE` on the same one-minute cadence and signs its feed reads with a renewed pair (`internal/certreload`, shared by both). New metrics: `qumo_relay_cert_reloads_total{cert,result}` and `qumo_relay_cert_not_after_seconds{cert}`, and `qumo_dns_cert_reloads_total{cert,result}` and `qumo_dns_cert_not_after_seconds{cert}`; alert on the `not_after` gauges. A CA is rotated by putting the new one beside the old in `CA_FILE` first ([TLS & mTLS](docs/site/content/en/docs/deployment/tls.md#certificate-renewal)).
Expand Down
10 changes: 10 additions & 0 deletions docs/site/content/en/docs/cli/abr.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ one key. The app needs no new key when its tenant pays; the relay refuses the
token until the key set lists `abr`. `qumo auth keygen -opt-ins hls,abr` writes
the member for a key set kept by hand.

### RTMP and RTSP

A stream pushed over RTMP or RTSP, or pulled from a camera, can't announce its
opt-in, so the ingest announces it on the publisher's behalf: set
`INGEST_OPT_IN=abr` on [`qumo rtmp`]({{< relref "rtmp#opting-streams-into-hls-and-abr" >}}),
`qumo rtsp-push` or `qumo rtsp`. With auth on, the publisher presents the
opt-in's token as a second `?jwt=` (OBS: Stream Key
`cam?jwt=BROADCAST&jwt=OPTIN`), and the ingest checks it against the key set,
so an unpaid tenant's stream plays without renditions.

It dials the relay as an ordinary client: it subscribes to the source like any
viewer and publishes the ABR broadcast like any publisher. The relay itself
never decodes media.
Expand Down
4 changes: 4 additions & 0 deletions docs/site/content/en/docs/cli/hls.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ token of its own:
qumo auth token -key signing-key.jwk -root /.hls/acme/room/42/ -publish /cam
```

A stream pushed over RTMP or RTSP is opted in by the ingest on its publisher's
behalf, with `INGEST_OPT_IN=hls` and the same token as a second `?jwt=` on the
stream key: see [rtmp → Opting streams into HLS and ABR]({{< relref "rtmp#opting-streams-into-hls-and-abr" >}}).

## Viewers

By default the egress serves every opted-in broadcast to anyone. With
Expand Down
30 changes: 30 additions & 0 deletions docs/site/content/en/docs/cli/rtmp.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,35 @@ $ QUMO_AUTH_KEYS=keys.json qumo rtmp
# OBS: Server rtmp://host:1935/live, Stream Key cam?jwt=$(qumo auth token -root /live/ -publish /cam)
```

## Opting streams into HLS and ABR

A pushed stream can't announce an opt-in for [`qumo hls`]({{< relref "hls" >}})
or [`qumo abr`]({{< relref "abr" >}}) itself, as an MoQ publisher does, so the
server announces it on the publisher's behalf: `/.abr/live/cam` beside
`/live/cam`, a redirect to the broadcast. `INGEST_OPT_IN` lists the egresses
it offers (`hls`, `abr`, comma-separated; none by default).

With auth off, every stream is opted into each of them. With auth on, a
stream is opted into one only when a token it presents may publish the
opt-in: a second `?jwt=` on the stream key, signed for the opt-in's path
(`-root /.abr/live/ -publish /cam`). The relay's key set decides, as for an
MoQ publisher: a tenant's key signs it only while its entry lists the opt-in
(`"optIns": ["abr"]`, see [abr → Paying for the opt-in]({{< relref "abr#paying-for-the-opt-in" >}})).
A refused opt-in token leaves the stream on air without the opt-in, and the
opt-in is withdrawn when its token expires. A push to an opt-in's path itself
(`/.abr/live/cam`) is refused: the server keeps those paths for its opt-ins.

```console
$ QUMO_AUTH_KEYS=keys.json INGEST_OPT_IN=abr qumo rtmp
# OBS: Stream Key cam?jwt=$(qumo auth token -root /live/ -publish /cam)&jwt=$(qumo auth token -root /.abr/live/ -publish /cam)
```

Through a relay with `RELAY_SIGNING_KEY`, the server also presents a ticket
for each egress in `INGEST_OPT_IN` (publishing beneath `/.abr/live/` for
`RELAY_PUBLISH=/live/`), so the relay takes the opt-ins: the key must hold the
opt-ins in the relay's key set, as a key for the whole namespace (`-prefix /`)
does.

## Publishing through a relay

With `RELAY_URL` set, the server publishes what it ingests through that relay,
Expand All @@ -69,6 +98,7 @@ $ RELAY_URL=moqt://relay:4433 RELAY_SIGNING_KEY=ingest-key.jwk RELAY_PUBLISH=/li
| `RTMP_SERVE_ADDR` | `:4433`; none with `RELAY_URL` | MoQT listen address for subscribers to dial directly. |
| `QUMO_AUTH_KEYS` | (unset) | The key set a publisher's credential is verified against, as the relay reads it (a file or URL). Unset accepts every publish. |
| `QUMO_AUTH_KEYS_CACHE` / `QUMO_RELAY_TOKEN` | (unset) | A file a downloaded key set is kept in, and the bearer token sent to a key-set URL. |
| `INGEST_OPT_IN` | (unset) | The egresses (`hls`, `abr`) a stream is opted into on its publisher's behalf, comma-separated: with auth on, those a second `?jwt=` may publish the opt-in of. |
| `RELAY_URL` | (unset) | The relay to publish through, dialed as a client (`https://…` or `moqt://…`); it may carry a credential as `?jwt=`. |
| `RELAY_SIGNING_KEY`, `RELAY_PUBLISH` | (unset) | Set together: a signing key (`qumo auth keygen`) the server signs a fresh relay credential with on every dial and renews on the session, granting publishing beneath the directory `RELAY_PUBLISH`. A push outside it is refused. |
| `RELAY_CA_FILE` / `RELAY_TLS_INSECURE` | (unset) / `false` | Trust this PEM as the relay's root, or skip verification for a self-signed dev relay. |
Expand Down
30 changes: 30 additions & 0 deletions docs/site/content/en/docs/cli/rtsp-push.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,35 @@ $ QUMO_AUTH_KEYS=keys.json qumo rtsp-push
$ ffmpeg -re -i in.mp4 -c copy -f rtsp "rtsp://host:8554/live/cam?jwt=$(qumo auth token -root /live/ -publish /cam)"
```

## Opting streams into HLS and ABR

A pushed stream can't announce an opt-in for [`qumo hls`]({{< relref "hls" >}})
or [`qumo abr`]({{< relref "abr" >}}) itself, as an MoQ publisher does, so the
server announces it on the publisher's behalf: `/.abr/live/cam` beside
`/live/cam`, a redirect to the broadcast. `INGEST_OPT_IN` lists the egresses
it offers (`hls`, `abr`, comma-separated; none by default).

With auth off, every stream is opted into each of them. With auth on, a
stream is opted into one only when a token it presents may publish the
opt-in: a second `?jwt=` on the URL, signed for the opt-in's path
(`-root /.abr/live/ -publish /cam`). The relay's key set decides, as for an
MoQ publisher: a tenant's key signs it only while its entry lists the opt-in
(`"optIns": ["abr"]`, see [abr → Paying for the opt-in]({{< relref "abr#paying-for-the-opt-in" >}})).
A refused opt-in token leaves the stream on air without the opt-in, and the
opt-in is withdrawn when its token expires. A push to an opt-in's path itself
(`/.abr/live/cam`) is refused: the server keeps those paths for its opt-ins.

```console
$ QUMO_AUTH_KEYS=keys.json INGEST_OPT_IN=abr qumo rtsp-push
$ ffmpeg -re -i in.mp4 -c copy -f rtsp "rtsp://host:8554/live/cam?jwt=$(qumo auth token -root /live/ -publish /cam)&jwt=$(qumo auth token -root /.abr/live/ -publish /cam)"
```

Through a relay with `RELAY_SIGNING_KEY`, the server also presents a ticket
for each egress in `INGEST_OPT_IN` (publishing beneath `/.abr/live/` for
`RELAY_PUBLISH=/live/`), so the relay takes the opt-ins: the key must hold the
opt-ins in the relay's key set, as a key for the whole namespace (`-prefix /`)
does.

## Publishing through a relay

With `RELAY_URL` set, the server publishes what it ingests through that relay,
Expand All @@ -68,6 +97,7 @@ $ RELAY_URL=moqt://relay:4433 RELAY_SIGNING_KEY=ingest-key.jwk RELAY_PUBLISH=/li
| `RTSP_SERVE_ADDR` | `:4433`; none with `RELAY_URL` | MoQT listen address for subscribers to dial directly. |
| `QUMO_AUTH_KEYS` | (unset) | The key set a publisher's credential is verified against, as the relay reads it (a file or URL). Unset accepts every publish. |
| `QUMO_AUTH_KEYS_CACHE` / `QUMO_RELAY_TOKEN` | (unset) | A file a downloaded key set is kept in, and the bearer token sent to a key-set URL. |
| `INGEST_OPT_IN` | (unset) | The egresses (`hls`, `abr`) a stream is opted into on its publisher's behalf, comma-separated: with auth on, those a second `?jwt=` may publish the opt-in of. |
| `RELAY_URL` | (unset) | The relay to publish through, dialed as a client (`https://…` or `moqt://…`); it may carry a credential as `?jwt=`. |
| `RELAY_SIGNING_KEY`, `RELAY_PUBLISH` | (unset) | Set together: a signing key (`qumo auth keygen`) the server signs a fresh relay credential with on every dial and renews on the session, granting publishing beneath the directory `RELAY_PUBLISH`. A push outside it is refused. |
| `RELAY_CA_FILE` / `RELAY_TLS_INSECURE` | (unset) / `false` | Trust this PEM as the relay's root, or skip verification for a self-signed dev relay. |
Expand Down
1 change: 1 addition & 0 deletions docs/site/content/en/docs/cli/rtsp.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ $ RELAY_URL=moqt://relay:4433 RELAY_SIGNING_KEY=ingest-key.jwk RELAY_PUBLISH=/li
| Variable | Default | Description |
|---|---|---|
| `RTSP_SERVE_ADDR` | `:4433`; none with `RELAY_URL` | MoQT listen address for subscribers to dial directly. |
| `INGEST_OPT_IN` | (unset) | The egresses (`hls`, `abr`) the broadcast is opted into, comma-separated, for as long as the pull runs: `/.abr/live/camera` beside `/live/camera`. Through a relay with `RELAY_SIGNING_KEY`, the command presents a ticket for each beside its credential, which the relay grants when the key holds the opt-in. |
| `RELAY_URL` | (unset) | The relay to publish through, dialed as a client (`https://…` or `moqt://…`); it may carry a credential as `?jwt=`. |
| `RELAY_SIGNING_KEY`, `RELAY_PUBLISH` | (unset) | Set together: a signing key (`qumo auth keygen`) the server signs a fresh relay credential with on every dial and renews on the session, granting publishing beneath the directory `RELAY_PUBLISH`. A broadcast path outside it stops the command at startup. |
| `RELAY_CA_FILE` / `RELAY_TLS_INSECURE` | (unset) / `false` | Trust this PEM as the relay's root, or skip verification for a self-signed dev relay. |
Expand Down
19 changes: 3 additions & 16 deletions internal/auth/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,6 @@ func prefixLabel(prefix string, optIns []token.OptIn) string {
return label + " or its opt-ins " + strings.Join(mirrors, ", ")
}

// parseOptIns reads a comma-separated list of opt-ins: "" is none.
func parseOptIns(s string) []token.OptIn {
var out []token.OptIn
for part := range strings.SplitSeq(s, ",") {
if part = strings.TrimSpace(part); part != "" {
out = append(out, token.OptIn(part))
}
}
return out
}

// runKeygen writes a new signing key pair: the private key, for the app that
// signs tokens, and a key set holding its public key, for the relay. The key
// and the two paths it will be written to are shown before any file is; on a
Expand All @@ -109,15 +98,13 @@ func runKeygen(args []string, out, info io.Writer, in io.Reader) error {
return err
}
pub := key.Public()
pub.OptIns = parseOptIns(*optIns)
if pub.OptIns, err = token.ParseOptIns(*optIns); err != nil {
return fmt.Errorf("-opt-ins: %w", err)
}
set, err := token.MarshalKeySet(pub)
if err != nil {
return err
}
// MarshalKeySet checked them: what the key set holds is what is shown.
if keys, err := token.ParseKeySet(set); err == nil {
pub = keys[pub.ID]
}
// The key and where it lies, before any file does: the key's prefix is
// the one setting a re-issue won't give back, and a bare prefix makes
// the key the tenant of everything.
Expand Down
2 changes: 1 addition & 1 deletion internal/funnel/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func Run(_ []string) error {
}
quicconfig.LogEnvSet("funnel")

up, err := upstream.FromEnv("funnel", quicConfig)
up, err := upstream.FromEnv("funnel", quicConfig, nil)
if err != nil {
return fmt.Errorf("funnel: %w", err)
}
Expand Down
Loading
Loading