MiroTalk LK recording
The host (or a co-host) records with the Record button (in the ⋯ menu on small screens). The Recording dialog lets them choose where to record:
| Method | How it works | Needs |
|---|---|---|
| On the server | LiveKit Egress joins the room and writes the whole meeting to an MP4 (or OGG). | RECORDING_ENABLED=true + egress |
| In this browser | The host's browser mixes the meeting into one video and records it with MediaRecorder. |
Nothing (on by default) |
Only one recording runs at a time. Everyone in the meeting, including people who join later, sees a pulsing ● REC badge and a notification while either kind runs, so let participants know about recording where consent is required. The same egress can also stream the meeting live, alongside a recording or not.
On the server (LiveKit Egress)
- Files are saved to
./recordingsby default, or uploaded to S3-compatible storage (AWS S3, MinIO, Cloudflare R2...) whenS3_BUCKETis set. - The option only appears when
RECORDING_ENABLED=true, and never in an end-to-end encrypted meeting: egress can't decrypt it. Recording in the browser still works there; uploaded to the server, that recording is no longer end-to-end encrypted.
Local development
# instead of `npm run livekit:dev` (starts LiveKit + Redis + Egress)
LIVEKIT_NODE_IP=$(ipconfig getifaddr en0) npm run recording:dev # macOS; on Linux use your LAN IP
# .env: RECORDING_ENABLED=true
npm run dev
Egress records from inside Docker, so LiveKit must advertise an IP that containers can reach. Use your LAN IP (or public IP in production), not 127.0.0.1.
Production – set RECORDING_ENABLED=true (plus S3_* for cloud storage) and start the egress profile:
mkdir -p recordings && chmod 777 recordings # egress runs as a non-root user
docker compose --profile recording up -d --build
Plan for ~2-4 vCPUs per concurrent recording at 1080p, about half at the default RECORDING_QUALITY=720p, and very little with audio. The egress container is capped at EGRESS_CPUS (default 2) so a recording can't starve live calls on the same server; on a 4 vCPU VPS expect one recording at a time (run egress on a separate machine to scale).
In the host's browser
No extra service is needed and it costs the server no CPU: the host's browser draws everyone's camera and shared screen on a canvas (720p, 30 fps; screens large with people beside them, otherwise a grid; avatars for cameras that are off, names, the active speaker highlighted), mixes every microphone and shared-screen audio with the Web Audio API, and encodes it with MediaRecorder – WebM (VP9/VP8 + Opus) in Chrome, Edge and Firefox, MP4 in Safari, whichever the browser supports. It follows people joining and leaving, muting, cameras, screen shares and device switches, and keeps recording while the tab is in the background.
Browsers write WebM as they record, without a duration or an index, so players can't show its length or seek in it. The app adds both (a SeekHead and Cues at every video keyframe) when the file is downloaded and when an upload is saved, copying the audio and video as they are (no re-encoding, no quality loss, no ffmpeg needed). A recording cut short is fixed up to its last complete frame. Safari's MP4 recordings are kept as recorded.
The host chooses what happens to the file:
| Storage | What happens |
|---|---|
| On this device (default) | Kept in the browser; the host downloads it when they stop. Nothing is uploaded. |
| Upload while recording | Every 2 seconds the new part is uploaded, so little is lost if the device fails. The server saves the file (and moves it to S3 when S3_BUCKET is set). |
| Upload when finished | Kept in the browser while recording and uploaded when the host stops; it can still be downloaded too. |
The upload options only appear with CLIENT_RECORDING_UPLOADS=true (the default). Uploaded files go to CLIENT_RECORDING_DIR (default ./recordings), named <room>-<UTC time>-<id>.webm (or .mp4, from browsers that record MP4, like Safari), or to the S3 bucket egress uses (s3://<bucket>/<file>), with the same S3_* settings; the S3 credentials never reach the browser. If the upload to S3 fails, the file stays on disk. A recording.finished webhook with "method": "client" is sent for every saved upload.
What the host should know (the dialog says so too):
- The recording depends on the host's device and browser: keep the tab open and the device awake until the recording is saved. A slow device records a choppier video.
- The browser keeps the recording on disk (the origin private file system) as it goes. If the tab is closed or reloaded, the browser crashes or the host loses their connection, what was recorded until then is kept: the next time the app is opened in that browser, it offers to download it. If the device itself is lost (or the site's data is cleared) before the file is saved, the recording is lost – use Upload while recording to avoid that. Browsers without that storage keep the recording in memory, where closing the tab loses it.
- The browser asks before the page is closed while a recording is running or uploading.
- Network drops don't stop an upload: it's retried with backoff (and right away when the browser is back online), continuing where it stopped. If more than 200 MB wait to be uploaded, the rest is uploaded from the copy on disk once the recording stops (or, in browsers without one, the recording stops and what was uploaded is kept), so it doesn't pile up in memory. If the browser stops sending for 10 minutes (12 hours for Upload when finished), the server keeps what it received.
- Leaving the meeting, losing the host role or another host pressing Stop ends the recording and saves it.
Security: only hosts and co-hosts can start a recording; the person recording or a host can stop it. Each upload gets its own random token, given only to the host who started it, so nobody else can add to, finish or delete it. Uploaded recordings are not served by the app.
To turn in-browser recording off, set CLIENT_RECORDING_ENABLED=false; to allow it only without uploads, CLIENT_RECORDING_UPLOADS=false. CLIENT_RECORDING_MAX_MB (default 4096, roughly 3 hours) limits the size of one upload. Since anyone who starts a meeting can upload (unless host sign-in is on), the server also limits uploads in progress at once (CLIENT_RECORDING_MAX_UPLOADS, default 20) and keeps CLIENT_RECORDING_MIN_FREE_MB (default 1024) of the disk free: while less would remain, pieces are refused and the browser keeps them and retries. With Docker, the app container writes uploads to ./recordings (mounted in docker-compose.yml), which must be writable (chmod 777 recordings). With several app instances, uploads in progress collect in S3 or on a disk they all share (CLIENT_RECORDING_STAGING, see Scaling).