Record a single WebRTC track (not the full room) from a LiveKit session using Track Egress

domain: docs.livekit.io · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Call the LiveKit Egress service's StartTrackEgress via the Server SDK/Twirp API (https://<host>/twirp/livekit.Egress/StartTrackEgress) with an access token carrying the roomRecord grant
  2. Specify room_name and track_id for the single track to export (audio or video, not both)
  3. Set exactly one output: a file output (container is auto-selected — H.264 to MP4, VP8 to WebM, Opus to Ogg) or a websocket_url for raw PCM audio streaming
  4. If streaming to a websocket, expect binary PCM (pcm_s16le) frames plus JSON text frames carrying mute state ({"muted": true/false})
  5. Subscribe to egress webhooks to confirm the egress reaches EGRESS_ACTIVE/EGRESS_COMPLETE status

Known gotchas

Related routes

Configure WebRTC WHEP egress on a media server for low-latency viewer playback
datatracker.ietf.org · 6 steps · unrated
Configure LiveKit Egress to record a room composite to an S3-compatible bucket
docs.livekit.io · 6 steps · unrated
Configure LiveKit Egress to record a room composite to S3
docs.livekit.io · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans