Reference
Crates and features
Most applications depend on iroh-live alone. It re-exports the node as
iroh_live::node, the media crates as iroh_live::media, moq-net as
iroh_live::moq_net, the value-track writer as iroh_live::ValueWriter, and
the rooms crate as iroh_live::rooms behind the rooms feature.
irl (CLI) your application iroh-live-relay
\ | / (browsers)
+------------ iroh-live (facade) -------+
| | |
media: moq-ext-* iroh-live-node iroh-live-rooms
(publisher, player, (routes, access, (gossip rooms)
sources, adaptive) relay links)
| |
moq-video, moq-audio moq-transport-iroh -- iroh
| Crate | What it is | Depends on iroh |
|---|---|---|
iroh-live | The facade: Calls, SubscriptionExt, RoomExt, RoomsNode, and the re-exports of the crates below | yes |
iroh-live-node | The node: route table, publications and audiences, sessions, relay links, policies, link statistics, BroadcastTicket, LiveLayout, EndpointConfig, MoqPreset | yes |
moq-transport-iroh | MoQ sessions over iroh connections: dial, accept, ALPN negotiation | yes |
iroh-live-rooms | Rooms: gossip membership and members-only broadcasts. No media | yes |
moq-ext-access | Grants, policies, token verifiers, the Layout trait and audiences | no |
moq-ext-publisher | LocalBroadcast: encodes sources into a ladder of renditions | no |
moq-ext-player | RemoteBroadcast and Player: rendition choice, A/V sync, recording input | no |
moq-ext-adaptive | Rendition choice and decoder handover as pure state machines | no |
moq-ext-json | ValueWriter: a latest-value JSON track writer that stamps each update | no |
moq-ext-sources | Video and audio sources: test pattern, files, capture, push senders | no |
moq-ext-egui | egui video views and the debug overlay | no |
iroh-live-cli | The irl binary | yes |
iroh-live-relay | The media relay server | yes |
The moq-ext-* crates have no iroh dependency, so each could move into moq
upstream.
Capture, codecs and rendering come from moq’s
moq-video and moq-audio, which
iroh_live::media::video and iroh_live::media::audio re-export.
API docs
The crates are not on crates.io yet, so docs.rs has no pages for them. The
documentation site hosts the API docs, built from main with every
feature on. Start at iroh_live. To build them from a
checkout:
cargo doc --workspace --all-features --no-deps --open
The crate-level docs of iroh-live list which futures are cancellation safe
and what dropping each one leaves behind.
Cargo features
This section is the single list of the workspace’s Cargo features. Most
applications depend on iroh-live and pick features there. It passes each one
through to the crates below it. The crates without a table here have no
features.
iroh-live
Only crypto-aws-lc-rs is on by default. player is the receive side,
publisher the send side. A device feature turns on its side; a backend or codec feature
turns on no side and applies to whichever side is on.
| Feature | Enables | Implies | Platform |
|---|---|---|---|
crypto-rind | rind, pure Rust, as the crypto backend. Needs default features off | all | |
crypto-ring | ring as the crypto backend, for iroh’s tls-ring | all | |
crypto-aws-lc-rs | aws-lc-rs as the crypto backend, for iroh’s tls-aws-lc-rs. The default | all | |
full | The usual app set | media, capture, playback, render, record, pipewire, pulseaudio | all |
media | Both sides of iroh_live::media | player, publisher | all |
player | Receive: RemoteBroadcast, Player, the decoders, media::SubscriptionExt, and media::RoomExt with rooms | all | |
publisher | Send: LocalBroadcast, the encoders, the sources, the test pattern | all | |
capture | Camera, screen and microphone | publisher | all |
file | MediaFile for MP4, AudioSource::file for WAV, MP3 and MP4 | publisher | all |
rpicam | The Raspberry Pi camera through rpicam-vid | publisher | Linux |
playback | Speaker output, AudioMode::Play | player | all |
render | GPU rendering through wgpu, re-exported as media::wgpu | player | all |
record | RemoteBroadcast::mux_source, for moq-mux exports | player | all |
aec | Echo cancellation for the microphone | capture, playback | all |
pipewire | PipeWire audio devices. With publisher it also builds device capture, as capture does, with PipeWire’s camera and the portal’s screen picker through PortalGrant. Links libpipewire-0.3 | no side; device capture with publisher | Linux |
pulseaudio | PulseAudio audio devices | no side | Linux |
vaapi | VA-API decode with player, encode with publisher, Intel and AMD | no side | Linux |
nvidia | NVDEC with player, NVENC with publisher | no side | Linux |
v4l2 | The V4L2 memory-to-memory H.264 codec of ARM SoCs, such as a Pi 4 | no side | Linux |
rooms | iroh_live::rooms, the iroh-live-rooms crate, and RoomsNode | all | |
jwt | policy::JwtVerifier, which verifies moq-relay’s JWTs | all | |
rcan | policy::RcanVerifier, which verifies rcan capability chains | all | |
qlog | A qlog trace of every QUIC connection, written into the directory QLOGDIR names. Without QLOGDIR, nothing is written | all |
Without player or publisher, iroh-live is the node, tickets, layouts
and calls, with no codec dependency. A player-only build has no
moq-ext-publisher; it still builds OpenH264’s encoder, since moq-video
vendors OpenH264 as one library.
player decodes without a speaker; playback adds the speaker.
Crypto backend
The crypto-* features pick one rustls CryptoProvider for iroh’s QUIC and
TLS, its iroh relay and DNS clients, and moq’s QUIC, WebTransport and media
media relay listeners. iroh_live::crypto_provider installs it as rustls’s process
default on first use, before an endpoint or a moq config is built, and every
endpoint MoqPreset, MinimalPreset and EndpointConfig build runs on that
same provider. A provider the process installed before is kept and used
instead, and a warning names it if it is not the selected backend. Two such
installs come without the application asking: moq code that runs first
installs rind, and rustls installs ring on the first ClientConfig::builder()
when it has only its ring feature on, as through reqwest’s rustls-tls.
Features are additive, so a build can end up with more than one. ring wins
over aws-lc-rs, as in iroh’s own presets, and both win over rind. A build with
none of them on uses rind, so --no-default-features builds what
crypto-rind builds. Since crypto-aws-lc-rs is on by default, an app that
asks for crypto-rind still runs on aws-lc-rs unless it also sets
default-features = false:
iroh-live = { git = "https://github.com/n0-computer/iroh-live", default-features = false, features = ["crypto-rind", "full"] }
Any crate in the graph that depends on iroh-live, iroh-live-node or
iroh-live-relay with default features turns aws-lc-rs back on, so a library
should depend on them with default-features = false and leave the backend
to the app. The workspace’s own dependencies do so.
moq requires rind, so it is compiled in with every backend. moq-auth’s JWTs,
the QUIC Retry tag and moq’s self-signed certificates stay on rind whatever
the feature. crypto-rind builds neither ring nor aws-lc-rs, and needs no C
toolchain for TLS. crypto-ring and crypto-aws-lc-rs need a C compiler,
for ring and for aws-lc-sys. aws-lc-sys needs CMake only for FIPS, no-asm,
sanitizer or bindgen builds.
aws-lc-rs is the default until rind’s per-path QUIC keys
(kixel-ai/rind#1278) are released, and the default then moves to
crypto-rind. Until then, crypto-rind needs the root Cargo.toml’s
[patch.crates-io] block for rind and rind-rustls. Without it,
crypto_provider panics with a message that names the block. See Install.
iroh’s presets::N0 and presets::Minimal exist only with one of iroh’s
tls-* features, so a crypto-rind build does not have them. Use
MoqPreset and MinimalPreset instead.
The audio server behind pipewire and pulseaudio is checked at runtime,
so a build with either still runs on a system without that server, and
full can carry both.
A Linux-only feature compiles to nothing on other platforms. macOS, Windows and Android get their capture and codec frameworks without a feature.
H.265 and AV1 have no software decoder, and H.265 has no software encoder.
They need a hardware backend, such as vaapi or nvidia on Linux or
VideoToolbox on macOS. See
Platform support.
iroh-live-cli
irl always has capture, file, playback, render, rooms and
record. Every other feature is on by default, so
cargo install --path iroh-live-cli builds every backend the platform can
reach.
| Feature | Default | Effect |
|---|---|---|
aec | yes | Echo cancellation for irl call and irl room |
pipewire | yes | PipeWire audio devices, PipeWire’s camera as cam, and the portal’s picker as screen, screen:portal and window:portal (Linux) |
pulseaudio | yes | PulseAudio audio devices (Linux) |
rpicam | yes | --video rpicam (Linux) |
vaapi, nvidia | yes | Hardware encode and decode (Linux) |
v4l2 | yes | --encoder v4l2 and the matching decoder (Linux) |
qlog | no | A qlog trace of every connection into QLOGDIR |
On Linux, the default build needs libpipewire and libclang, see
Install.
The lower crates
Applications that skip the facade pick the same features on the crates that define them:
| Crate | Features | Default |
|---|---|---|
moq-ext-publisher | capture, pulseaudio, aec, pipewire, file, rpicam, vaapi, nvidia, v4l2 | none |
moq-ext-player | playback, render, record, aec, pipewire, pulseaudio, vaapi, nvidia, v4l2 | none |
moq-ext-sources | pattern, file, capture, pulseaudio, aec, pipewire, rpicam, serde | pattern |
moq-ext-access | jwt, rcan | none |
iroh-live-node | crypto-rind, crypto-ring, crypto-aws-lc-rs, jwt, rcan, forwarded to moq-ext-access, and qlog, forwarded to iroh | crypto-aws-lc-rs |
iroh-live-relay | crypto-rind, crypto-ring, crypto-aws-lc-rs, qlog | crypto-aws-lc-rs |
moq-ext-publisher and moq-ext-player encode and decode with no feature at
all. They cannot open a device or draw until capture, playback or
render is on. The test-util features of iroh-live-node,
moq-ext-player and iroh-live-rooms hold test helpers and are not a public
API.
qlog
With qlog on, every endpoint bound with MoqPreset or EndpointConfig, or
given Congestion::transport_config, writes one qlog file per QUIC connection
into the directory the QLOGDIR environment variable names. The variable is
read, and the directory created, when the transport config is built: as
EndpointConfig::bind binds, or as MoqPreset is applied to a builder.
Without QLOGDIR nothing is written, and setting it later has no effect on an
endpoint already built.
iroh-live, irl (iroh-live-cli) and iroh-live-relay forward the
feature. The media relay traces its iroh connections, but not the browsers’.
Each file is named iroh-live-<unix ms>-<connection id>-<client|server>.qlog.
The connection id is the client’s first destination id, so the client and
server files of one connection share it, and you can pair the two ends. Tools
such as qvis show the packets, losses,
congestion window and RTT, and so where a stalled connection stops sending.
cargo install --path iroh-live-cli --features qlog
QLOGDIR=./qlog irl publish
Disk use has no limit. The trace logs every packet each side sends and
receives, so a file is about as large as the data of its connection, and
nothing rotates, caps or deletes the files. A publisher that sends 3 Mbit/s
writes about 1.3 GB per hour for each subscriber. Set QLOGDIR only while
you diagnose, and do not leave it set on a long-running node.
Two more things to know before you turn it on:
QLOGDIRis a shared name. quiche, ngtcp2 and curl read it too, so aQLOGDIRset for one of them in a shell profile or service unit also starts the traces here.- The traces hold the peers’ IP addresses. Check that before you attach one to a public issue.