open-standards/wai/examples/encoder-ingest/README.md
Transaction Science e8c8327631 wai/examples: every template Apache-2.0, its LICENSE carried into the project
Each example holds the license's text as LICENSE (wai/LICENSE, byte for byte) and says so in
its README; wai create writes it with the rest of the template, from one copy in the binary.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 04:52:31 -04:00

33 lines
1.6 KiB
Markdown

# Stream from an encoder into a room
**What it shows.** An encoder's stream entering a room over SRT. The room's authority grants
the encoder's key a publisher's place; an ingest gateway opens an SRT session for that grant
once the encoder's side proves it holds the key, and publishes what arrives as the room's
video and audio tracks. The gateway signs each group's receipt as the first hop; the relay
checks every object against it at its door, and a subscriber checks each one again.
**Run it.**
```sh
wai create my-ingest --template encoder-ingest
cd my-ingest
cargo run --release
```
It prints an `srt://127.0.0.1:…` address. Point an SRT encoder at it (MPEG-TS with H.264 or
HEVC video and AAC audio, caller mode, the stream ID and passphrase as given).
**What you see.** A line for the first groups of each track as they arrive, each verified
against the receipt the gateway signed. `cargo run --release -- --synthetic 5` sends five
seconds of a synthetic program itself (shaped like H.264 and AAC, not watchable) and exits 0
once every group verified.
**Make it yours.** The gateway also takes RTMP and WHIP, and serves WHEP to players; its
configuration file is `gateway.example.toml` in the repository's `joule-moq-ingest` crate. The
first build fetches the repository and compiles the relay and the gateway.
**With a coding assistant.** Run `wai setup-agent` in this directory: it writes the
instructions an assistant reads and connects it to WAI's tools.
**License.** Apache-2.0: the text is in `LICENSE`, and a project `wai create` makes from this
example carries it.