When there are multiple users sending audio, video, and whiteboard streams in a room, our Cloud Recording service mixes the streams of all the users into one stream. This document describes how to set the video layout in the mixed-stream recording mode.
We currently support the following video layouts:
For an audio-only stream, it still occupies a small region.
To set video layout, set the MixMode
parameter when calling the StartRecord
method.
During the mixed-stream recording, you can change the layout by calling the UpdateLayout
method.
The following figures describe several layouts in detail. The numbers in the diagram represent the order of users joining the room.
The following diagrams show the actual layouts with different number of users in the room:
In grid layout, video regions are layout by column preferentially.
To specify the large region in the horizontal layout, set the MixMaxResolutionStreamId
parameter when calling the calling the StartRecord
method and UpdateLayout
methods.
MixMaxResolutionStreamId
), the large region shows the video of the user who joins the room first.MixMaxResolutionStreamId
), the large region shows the background color.MixMaxResolutionStreamId
parameter is invalid.The following diagrams show the actual layouts with different number of users in the room:
To specify the large region in the vertical layout, set the MixMaxResolutionStreamId
parameter when calling the calling the StartRecord
method and UpdateLayout
methods.
For detailed notes, refer to the Horizontal layout.
The following diagrams show the actual layouts with different number of users in the room:
To specify the large region in the floating layout, set the MixMaxResolutionStreamId
parameter when calling the calling the StartRecord
method and UpdateLayout
methods.
For detailed notes, refer to the Horizontal layout.
The following diagrams show the actual layouts with different number of users in the room:
To set the size and position of each user's region on the canvas, set the MixInputList
parameter when calling the StartRecord
method and UpdateLayout
methods.
The MixInputList
is an array in JSON format that consists of the configurations of the user regions. You can configure up to 25 regions.
The parameters are defined as follows:
Parameter | Type | Required | Description |
---|---|---|---|
StreamId |
String | No | A string that contains the stream ID of the user you want to display in the region. If this parameter is not specified, the configurations apply in the order of the users joining the room. |
ViewType |
Int | No | The type of content displayed on canvas.
|
Top |
Int | Yes | The relative vertical position of the top-left corner of the region. The value range is [0, 1920]. |
Left |
Int | Yes | The relative vertical position of the top-left corner of the region. The value range is [0, 1920]. |
Bottom |
Int | Yes | The relative height of the region. The value range is [0, 1920]. |
Right |
Int | Yes | The relative width of the region. The value range is [0, 1920]. |
Layer |
Int | Yes | The layer property, determines the layer level. The larger the value, the higher the layer level. |
FillMode |
Int | No | The video display mode when the actual video aspect ratio is inconsistent with the canvas.
|
StreamId
), the region shows the background color.StreamId
: The video region will be replaced by the next user when there is a user leaving the room. StreamId
: The video region displays the background color.ViewType
is "2".As shown in the following coordinate system figure:
You can update the video layout during a recording.
Content-type
: application/json; charset=utf-8
The request example of UpdateLayout
is as follows:
{
"TaskId": "xxxx",
"MixMode": 1,
"MixInputList": [
{
"StreamId": "xxxx",
"ViewType": 1,
"Top": 0,
"Left": 0,
"Bottom": 720,
"Right": 540,
"Layer": 1
},
{
"StreamId": "",
"ViewType": 1,
"Top": 0,
"Left": 540,
"Bottom": 360,
"Right": 1080,
"Layer": 1
},
{
"StreamId": "",
"ViewType": 1,
"Top": 360,
"Left": 540,
"Bottom": 720,
"Right": 1080,
"Layer": 1
}
]
}