most-whale-61185
04/07/2026, 6:02 PMtall-airline-16756
04/07/2026, 6:03 PMtall-airline-16756
04/07/2026, 6:03 PMegress_started / egress_ended) to track status and cleanup.
• If you must keep Track Egress (e.g., for per-track archival), run a lightweight post-processing step to mux/sync tracks (FFmpeg) — but this adds infra and complexity.
Examples / references:
• Look at the LiveKit composite examples and the /meet example that show production-ready egress flows and templates.
• There are example repos demonstrating Composite/Room egress usage (see the LiveKit composite examples).
Quick question to help next:
• Do you need recorded output as a single mixed file (one MP4), or do you require individual tracks for later processing?
If you say which output you want and where you want to store files (S3/local), I’ll give step-by-step egress configuration and a sample request you can run on your self-hosted setup.
Sources: Universal Egress | LiveKit | server-sdk-js | livekit/livekit_composite | DeepWiki | examples/other | livekit/livekit_composite | DeepWiki | examples/voice_agents | livekit/livekit_composite | DeepWiki | Why is there extra audio at the end of my recordings of an agent session? |..., with interactive elementsmost-whale-61185
04/07/2026, 6:05 PMtall-airline-16756
04/07/2026, 6:05 PMegress_started, egress_ended) to monitor job status and store resulting file URLs.
2. If storing locally, move finished files to long-term storage (S3/GCS) for analysis and download.
3. Optionally kick off an analysis pipeline once track files are available.
Practical tips:
• Use Room Composite layout templates (speaker/gallery) to get a clean MP4 without building layouts.
• If you need per-participant AV (audio+video together), use Track Composite per participant instead of raw Track Egress audio-only/video-only outputs.
• Start both egress jobs nearly simultaneously to keep timing consistent. Room Composite handles final sync; track files may still need careful timestamp handling if you later correlate events.
• For lower infra overhead: let LiveKit handle mixing (Room Composite) and push files straight to S3/GCS rather than storing/processing locally.
Next step I can provide:
• Sample API requests for Room Composite and Track/Track Composite egress tailored to self-hosted LiveKit.
• Example webhook handling snippet and recommended storage configuration.
Would you like the sample API requests and webhook example now? If so, tell me whether you prefer S3 or local storage and if you want per-participant Track Composite or raw Track Egress files.
, with interactive elementsmost-whale-61185
04/07/2026, 6:08 PMtall-airline-16756
04/07/2026, 6:08 PMmost-whale-61185
04/07/2026, 6:10 PMtall-airline-16756
04/07/2026, 6:10 PMffmpeg -i video.mp4 -i audio.ogg -c:v copy -c:a aac -b:a 128k -map 0:v:0 -map 1:a:0 -shortest output.mp4
2) If video is VP8 in IVF and audio is Opus in OGG — transcode video to H.264 and audio to AAC, then mux:
ffmpeg -f ivf -i video.ivf -i audio.ogg -c:v libx264 -preset veryfast -crf 23 -c:a aac -b:a 128k -map 0:v:0 -map 1:a:0 -shortest output.mp4
3) If you have separate per-participant video and audio tracks (N participants), first align durations and then merge. Example for two participants (v1,a1) + (v2,a2) into a side-by-side gallery layout using filter_complex:
ffmpeg \
-i v1.mp4 -i a1.ogg \
-i v2.mp4 -i a2.ogg \
-filter_complex "
[0:v]scale=640:360[pv1];
[2:v]scale=640:360[pv2];
[pv1][pv2]hstack=inputs=2[vout];
[1:a][3:a]amerge=inputs=2[aout]
" \
-map "[vout]" -map "[aout]" -c:v libx264 -crf 23 -preset veryfast -c:a aac -ac 2 -shortest output.mp4
• amerge produces a multi-channel stream; use -ac 2 to downmix to stereo if needed.
• Adjust scales, layout, and codecs to match quality/CPU constraints.
4) If raw timestamps drift or files start at different times, use -itsoffset to shift inputs:
ffmpeg -itsoffset 0.5 -i audio.ogg -i video.mp4 -c:v copy -c:a aac output.mp4
(positive value delays that input by 0.5s)
Helpful flags:
• -shortest stops at shortest stream length.
• -map controls which streams to include.
• -async 1 or -vsync 2 can help with A/V sync in tricky cases.
If you want, tell me:
• exact input file types you receive (extensions/codecs), and
• whether you want a single speaker view, gallery, or picture-in-picture layout,
and I’ll give a tailored FFmpeg command for your files.
, with interactive elements