- Documentation
- Cloud Recording
- Common Features
- Single Stream Recording
Single-stream recording
We currently support the following cloud recording modes:
Single-stream recording: All the audio, video streams, and whiteboard recordings in a room are recorded in separate files.
Mixed-stream recording: The audio, video streams, and whiteboard recordings in a room are recorded in a single file.
This document describes how to implement single-stream recording by using the cloud recording APIs.
Implementation
To use the single-stream recording, call the StartRecord
method, and set the RecordMode
parameter to 1.
You can select the format of the recorded file as needed by setting the OutputFileFormat
parameter to mp4
, flv
, or hls
.
For instance, set the OutputFileFormat
parameter to mp4
, and the generated recordings are varies based on the content to be recorded:
Content to be recorded | Parameter | Recorded file |
---|---|---|
Audio only | Set StreamType to "1" |
The audio streams of each specified stream ID are recorded in a single mp4 file. |
Video only | Set StreamType to "2" |
The video streams of each specified stream ID are recorded in a single mp4 file. |
Audio and video (mixed) | Set StreamType to "3" |
The audio and video streams of each specified stream ID are recorded in a single mp4 file. |
Record audio and video (separate) | Set StreamType to "4" |
The audio and video streams of each specified stream ID are recorded in an mp4 and an aac file. The mp4 file contains the video data, and the aac file contains the audio data. |
StreamType
is only applicable to audio and video streams. All whiteboard files will be recorded in mp4 files, and only contain the whiteboard related video data.
Sample request
Content-type
:application/json;charset=utf-8
The request example of StartRecord
is as follows:
{
"RoomId": "xxxx",
"RecordInputParams": {
"RecordMode": 1,
"StreamType": 3,
"MaxIdleTime": 60
},
"RecordOutputParams": {
"OutputFileFormat": "mp4",
"OutputFolder": "record/"
},
"StorageParams": {
"Vendor": 2,
"Region": "oss-xxxx",
"Bucket": "xxxx",
"AccessKeyId": "xxxx",
"AccessKeySecret": "xxxx"
}
}