SFU Recording

Introduction

SFU recording can be used to save audio/video calls for offline viewing. SFU recording supports both individual and composite recordings.

Types of SFU recording

Individual recording

Media for each peer is provided as a separate mp4 file. This file will have both audio and video of the peer. These files can be used for offline review or in implementing custom composition.

Composite recording

Audio and video of all peers is composed as per their joining/leaving the meeting and provided as a single mp4. This file can be used for offline viewing of the meeting.

How to enable SFU recording

Using Dashboard

There are two ways to enable SFU recording for a room.

This requires two steps-

  1. Provide upload info in the template and enable the SFU recording.

    Enable recording from a template

  2. Choose Auto for recording while creating a room.

    Choose auto recording while creating a room

    Note: Choosing Auto for recording will make room's recording settings depends on template. That means -

    • Enabling/Disabling SFU recording in template will also enable/disable it for the room.
    • Changes made in upload settings in template, will also be reflected for the room.

Second way

Another way to enable SFU recording for a room is to choose Enabled for recording settings while creating it.

Enable recording when creating a room

Note: Choosing Enabled/Disabled explicitly for recording while creating a room, will make the recording settings in room not depend on template. That means-

  • Enabling/Disabling SFU recording in template will have no effect this template.
  • Room will have its own upload info. By default, they will be uploaded to 100ms storage. More on this below.

Using API

Uploading destination configuration

By default recordings will be uploaded to 100ms storage and a pre-signed URL for the same will be provided to customers via a webhook. The pre-signed URL will expire in 12 hours. Customers can also configure the recordings to be stored in their cloud storage. Following are the configurations for the same.

NameTypeDescriptionRequired
typestringUpload destination type. Currently, s3 (AWS), gs (Google Cloud Storage), oss (Alibaba Cloud) are supported.Yes
locationstringName of the storage bucket in which you want to store all recordingsYes
prefixstringUpload prefix pathNo
optionsobjectAdditional configurations of type Options to be used for uploadingNo
credentialsobjectObject of type Credentials. This is used to share credentials to access the storage bucket specifiedNo

Where Options is

NameTypeDescriptionRequired
regionstringRegion of the account hosting the storage bucket for storing recordings.No

Where Credentials is

NameTypeDescriptionRequired
keystringAccess Key for the account hosting your storage bucket for storing recordingsYes
secretstringSecret for the account hosting the storage bucket for storing recordingsYes

Composite mp4 recording will be placed at: <type>://<location>/<prefix>/<room_id>/<start_date>/<session_id>/Rec-<session_id>-<epoch>.mp4

Example s3://test-bucket/test-prefix/61101349d0f56e684b608c08/20210721/5fccb7dc72909272bf999014/Rec-5fccb7dc72909272bf999014-1626898422000.mp4

Individual mp4 recordings will be placed at: <type>://<location>/<prefix>/<room_id>/<start_date>/<session_id>/<peer_id>/<stream-id>/<stream-id>.mp4

Example s3://test-bucket/test-prefix/61101349d0f56e684b608c08/20210721/5fccb7dc72909272bf999014/76539d6b-d10d-4790-bdd2-ab57fa7facb0/9aeec8db-524d-4129-874d-7a71d340bdec/9aeec8db-524d-4129-874d-7a71d340bdec.mp4

Estimating Recording Size

The size of the recordings is a function of the video and audio bitrate configured for publishing and the duration of the peer in the session. For one hour of recording, the file size can be estimated as:

size = video + audio bitrate (in kbps) * 0.45 MB/hour
Example: Size/hour of a recording with 360p 4:3 video publish at 300kbps would be
    Video -> 300 * 0.45 = 135 MB
    Audio(default at 32kbps) -> 32 * 0.45 = 15 MB (max)
    Total size/hour of the peer recording file = 135 + 15 = 150 MB

Video bitrate can be found from 100ms dashboard under Templates -> Roles -> Configure Role > Publish strategies > video quality

Video Publish Bitrate


Have a suggestion? Recommend changes ->

Run in postman

Was this helpful?

1234