Keyboard shortcuts

Press ← or → to go to the previous or next page

Press S or / to search the docs

Press ? to show this help

Press Esc to hide this help

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
CrateWhat it isDepends on iroh
iroh-liveThe facade: Calls, SubscriptionExt, RoomExt, RoomsNode, and the re-exports of the crates belowyes
iroh-live-nodeThe node: route table, publications and audiences, sessions, relay links, policies, link statistics, BroadcastTicket, LiveLayout, EndpointConfig, MoqPresetyes
moq-transport-irohMoQ sessions over iroh connections: dial, accept, ALPN negotiationyes
iroh-live-roomsRooms: gossip membership and members-only broadcasts. No mediayes
moq-ext-accessGrants, policies, token verifiers, the Layout trait and audiencesno
moq-ext-publisherLocalBroadcast: encodes sources into a ladder of renditionsno
moq-ext-playerRemoteBroadcast and Player: rendition choice, A/V sync, recording inputno
moq-ext-adaptiveRendition choice and decoder handover as pure state machinesno
moq-ext-jsonValueWriter: a latest-value JSON track writer that stamps each updateno
moq-ext-sourcesVideo and audio sources: test pattern, files, capture, push sendersno
moq-ext-eguiegui video views and the debug overlayno
iroh-live-cliThe irl binaryyes
iroh-live-relayThe media relay serveryes

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.

FeatureEnablesImpliesPlatform
crypto-rindrind, pure Rust, as the crypto backend. Needs default features offall
crypto-ringring as the crypto backend, for iroh’s tls-ringall
crypto-aws-lc-rsaws-lc-rs as the crypto backend, for iroh’s tls-aws-lc-rs. The defaultall
fullThe usual app setmedia, capture, playback, render, record, pipewire, pulseaudioall
mediaBoth sides of iroh_live::mediaplayer, publisherall
playerReceive: RemoteBroadcast, Player, the decoders, media::SubscriptionExt, and media::RoomExt with roomsall
publisherSend: LocalBroadcast, the encoders, the sources, the test patternall
captureCamera, screen and microphonepublisherall
fileMediaFile for MP4, AudioSource::file for WAV, MP3 and MP4publisherall
rpicamThe Raspberry Pi camera through rpicam-vidpublisherLinux
playbackSpeaker output, AudioMode::Playplayerall
renderGPU rendering through wgpu, re-exported as media::wgpuplayerall
recordRemoteBroadcast::mux_source, for moq-mux exportsplayerall
aecEcho cancellation for the microphonecapture, playbackall
pipewirePipeWire 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.3no side; device capture with publisherLinux
pulseaudioPulseAudio audio devicesno sideLinux
vaapiVA-API decode with player, encode with publisher, Intel and AMDno sideLinux
nvidiaNVDEC with player, NVENC with publisherno sideLinux
v4l2The V4L2 memory-to-memory H.264 codec of ARM SoCs, such as a Pi 4no sideLinux
roomsiroh_live::rooms, the iroh-live-rooms crate, and RoomsNodeall
jwtpolicy::JwtVerifier, which verifies moq-relay’s JWTsall
rcanpolicy::RcanVerifier, which verifies rcan capability chainsall
qlogA qlog trace of every QUIC connection, written into the directory QLOGDIR names. Without QLOGDIR, nothing is writtenall

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.

FeatureDefaultEffect
aecyesEcho cancellation for irl call and irl room
pipewireyesPipeWire audio devices, PipeWire’s camera as cam, and the portal’s picker as screen, screen:portal and window:portal (Linux)
pulseaudioyesPulseAudio audio devices (Linux)
rpicamyes--video rpicam (Linux)
vaapi, nvidiayesHardware encode and decode (Linux)
v4l2yes--encoder v4l2 and the matching decoder (Linux)
qlognoA 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:

CrateFeaturesDefault
moq-ext-publishercapture, pulseaudio, aec, pipewire, file, rpicam, vaapi, nvidia, v4l2none
moq-ext-playerplayback, render, record, aec, pipewire, pulseaudio, vaapi, nvidia, v4l2none
moq-ext-sourcespattern, file, capture, pulseaudio, aec, pipewire, rpicam, serdepattern
moq-ext-accessjwt, rcannone
iroh-live-nodecrypto-rind, crypto-ring, crypto-aws-lc-rs, jwt, rcan, forwarded to moq-ext-access, and qlog, forwarded to irohcrypto-aws-lc-rs
iroh-live-relaycrypto-rind, crypto-ring, crypto-aws-lc-rs, qlogcrypto-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:

  • QLOGDIR is a shared name. quiche, ngtcp2 and curl read it too, so a QLOGDIR set 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.