AddStudioLayout

Updated at:

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

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

live:AddStudioLayout

create

*Caster

acs:live:*:{#accountId}:caster/{#CasterId}

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.
  • If you create the production studio by calling the CreateCaster operation, check the value of the CasterId parameter returned in the response.

  • If you create the production studio in the ApsaraVideo Live console, go to the ApsaraVideo Live > Production Studios > Cloud Production Studios page to view the ID.

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:

  • common: the common layout. If you set LayoutType to common, the CommonConfig request parameter is required.

  • studio: the studio layout. If you set LayoutType to studio, the BgImageConfig and ScreenInputConfigList request parameters are required, and the MediaInputConfigList request parameter is optional.

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

ParameterTypeExampleDescription
ChannelIdStringRV01The ID of the channel position to which the video resource is bound.

BgImageConfig

Note

You can specify only one of the ImageUrl and MaterialId parameters.

ParameterTypeExampleDescription
IdStringk12kj31****The unique ID of the background material.
ImageUrlStringhttp://aliyundoc.comThe URL of the material.
MaterialIdStringf080575eb5f4427684fc0715159a****The ID of the video-on-demand (VOD) material.

ScreenInputConfig

ParameterTypeExampleDescription
IndexInteger1The 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.
ChannelIdStringRV01The ID of the channel position to which the video resource is bound.
ColorStringgreenThe chroma key color. Valid values:
blue: blue screen background.
green: green screen background.
auto: automatic recognition.
complex: real-scene keying.










PositionXFloat0.1The X-coordinate of the position. Valid values: [0,1].
The upper-left corner is used as the reference point for the material position.

PositionYFloat0.2The Y-coordinate of the position. Valid values: [0,1].
The upper-left corner is used as the reference point for the material position.

HeightNormalizedFloat0.4The 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.

ParameterTypeExampleDescription
IdStringk12kj31****The unique ID of the multimedia material.
IndexInteger1The 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.
ChannelIdStringRV01The ID of the channel position to which the video resource is bound.
ImageMaterialIdStringlkajsdfsa8fd89asd8****The ID of the VOD image material.
FillModeStringnoneThe fill mode. Set the value to none.
PositionReferStringtopLeftThe 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.
WidthNormalizedFloat0.4The 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].
HeightNormalizedFloat0.4The 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].
PositionNormalizedFloat[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

ParameterTypeExampleDescription
TypeStringmediaThe type of the resource configuration. Valid values:
background: background material.
media: multimedia material.




IdStringk12kj31****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.