Skip to main content

Recordings

The recordings resource captures a meeting five ways:

  • the whole room, composed into one file;
  • one participant;
  • one track (audio, video, or screen);
  • a server-side composite mix of selected participants;
  • a two-channel stereo audio merge.

start and stop act on a room's live session. Room and composite start return an egress handle you pass to stop (a room recording can also stop by room id).

Room recordings

const rec = await client.recordings.start(roomId, {
composition: { layout: "grid", quality: "high" },
fileFormat: "mp4",
});

await client.recordings.stop(rec); // or client.recordings.stop(roomId)

start options: composition (see below), transcription, onFailure, fileFormat (mp4 or webm), webhookUrl, dirPath, resourceId, preSignedUrl.

Manage finished recordings:

await client.recordings.list({ roomId, withTranscription: true });
await client.recordings.get(recordingId, { withTranscription: true });
await client.recordings.delete(recordingId);

Participant recordings

await client.recordings.participant.start(roomId, { participantId, fileFormat: "webm" });
await client.recordings.participant.stop(roomId, participantId);

fileFormat is mp4, webm, or m3u8. Also list, get, and delete.

Track recordings

kind is required, and the kind you stop with must match the one you started.

await client.recordings.track.start(roomId, { participantId, kind: "video" });
await client.recordings.track.stop(roomId, participantId, "video");

kind is audio, video, screen_audio, or screen_video. Also list, get, and delete.

Composite recordings

start returns a handle whose id is the recordingId you need to stop it.

const rec = await client.recordings.composite.start(roomId, {
participants: [{ participantId: "participant-alice", kind: ["audio", "video"] }],
watermarks: [{ type: "custom", imageUrl: "https://example.com/logo.png", text: "CONFIDENTIAL" }],
});

await client.recordings.composite.stop(rec);

Also list, get, and delete.

Merge recordings

const { recording } = await client.recordings.merge.create({
sessionId,
channel1: [{ participantId: "participant-alice" }],
channel2: [{ participantId: "participant-bob" }],
});

Also list and get.

Composition

The composition option controls layout and rendering; the same shape is used by HLS and RTMP. Set a named layout or a custom template URL.

FieldValues
layoutgrid, spotlight, sidebar, or a custom template URL
prioritySPEAKER or PIN
gridSizetiles in grid, 0–25 (default 25)
orientationportrait or landscape
themeDARK, LIGHT, or DEFAULT
qualitylow, med, high, or ultra

There is no resolution option; use quality.

Got a Question? Ask us on discord