Wiring & DAG
AVFlow builds a directed acyclic graph (DAG) from each component’s inputs array.
Each entry may be an upstream component name or an object with name and an
edge-specific select filter.
Basic rules
Section titled “Basic rules”- Sources have no
inputs— they produce media. - Nodes consume one or more upstream components and produce processed media.
- Sinks consume upstream components and write output (stream, file, room, etc.).
- Every
inputsentry must reference an existing component by name. - The graph must be acyclic.
Media types
Section titled “Media types”Components exchange video, audio, and optionally captions (from ASR). AVFlow infers which streams to pass when you connect components — you rarely need manual split nodes.
Use select to filter by participant identity, track type, or media type. On RTC sources it lives inside config; on nodes and sinks it lives on the input entry.
Use object-form inputs to filter each upstream:
"inputs": [ { "name": "room_a", "select": { "identities": ["alice"] } }, { "name": "room_b", "select": { "identities": ["bob"] } }]A filter applies only to its own edge. What passes it is still limited to the media types the component consumes.
Common patterns
Section titled “Common patterns”Source → sink (relay)
Section titled “Source → sink (relay)”A relay has no processing nodes: the source connects straight to the sink. This works for pull sources (rtmp_pull, whep, srt_pull, rtsp_pull, file_pull) and 1:1 sinks such as rtmp_push.
rtmp_pull ──► rtmp_pushSource → mixers → sink (mix)
Section titled “Source → mixers → sink (mix)”RTC room sources (livekit, jitsi, daily, agora) are multi-stream (1:n) and need a mix — video_mixer and audio_mixer — before rtmp_push or similar 1:1 sinks, even for a single participant.
Composite recording
Section titled “Composite recording”Same mix pattern as above, often with a segment sink:
livekit ──► video_mixer ──► rtmp_push └──► audio_mixer ──┘ASR captions
Section titled “ASR captions”Wire the ASR node into sinks that support subtitles (segment, rtmp_push, RTC sinks, etc.).
livekit ──► audio_mixer ──► segment └──► asr ──────────┘Per-track audio over WebSocket
Section titled “Per-track audio over WebSocket”Both audio_resample and
websocket are n:n, so RTC participant tracks stay
independent:
livekit ──► audio_resample ──► websocket 1:n n:n n:nValidation errors
Section titled “Validation errors”Jobs are rejected at submit time if:
- A
1:1RTC sink (e.g.rtmp_push) is wired directly to a multi-participant RTC source without a mixer segmentis connected directly to a multi-track RTC source (use mixers first)- Input limits are exceeded
Fix the topology and resubmit — AVFlow does not partially run invalid graphs.
Changing wiring on a running job
Section titled “Changing wiring on a running job”Resubmit the full job with the same name. You can add or remove sources, nodes, and sinks, and update inputs on existing nodes and sinks in the same request — for example, add a second livekit source and append it to a video_mixer’s inputs array.
Sink input changes use make-before-break switching: new upstream tracks are connected before old ones are removed, so output stays continuous when possible.