All Products
Search
Document Center

ApsaraVideo Live:AddStudioLayout

Last Updated:Aug 14, 2025

Adds layout settings for a virtual production studio.

Operation description

You can call this operation to add layout settings for a virtual production studio. This operation supports both common and studio layouts.

QPS limit

The queries per second (QPS) limit for this operation is 10 per user. If you exceed this limit, your API calls are throttled. This may affect your business. We recommend that you call this operation at a reasonable rate.

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

Create a virtual production studio in advance. You can create a production studio in the console or by calling the CreateCaster API operation. The production studio must be a virtual production studio.

  • If you call the CreateCaster API operation to create a production studio, use the returned CasterId value.

  • If you create a production studio in the ApsaraVideo Live console, go to the ApsaraVideo Live console > Production Studio > Cloud Production Studio page. The name of the production studio in the list is its ID.

Note

The name of the production studio in the list on the Cloud Production Studio page is the production studio ID.

a2b8e671-2fe5-4642-a2ec-bf93880e****

LayoutName

string

Yes

The name of the studio layout.

测试布局

LayoutType

string

Yes

The type of the studio layout. Valid values:

  • common: A common layout. If you set LayoutType to common, you must also specify CommonConfig.

  • studio: A studio layout. If you set LayoutType to studio, you must also specify BgImageConfig and ScreenInputConfigList. The MediaInputConfigList parameter is optional.

studio

CommonConfig

string

No

The configuration of the common layout. The value is a JSON string. For more information, see CommonConfig.

Important

This parameter is required only when you set LayoutType to common.

{"ChannelId":"RV01" }

BgImageConfig

string

No

The configuration of the background resource. The value is a JSON string. For more information, see BgImageConfig.

Important

This parameter is required only when you set LayoutType to studio.

{ "Id":"k12kj31****", "MaterialId":"f080575eb5f4427684fc0715159a****" }

ScreenInputConfigList

string

No

The settings for the chroma keying input. The value is a JSON string. For more information, see ScreenInputConfig.

Important

This parameter is required only when you set LayoutType to studio.

[ { "Index":"1", "ChannelId":"RV01", "Color":"green", "PositionX":"0.1", "PositionY":"0.2", "HeightNormalized":"0.4" } ]

MediaInputConfigList

string

No

The settings for the multimedia input resource. The value is a JSON string. For more information, see MediaInputConfig.

Important

This parameter is valid and optional only when you set LayoutType 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 is a JSON string. For more information, see LayerOrderConfig. You can sort background materials and multimedia materials. Chroma keying layers are not supported. The earlier a material appears in the list, the lower its layer.

[ { "Type":"media", "Id":"k12kj31****" }, { "Type":"media", "Id":"k12kj31****" } ]

CommonConfig

Name

Type

Example

Description

ChannelId

String

RV01

The ID of the channel to which the video resource is attached.

BgImageConfig

Note

Specify only one of ImageUrl or MaterialId.

Name

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

Name

Type

Example

Description

Index

Integer

1

The number of the chroma keying source. This parameter is for display on the frontend and has no logical function. It must be a positive integer greater than 0.

ChannelId

String

RV01

The ID of the channel to which the video resource is attached.

Color

String

green

The color for chroma keying. Valid values:
blue: Blue screen background.
green: Green screen background.
auto: Automatic detection.
complex: Real-scene chroma keying.










PositionX

Float

0.1

The x-coordinate. The value must be in the range [0, 1].
The top-left corner is the reference point for the material's position.

PositionY

Float

0.2

The y-coordinate. The value must be in the range [0, 1].
The top-left corner is the reference point for the material's position.

HeightNormalized

Float

0.4

The normalized height. This is the ratio of the height of the keyed-out portrait to the height of the background. The value must be in the range [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.

Name

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 for display on the frontend and has no logical function. It must be a positive integer greater than 0.

ChannelId

String

RV01

The ID of the channel to which the video resource is attached.

ImageMaterialId

String

lkajsdfsa8fd89asd8****

The ID of the VOD image material.

FillMode

String

none

The fill type. Set this to none.

PositionRefer

String

topLeft

The reference point for the material's position. Set this to topLeft. This indicates that the top-left corner is the reference point.

WidthNormalized

Float

0.4

The normalized width of the material. This is the ratio of the width of the material to the width of the background. The value must be in the range [0, 1].

HeightNormalized

Float

0.4

The normalized height of the material. This is the ratio of the height of the material to the height of the background. The value must be in the range [0, 1].

PositionNormalized

Float

[0.1, 0.2]

The normalized position of the material's fill area [x, y]. The values of x and y must be in the range [0, 1].
For example, [0.1, 0.2] indicates a horizontal offset of 10% and a vertical offset of 20% from the top-left corner.

LayerOrderConfig

Name

Type

Example

Description

Type

String

media

The type of the resource configuration.
background: A background material.
media: A multimedia material.




Id

String

k12kj31****

The unique ID of the resource.

Response parameters

Parameter

Type

Description

Example

object

LayoutId

string

The layout ID. Use this ID to delete, modify, or query a virtual production 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
400 InvalidParameter.Malformed %s
400 InvalidCasterId.Malformed %s
400 InvalidUserId.Malformed %s
400 InvalidPositionNormalized.Malformed %s
400 InvalidHeightOrWidthNormalized %s
401 IllegalOperation %s
500 InternalError %s
404 InvalidCaster.NotFound %s

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.