Cloud-based recording

更新时间:
复制 MD 格式

Alibaba Cloud Real-Time Communication (RTC) provides the cloud recording feature. You can determine the recording content based on your business requirements. For example, you can synchronize the screen during audio and video calls to the cloud for stream mixing and record the mixed content. This topic describes how to store the recordings in Object Storage Service (OSS).

Note You are charged for the cloud-based recording feature from 23:00 on April 1, 2021. For more information about the prices and billing methods, see RTC pricing and Cloud recording billing.

Prerequisites

Flowchart

001

Store recordings in OSS

Alibaba Cloud RTC allows you to record source video streams. You can configure the recording cycle and specify the recording start time and end time. Custom recording index files are generated. The recordings are in the M3U8 format and contain TS segments. The files are stored in the specified OSS bucket.

Note
  • Only OSS buckets in the China (Shanghai) region are supported.
  • After recording is complete, you can view the recorded content in the OSS bucket.
  • To store recorded videos in OSS, you must grant RTC the write permissions on OSS. For more information, see Grant write permissions on OSS to RTC.
  • In order to prevent truncation of recordings due to network jitter or temporary stream interruption, the system delays stream interruption for 180 seconds. If the stream is ingested again within 180 seconds after interruption, the system considers that there is only one recording by default. If the stream is interrupted for more than 180 seconds, the system considers that there are two recordings.

Configure OSS

  1. Create an OSS bucket.
    1. Log on to the OSS console.
    2. In the Bucket Management section, click Create Bucket.
    3. Configure the information about the bucket.
    4. On the Buckets page, click the name of the created bucket. On the Files page, click Create Folder.
      Note If you have a number of recordings, you can create folders to classify and store the recordings. This facilitates the recording management.
    5. In the Create Folder panel, specify the Folder Name parameter and click OK.
  2. Grant write permissions on OSS to RTC.
    1. Log on to the RAM console by using your Alibaba Cloud account.
    2. In the left-side navigation pane, choose Permissions > Policies. The Policies page appears.
    3. Click Create Policy to go to the page for creating a custom policy.
    4. Specify the policy name and select the script mode to configure the policy. Enter the following script content:
      {
          "Statement": [
              {
                  "Action": [
                      "ram:CreateServiceLinkedRole"
                  ],
                  "Resource": "acs:ram:*:Alibaba Cloud account ID:role/*",
                  "Effect": "Allow",
                  "Condition": {
                      "StringEquals": {
                          "ram:ServiceName": [
                              "rtc.aliyuncs.com"
                          ]
                      }
                  }
              }
          ],
          "Version": "1"
      }
      Note Replace "Alibaba Cloud account ID" with the ID of your Alibaba Cloud account.
    5. Click OK. The custom policy is created.
    6. Return to the user page again. In the User Logon Name /Display Name column, click the target RAM user to go to the management page.
    7. Click Permissions, and then click Add Permissions.
    8. Select Custom Policy, add the custom policy, and then click OK.

API reference

API operation Description
AddRecordTemplate Creates a recording configuration template.
DeleteRecordTemplate Deletes a recording configuration template.
UpdateRecordTemplate Updates a recording configuration template.
DescribeRecordTemplates Queries recording configuration templates.
DescribeRecordFiles Queries the information about recording files.
StartRecordTask Starts a video recording task.
StopRecordTask Stops a video recording task.
UpdateRecordTask Updates a video recording task.