AddStudioLayout
Adds layout settings for a virtual studio.
Operation description
Adds layout settings for a virtual studio. This operation currently supports the following studio layout types: common layout and studio layout.
QPS limits
The QPS limit for a single user is 10 calls per second. If the limit is exceeded, API calls are throttled, which may affect your services. Call this operation at a reasonable frequency.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
live:AddStudioLayout |
create |
*Caster
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
No |
The region ID. |
cn-shanghai |
| CasterId |
string |
Yes |
The ID of the production studio. Important The production studio must be created in advance and must be of the virtual studio type. You can create a production studio in the console or by calling the CreateCaster operation. Make sure to select the virtual studio type.
Note
The name of the production studio in the production studio list on the Cloud Production Studios page is the production studio ID. |
a2b8e671-2fe5-4642-a2ec-bf93880e**** |
| LayoutName |
string |
Yes |
The name of the studio layout. |
Test layout |
| LayoutType |
string |
Yes |
The type of the studio layout. Valid values:
|
studio |
| CommonConfig |
string |
No |
The common layout configuration. The value must be a JSON string. For more information, see CommonConfig. Important This parameter is required only when the LayoutType request parameter is set to common.
|
{"ChannelId":"RV01" } |
| BgImageConfig |
string |
No |
The background resource configuration. The value must be a JSON string. For more information, see BgImageConfig. Important This parameter is required only when the LayoutType request parameter is set to studio.
|
{ "Id":"k12kj31****", "MaterialId":"f080575eb5f4427684fc0715159a****" } |
| ScreenInputConfigList |
string |
No |
The chroma keying input settings. The value must be a JSON string. For more information, see ScreenInputConfig. Important This parameter is required only when the LayoutType request parameter is set to studio.
|
[ { "Index":"1", "ChannelId":"RV01", "Color":"green", "PositionX":"0.1", "PositionY":"0.2", "HeightNormalized":"0.4" } ] |
| MediaInputConfigList |
string |
No |
The multimedia input resource settings. The value must be a JSON string. For more information, see MediaInputConfig. Important This parameter is valid and optional only when the LayoutType request parameter is set to studio.
|
[ { "Id":"k12kj31****", "Index":"1", "ChannelId":"RV01", "FillMode":"none", "PositionRefer":"topLeft", "WidthNormalized":"0.4", "HeightNormalized":"0.4", "PositionNormalized":"[0.1, 0.2]" }, { "Id":"k12kj31****", "Index":"2", "ImageMaterialId":"lkajsdfsa8fd89asd8****", "FillMode":"none", "PositionRefer":"topLeft", "WidthNormalized":"0.6", "HeightNormalized":"0.4", "PositionNormalized":"[0.1, 0.2]" } ] |
| LayerOrderConfigList |
string |
No |
The layer order settings. The value must be a JSON string. For more information, see layerOrderConfig. You can sort background materials and multimedia materials. Chroma keying layers are not supported. A layer that appears earlier in the list is placed at a lower level. |
[ { "Type":"media", "Id":"k12kj31****" }, { "Type":"media", "Id":"k12kj31****" } ] |
CommonConfig
| Parameter | Type | Example | Description |
| ChannelId | String | RV01 | The ID of the channel position to which the video resource is bound. |
BgImageConfig
You can specify only one of the ImageUrl and MaterialId parameters.
| Parameter | Type | Example | Description |
| Id | String | k12kj31**** | The unique ID of the background material. |
| ImageUrl | String | http://aliyundoc.com | The URL of the material. |
| MaterialId | String | f080575eb5f4427684fc0715159a**** | The ID of the video-on-demand (VOD) material. |
ScreenInputConfig
| Parameter | Type | Example | Description |
| Index | Integer | 1 | The number of the chroma keying source. This parameter is used for frontend display and has no logical effect. The value must be a positive integer greater than 0. |
| ChannelId | String | RV01 | The ID of the channel position to which the video resource is bound. |
| Color | String | green | The chroma key color. Valid values: blue: blue screen background. green: green screen background. auto: automatic recognition. complex: real-scene keying. |
| PositionX | Float | 0.1 | The X-coordinate of the position. Valid values: [0,1]. The upper-left corner is used as the reference point for the material position. |
| PositionY | Float | 0.2 | The Y-coordinate of the position. Valid values: [0,1]. The upper-left corner is used as the reference point for the material position. |
| HeightNormalized | Float | 0.4 | The normalized height value, which is the ratio of the height of the keyed portrait to the height of the background. Valid values: [0,1]. |
MediaInputConfig
If the multimedia material is a video source, specify ChannelId.
If the multimedia material is an image, specify ImageMaterialId.
ChannelId and ImageMaterialId are mutually exclusive. Specify only one of them.
| Parameter | Type | Example | Description |
| Id | String | k12kj31**** | The unique ID of the multimedia material. |
| Index | Integer | 1 | The number of the multimedia material. This parameter is used for frontend display and has no logical effect. The value must be a positive integer greater than 0. |
| ChannelId | String | RV01 | The ID of the channel position to which the video resource is bound. |
| ImageMaterialId | String | lkajsdfsa8fd89asd8**** | The ID of the VOD image material. |
| FillMode | String | none | The fill mode. Set the value to none. |
| PositionRefer | String | topLeft | The reference coordinate value for the material position. Set the value to topLeft, which indicates that the upper-left corner is used as the reference point for the position settings. |
| WidthNormalized | Float | 0.4 | The normalized width value of the material, which is the ratio of the width of the material to the width of the background. Valid values: [0,1]. |
| HeightNormalized | Float | 0.4 | The normalized height value of the material, which is the ratio of the height of the material to the height of the background. Valid values: [0,1]. |
| PositionNormalized | Float | [0.1, 0.2] | The normalized position value [x,y] of the fill area for the material. Valid values of x and y: [0,1]. For example, [0.1,0.2] indicates a horizontal offset of 10% and a vertical offset of 20% from the upper-left corner. |
LayerOrderConfig
| Parameter | Type | Example | Description |
| Type | String | media | The type of the resource configuration. Valid values: background: background material. media: multimedia material. |
| Id | String | k12kj31**** | The unique ID of the resource. |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| LayoutId |
string |
The layout ID. You can use this ID as a request parameter when you delete, modify, or query the virtual studio layout. |
445409ec-7eaa-461d-8f29-4bec2eb9**** |
| RequestId |
string |
The request ID. |
5c6a2a0d-f228-4a64-af62-20e91b96**** |
Examples
Success response
JSON format
{
"LayoutId": "445409ec-7eaa-461d-8f29-4bec2eb9****",
"RequestId": "5c6a2a0d-f228-4a64-af62-20e91b96****"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | MissingParameter | %s. | Missing parameter |
| 400 | InvalidParameter.Malformed | There are invalid parameters: %s. | There are invalid parameters: %s. |
| 400 | InvalidCasterId.Malformed | %s, please check and try again later. | The parameter CasterId is invalid, please check and try again. |
| 400 | InvalidUserId.Malformed | %s, please check userId. | The userId passed in is invalid, please check. |
| 400 | InvalidPositionNormalized.Malformed | %s, please check and try again later. | The parameter PositionNormalized is invalid, please check and try again. |
| 400 | InvalidHeightOrWidthNormalized | %s, please check and try again later. | HeightNormalized or WidthNormalized parameters are invalid, please check and try again. |
| 401 | IllegalOperation | %s, please check and try again later. | Operation not allowed, please check and try again. |
| 500 | InternalError | %s, please try again later. | Internal error, please try again later. |
| 404 | InvalidCaster.NotFound | %s, please check and try again later. | The guide station does not exist, please check and try again. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.