Cloud Recording Beta

Single Stream Recording

Update Time:2021-04-25 20:24

1 Function Description

Cloud recording supports the following two recording modes:

  • Single stream recording: Record each audio and video stream and whiteboard in the room separately. Each audio and video stream will generate a corresponding audio and video file, and all whiteboards will generate a video file.
  • Mixed stream recording: All audio and video streams and whiteboards in the room are mixed and recorded into one audio and video file.

This article describes how to perform single-stream recording by using the cloud recording RESTful API.

2 Implementation Method

When calling the start method, set the record_mode parameter to "1" to enable single-stream recording mode.

By setting the output_file_format parameter to "mp4", "flv" or "hls", a video file of the corresponding format can be generated. Assuming that output_file_format is set to "mp4", according to the different recording content, the generated file is as follows:

Recording content Parameter setting Recording generated file
Record audio only stream_type is set to "1" Each streamID generates an mp4 file, and only the audio data of the streamID is stored in the mp4 file.
Record video only stream_type is set to "2" Each streamID generates an mp4 file, and only the video data of that streamID is stored in the mp4 file.
Record audio and video (combined) stream_type is set to "3" Each streamID generates an mp4 file, and the mp4 file stores the audio and video data of the streamID.
Record audio and video (separate) stream_type is set to "4" Each streamID generates an mp4 file and an aac file. Only the video data of the streamID is stored in the mp4 file, and only the audio data of the streamID is stored in the aac file.

stream_type is only applicable to audio and video streams. All whiteboards will record and generate another mp4 file. Only the video data of the whiteboard is stored in this mp4 file.

3 Request Example

Content-type is “application/json; charset=utf-8”, and the content of the start request package is as follows:

{
    "app_id": 0000,
    "access_token": "xxxx",
    "room_id": "xxxx",
    "record_input_params": {
        "record_mode": 1,
        "stream_type": 3,
        "max_idle_time": 60
    },
    "record_output_params": {
        "output_file_format": "mp4",
        "output_folder": "record/"
    },
    "storage_params": {
        "storage_provider": 2,
        "region": "oss-xxxx",
        "bucket_name": "xxxx",
        "access_key_id": "xxxx",
        "access_key_secret": "xxxx"
    }
}