Stream a LiveKit room to RTMP with one JSON Job

Turn an existing LiveKit room into a production RTMP feed without writing room egress, FFmpeg, or worker orchestration code.

The pipeline

  1. LiveKit source
  2. video mixer
  3. audio mixer
  4. RTMP push

What this replaces

Build it yourself

  • Run a privileged room egress bot with subscribe permissions
  • Supervise an FFmpeg process and its restart behavior
  • Render a synchronized grid layout yourself
  • Handle RTMP credentials, keyframes, and reconnects

With AVFlow

  • Submit a JSON Job through the REST API
  • Let AVFlow join the room and compose the room
  • Re-POST the same Job name to update a running pipeline
  • Watch job state changes through webhooks

The validated Job

This is the same file 00-hello-mix.json serves. Replace platform credentials, output URLs, and storage secrets before running it.

00-hello-mix.json Download
{
  "name": "room-to-rtmp",
  "sources": [
    {
      "name": "room",
      "type": "livekit",
      "config": {
        "serverUrl": "wss://your-project.livekit.cloud",
        "token": "eyJ..."
      }
    }
  ],
  "nodes": [
    {
      "name": "video",
      "type": "video_mixer",
      "inputs": [
        "room"
      ],
      "config": {
        "layout": {
          "mode": "grid"
        }
      }
    },
    {
      "name": "audio",
      "type": "audio_mixer",
      "inputs": [
        "room"
      ]
    }
  ],
  "sinks": [
    {
      "name": "stream",
      "type": "rtmp_push",
      "inputs": [
        "video",
        "audio"
      ],
      "config": {
        "urls": [
          "rtmp://live.example.com/app/stream-key"
        ],
        "encoding": {
          "videoCodec": "h264",
          "audioCodec": "aac"
        }
      }
    }
  ]
}
Submit it API
curl -X POST "https://api.avflow.dev/v1/jobs" \
  -H "Authorization: Bearer $AVFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d @00-hello-mix.json

Know the limits before you ship

  • The LiveKit access token must have the grants AVFlow needs to subscribe.
  • A multi-participant room normally needs video and audio mixers before a 1:1 RTMP sink.
  • RTMP credentials remain yours; replace the placeholder URL before running the example.

Run this LiveKit pipeline

Generate the Job in Playground, then run it with $20 promotional credit.