Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 6 additions & 5 deletions doc/bin/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ taking the wrap that lands it nearest the clock, so media that gets more than
13.25 hours ahead of it (a jump that far, or a long file read faster than real
time) reads as a rewind.

MPEG-TS import carries H.264/H.265 and AAC/MP2/AC-3/E-AC-3, and passes SCTE-35
and every other stream it does not decode (KLV, subtitles, DVB AC-3) through as
tracks. Each such PES goes through whole, at its place on the program clock
MPEG-TS import carries H.264/H.265 and AAC/MP2/AC-3/E-AC-3/Opus, and passes
SCTE-35 and every other stream it does not decode (KLV, subtitles, DVB AC-3)
through as tracks. Each such PES goes through whole, at its place on the program clock
(PCR); one before the first PCR is dropped. A stream it cannot carry unaltered
is refused with a warning: any in a program with no PCR, and one whose PES carry
an ESCR, pack header or TREF, are scrambled, leave a non-video PES unbounded,
Expand All @@ -111,7 +111,8 @@ logs feed health (stalled streams, TR 101 290 errors) without changing what it
publishes. `--passthrough` publishes the multiplex whole instead, every packet
in order on one [`m2ts`](/concept/hang#transport-streams) track with every
program aboard, for what demultiplexing cannot carry, such as a scrambled
service; `export ts --passthrough` writes it back out. FLV covers H.264 + AAC.
service; `export ts --passthrough` writes it back out. FLV accepts the same
legacy and enhanced-RTMP codecs as the [RTMP gateway](/bin/rtmp).

`import rtsp` pulls an IP camera's H.264 or H.265 video and AAC audio without
re-encoding. RTP rides the RTSP connection, so run it on the camera's network
Expand All @@ -123,7 +124,7 @@ including when the camera sends no media for 10 seconds or no keyframe for 30,
until a fatal error (refused access, or no stream it can publish), and
each RTSP session is a new broadcast with its own catalog, since the session's
RTP time restarts; a camera whose clock jumps mid-session is restarted the same
way. Embed [`moq-rtsp`](https://docs.rs/moq-rtsp) for your own supervision,
way. Embed [`moq-rtsp`](https://github.com/moq-dev/moq/tree/main/rs/moq-rtsp) for your own supervision,
such as two of a camera's URLs as renditions of one broadcast.

```bash
Expand Down
2 changes: 1 addition & 1 deletion doc/bin/rtc.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ reconnects while its stale session lingers replaces it at once.

Built on [str0m](https://crates.io/crates/str0m); the library is
[`moq-rtc`](https://docs.rs/moq-rtc). Embedders can sample each peer's
[wire source](https://docs.rs/moq-rtc/latest/moq_rtc/wire/index.html) for UDP
[wire source](https://github.com/moq-dev/moq/blob/main/rs/moq-ice/src/wire.rs) for UDP
payload bytes, including media, control traffic, and retransmissions.
8 changes: 4 additions & 4 deletions doc/bin/rtmp.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ description: RTMP and enhanced RTMP ingest and playback

`moq import rtmp` accepts pushes from OBS, FFmpeg, and hardware encoders;
`moq export rtmp` serves plays to VLC, ffplay, and mpv, or pushes to a remote
RTMP server such as Twitch. Both legacy RTMP (H.264 + AAC) and enhanced RTMP
(HEVC, AV1, VP9, Opus, AC-3, multitrack) work in each direction.
RTMP server such as Twitch. Both legacy RTMP (H.264, AAC, MP3) and enhanced
RTMP (HEVC, AV1, VP9, Opus, AC-3, E-AC-3, multitrack) work in each direction.

```bash
# Accept an OBS push and publish it to a relay.
Expand Down Expand Up @@ -53,5 +53,5 @@ carries the best of each.
Implemented in pure Rust (no librtmp). The CLI speaks plaintext `rtmp://`
only, so stream keys cross the network unencrypted. The library adds RTMPS on
the same port when the embedder supplies a TLS config, and can refuse plaintext
there. FLAC and MP3 enhanced-audio payloads are dropped because hang has no
catalog codec for them.
there. FLAC enhanced-audio payloads are dropped because hang has no catalog
codec for them. MP3 works in both legacy and enhanced audio tags.
2 changes: 1 addition & 1 deletion doc/lib/c/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,5 @@ inside. The header is the reference: each function carries a doc comment.

## Reference

- API reference: [docs.rs/moq-c](https://docs.rs/moq-c)
- API source: [rs/moq-c/src](https://github.com/moq-dev/moq/tree/main/rs/moq-c/src)
- Source and a worked example: [`rs/moq-c`](https://github.com/moq-dev/moq/tree/main/rs/moq-c)
10 changes: 5 additions & 5 deletions doc/lib/js/json.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ for await (const { value, at } of consumer) {
}
```

`next()` buffers every state it has not yielded. On a timed track it skips a
group once the subscription's `maxDelay` proves it stale, and the default of
zero keeps only the newest group, so subscribe with a `maxDelay` covering how
far the playhead trails the live edge. An untimed track skips nothing; a reader
that cannot keep up calls `latest()` instead.
`next()` buffers every state it has not yielded and skips a group once the
subscription's `maxDelay` proves it stale. The budget counts media time and
wall time, or wall time alone for an untimed track. The default of zero keeps
only the newest group, so subscribe with a `maxDelay` covering how far the
playhead trails the live edge. Use `latest()` to skip straight to the head.

A stream rides one group, so the whole log shares `@moq/net`'s group budget:
32 MiB of payload and 8192 records. An append that might not fit is refused
Expand Down
2 changes: 1 addition & 1 deletion doc/lib/layers.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Sessions, origins, broadcasts, tracks, and groups: `Client`, `Server`,

| Language | Module | Example |
| --- | --- | --- |
| Rust | [`moq_net`](/lib/rs/moq-net), with `moq_tokio` to connect and listen | `moq_net::BroadcastProducer` |
| Rust | [`moq_net`](/lib/rs/moq-net), with `moq_tokio` to connect and listen | `moq_net::broadcast::Producer` |
| Python | `moq` | `moq.BroadcastProducer` |
| Go | `moq.dev/moq` | `moq.BroadcastProducer` |
| Kotlin | `dev.moq` | `dev.moq.BroadcastProducer` |
Expand Down
2 changes: 1 addition & 1 deletion doc/lib/py/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,6 @@ A catalog that needs a newer moq-hang draft than this build reads raises `Error.

## Reference

- API reference: [moq-rs.readthedocs.io](https://moq-rs.readthedocs.io)
- API source: [py/moq-rs/moq](https://github.com/moq-dev/moq/tree/main/py/moq-rs/moq)
- Source and examples: [`py/moq-rs`](https://github.com/moq-dev/moq/tree/main/py/moq-rs)
- Raw bindings: [`moq-ffi`](https://pypi.org/project/moq-ffi/) on PyPI, for the unwrapped API
32 changes: 18 additions & 14 deletions doc/lib/rs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ description: The reference implementation, as a set of crates on crates.io

# Rust

The reference implementation. Every crate is on
[crates.io](https://crates.io/search?q=moq) with API docs on docs.rs.
The reference implementation. Published crates are on
[crates.io](https://crates.io/search?q=moq) with API docs on docs.rs; source
links cover crates awaiting their first release.

## Crates

Expand All @@ -16,7 +17,7 @@ The reference implementation. Every crate is on
| [moq-pattern](https://docs.rs/moq-pattern) | Path patterns such as `room/**`. Re-exported by moq-net and moq-auth. |
| [moq-tokio](https://docs.rs/moq-tokio) | Connects and listens over QUIC, WebSocket, or iroh, from config or CLI flags. |
| [moq-sock](https://docs.rs/moq-sock) | Socket binding and CPU pinning for thread-per-core listeners. |
| [moq-ice](https://docs.rs/moq-ice) | The ICE agent behind native WebRTC: drives a str0m connection over UDP, with a STUN client. |
| [moq-ice](https://github.com/moq-dev/moq/tree/main/rs/moq-ice) | The ICE agent behind native WebRTC: drives a str0m connection over UDP, with a STUN client. |
| [moq-uring](https://docs.rs/moq-uring) | Experimental Linux io\_uring server for moq-lite. |
| [hang](/lib/rs/hang) | The media layer: catalog, containers, ordered frame delivery. |
| [moq-mux](/lib/rs/moq-mux) | Import and export fMP4/CMAF, MPEG-TS, Matroska, FLV, and Annex-B. |
Expand All @@ -33,7 +34,7 @@ The reference implementation. Every crate is on
| [moq-loc](https://docs.rs/moq-loc), [moq-msf](https://docs.rs/moq-msf) | The IETF LOC container and MSF catalog. |
| [moq-stats](https://docs.rs/moq-stats) | Publish and consume relay traffic counters as tracks. |
| [moq-clock](/lib/rs/moq-clock) | One clock for time and timers on tokio, the browser, and a deterministic test simulator. |
| [moq-hls](https://docs.rs/moq-hls), [moq-rtmp](https://docs.rs/moq-rtmp), [moq-srt](https://docs.rs/moq-srt), [moq-rtsp](https://docs.rs/moq-rtsp), [moq-rtc](https://docs.rs/moq-rtc) | The [gateways](/bin/), as libraries you can embed with your own auth. |
| [moq-hls](https://docs.rs/moq-hls), [moq-rtmp](https://docs.rs/moq-rtmp), [moq-srt](https://docs.rs/moq-srt), [moq-rtsp](https://github.com/moq-dev/moq/tree/main/rs/moq-rtsp), [moq-rtc](https://docs.rs/moq-rtc) | The [gateways](/bin/), as libraries you can embed with your own auth. |
| [moq-ffi](https://docs.rs/moq-ffi), [moq-c](/lib/c/) | The UniFFI core behind the language bindings, and the C ABI. |
| [moq-relay](/bin/relay/), [moq-cli](/bin/cli) | The binaries, also usable as crates. |
| [web-transport](https://github.com/moq-dev/web-transport) | The QUIC/WebTransport/qmux transports, in a sibling repository. |
Expand Down Expand Up @@ -76,10 +77,10 @@ let mut broadcast = origin.publish("my-stream.hang", Default::default())?;
// each requested path for the application to accept or reject.
```

The session and the origin work run concurrently (`tokio::select!` or
`spawn`), since the announcement loop is live. Before exiting,
`session.close().await` delivers what was already queued, then `Client::close`
sends the QUIC close. Runnable examples:
The connection and origin helpers spawn their drivers. Watch
`session.closed()` alongside the announcement loop to handle a connection
that gives up. Before exiting, `session.close().await` delivers what was
already queued, then `Client::close` sends the QUIC close. Runnable examples:
[`rs/hang/examples/video.rs`](https://github.com/moq-dev/moq/blob/main/rs/hang/examples/video.rs)
(publish) and
[`subscribe.rs`](https://github.com/moq-dev/moq/blob/main/rs/hang/examples/subscribe.rs).
Expand All @@ -93,15 +94,18 @@ the relay's settings; see the [relay reference](/bin/relay/config#quic).
## WebAssembly

`moq-net` compiles to `wasm32-unknown-unknown` and rides the browser's own
`WebTransport` through the `web-transport` crate, so Rust logic can be shared
between native and web. Skip `moq-tokio` there, build the transport with
`web_transport::ClientBuilder`, and drive the returned session future with
`wasm_bindgen_futures::spawn_local` (nothing is `Send` on wasm). If you just
`WebTransport`, so Rust logic can be shared between native and web. Skip
`moq-tokio` there. A client handshake returns a session and a separate driver;
spawn `moq_net::time::run(driver)` on the browser executor, and drive the
origin the same way. The [browser transport adapter](https://github.com/moq-dev/moq/blob/main/rs/moq-wasm/src/transport.rs)
and [handshake](https://github.com/moq-dev/moq/blob/main/rs/moq-wasm/src/lib.rs)
show the setup, including advertising the supported MoQ ALPNs. If you just
want MoQ in a page, the [TypeScript libraries](/lib/js/) are the easier path.

## Conventions

The API is producer/consumer pairs at every level (origin, broadcast, track,
group). Producers write and consumers read; cloning a consumer shares the
subscription, and the last clone dropping closes it. Everything is
`async`, executor-agnostic, and errors are typed enums with `thiserror`.
subscription, and the last clone dropping closes it. The core exposes
executor-agnostic `poll_*` methods with optional async helpers; `moq-tokio`
handles native runtime integration. Errors are typed enums with `thiserror`.
2 changes: 1 addition & 1 deletion doc/lib/swift/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,6 @@ A catalog that needs a newer moq-hang draft than this build reads raises `MoqErr

## Reference

- API reference: [Swift Package Index (DocC)](https://swiftpackageindex.com/moq-dev/moq-swift/documentation/moq)
- API source: [swift/Sources/Moq](https://github.com/moq-dev/moq/tree/main/swift/Sources/Moq)
- Source: [`swift/`](https://github.com/moq-dev/moq/tree/main/swift); `just swift check` builds and tests on a Mac
- Packages SPM resolves: [moq-dev/moq-swift](https://github.com/moq-dev/moq-swift), [moq-dev/moq-swift-ffi](https://github.com/moq-dev/moq-swift-ffi)
11 changes: 10 additions & 1 deletion doc/setup/prod.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,21 @@ contact = ["mailto:ops@example.com"]
dir = "/var/lib/moq-relay/acme"

[auth]
key = "/etc/moq/public.jwk"
url = "http://127.0.0.1:4440/"

[internal]
listen = "127.0.0.1:9101"
```

Run the auth server on the same host and supervise it alongside the relay:

```bash
moq auth serve --key /etc/moq/public.jwk
```

It verifies each session's JWT; a session without one is refused. See
[Authentication](/bin/relay/auth) to define another access policy.

Let's Encrypt validates the domain by connecting to TCP port 443, so
`web.https.listen` must be reachable there, directly or forwarded. The first
start waits for the certificate before serving anything; later starts reuse
Expand Down
10 changes: 5 additions & 5 deletions js/flate/src/snapshot/consumer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ export class Consumer {
/**
* Get the next value in group order, or `undefined` once the track ends.
*
* Buffers every value the reader has not reached yet. On a timed track, a group the
* subscription's `maxDelay` proves too old is skipped: the default of zero keeps only the
* newest group, so a playhead reader sets `maxDelay` to how far it trails the live edge. An
* untimed track never proves a group stale, so a reader that falls behind replays the whole
* backlog; use {@link latest} to skip it. A group lost to a gap resyncs from the next one.
* Buffers every value the reader has not reached yet. A group the subscription's `maxDelay`
* proves too old is skipped, counting media time and wall time, or wall time alone for an
* untimed track. The default of zero keeps only the newest group, so a playhead reader sets
* `maxDelay` to how far it trails the live edge. Use {@link latest} to skip straight to the
* head. A group lost to a gap resyncs from the next one.
*/
next(): Promise<Timed<Uint8Array> | undefined> {
return this.#read(false);
Expand Down
10 changes: 5 additions & 5 deletions js/json/src/snapshot/consumer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ export class Consumer<T> {
* Get the next state in order, or `undefined` once the track ends.
*
* Yields one state per frame and finishes a group before starting the next, buffering every
* state the reader has not reached yet. On a timed track, a group the subscription's `maxDelay`
* proves too old is skipped: the default of zero keeps only the newest group, so a playhead
* reader sets `maxDelay` to how far it trails the live edge. An untimed track never proves a
* group stale, so a reader that falls behind replays the whole backlog; use {@link latest} to
* skip it. A group lost to a gap resyncs from the next one.
* state the reader has not reached yet. A group the subscription's `maxDelay` proves too old
* is skipped, counting media time and wall time, or wall time alone for an untimed track. The
* default of zero keeps only the newest group, so a playhead reader sets `maxDelay` to how far
* it trails the live edge. Use {@link latest} to skip straight to the head. A group lost to a
* gap resyncs from the next one.
*/
next(): Promise<Timed<T> | undefined> {
return this.#read(false);
Expand Down
34 changes: 34 additions & 0 deletions quest/m0/audit-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,37 @@ Cross-Package Sync table in AGENTS.md for changes merged since the previous
run that skipped a target. `#![warn(missing_docs)]` is set in 12 of 42
crates; find the published ones without it. VitePress
checks internal links only; nothing checks external ones (try `lychee`).

Audit checkpoint (2026-10-19, base `82c2d5dde`):

- Corrected TS Opus and FLV/RTMP codec support, including the stale claim that
MP3 is dropped. Corrected Rust browser-driver setup, the net type example,
and the spawned connection lifecycle. Corrected JSON/flate snapshot docs:
untimed groups are subject to wall-clock staleness too.
- Replaced the production recipe's retired `[auth].key` with an auth-server
URL and the `moq auth serve --key` process it needs.
- Checked 259 distinct external URLs from 69 documentation pages: 217
answered successfully. Verified unavailable RTSP/ICE, RTC wire, C, Python,
and Swift references and replaced them with current repository source.
Crates.io's HTML routes return 404 to this checker even for existing
packages, whose API routes work; protocol endpoints and example hosts are
not website health checks. Sixteen sites refused HEAD with 403 and still
need manual verification. Every GitHub `main` source path in the pages exists.
- Built the default-feature `moq` binary and checked 34 help contexts.
All 37 complete, supported shell examples parsed with `--help`; seven
examples need optional capture/play/transcode/iroh features. Gateway and
inspection pages use supported flags. Feature-only flags were checked
against their declarations, but those builds and GStreamer inspection
remain to be exercised.
- The stats documentation validator, `quest check` (438 documents), and
`git diff --check` passed, and so did `just check` on the changed packages
(the doc site and the JS packages).
- The exported-symbol audit is incomplete. Of 38 Rust library roots, 12
enable `missing_docs`; 24 publishable roots do not: hang, kio, libmoq,
moq-archive, moq-audio, moq-auth, moq-c, moq-clock, moq-ffi, moq-flate,
moq-gst, moq-json, moq-loc, moq-msf, moq-mux, moq-native, moq-nvenc,
moq-relay, moq-sock, moq-stats, moq-transcode, moq-uring, moq-v4l, and
moq-video. This is lint coverage, not a claim that each has missing docs.
Run rustdoc with missing-doc diagnostics, review public TypeScript exports,
and finish the Cross-Package Sync walk before calling this run complete.
Do not add the successor until that work and the remaining checks pass.
Loading