All Products
Search
Document Center

ApsaraVideo Live:AddCasterLayout

Last Updated:Aug 14, 2025

Adds a layout to a production studio.

Operation description

Before you call this operation, you must create a production studio and add video sources. For more information about how to create a production studio, see CreateCaster.

QPS limits

The queries per second (QPS) limit for this operation is 10 calls per second per user. API calls that exceed this limit are throttled, which may affect your business. Do not exceed this limit.

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:AddCasterLayout

create

*Caster

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

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

No

The region ID.

cn-shanghai

VideoLayer

array<object>

Yes

The video layouts.

object

No

The video layout.

FillMode

string

No

The fill mode of the element. Valid values:

  • none (default): No scaling. The video is displayed in its original size.

  • fit: The video is scaled to fit the fill area while maintaining its aspect ratio. The video is centered in the fill area. If the aspect ratio of the fill area is different from that of the video, the area along the shorter edge is not filled. This area displays the video of the underlying layer. If no underlying layer is configured, this area is black.

fit

FixedDelayDuration

integer

No

The fixed latency for the video layer. Use this parameter to synchronize the video with captions. Unit: milliseconds. Default value: 0. Valid values: 0 to 5000.

5000

HeightNormalized

number

No

The normalized height of the layer.

  • If you set FillMode to none, the width of the layer is scaled in proportion to the height. The default value is 0. A value of 0 indicates that the video is displayed in its original size.

  • If you set FillMode to fit, this parameter is required and its value must be greater than 0. The value specifies the normalized height of the fill area.

1

PositionNormalized

array

No

The position of the video layer. The value is a normalized coordinate [x,y]. Default value: [0,0].

Note: The x and y coordinates must be normalized.

0.3

number

No

The value.

0

PositionRefer

string

No

The reference point for the position of the layer. Valid values:

  • topLeft (default): Top-left.

  • topRight: Top-right.

  • bottomLeft: Bottom-left.

  • bottomRight: Bottom-right.

  • center: Center.

  • topCenter: Top-center.

  • bottomCenter: Bottom-center.

  • leftCenter: Left-center.

  • rightCenter: Right-center.

topLeft

WidthNormalized

number

No

The normalized width of the layer.

  • If you set FillMode to none, the height of the layer is scaled in proportion to the width. The default value is 0. A value of 0 indicates that the video is displayed in its original size.

  • If you set FillMode to fit, this parameter is required and its value must be greater than 0. The value specifies the normalized width of the fill area.

1

AudioLayer

array<object>

Yes

The audio layouts.

object

No

The audio layout.

FixedDelayDuration

integer

No

The fixed latency for the audio layer. Use this parameter to synchronize the audio with captions. Unit: milliseconds. Default value: 0. Valid values: 0 to 5000.

5000

ValidChannel

string

No

The sound channels that are used for audio input. Valid values:

  • leftChannel: Left channel.

  • rightChannel: Right channel.

  • all (default): Both channels.

all

VolumeRate

number

No

The volume multiplication factor for the audio stream. Valid values: 0 to 10.0.

  • 1.0 (default): The original volume is used.

  • A value less than 1 decreases the volume.

  • A value greater than 1 increases the volume.

1.0

BlendList

array

Yes

The location IDs of the video sources. The order of the location IDs corresponds to the order of the video layers specified in the VideoLayer parameter. For more information about location IDs, see AddCasterVideoResource.

For LocationId, see Add a video source. This ID corresponds to the order of the VideoLayers elements.

RV01

string

No

The location ID.

RV01

MixList

array

Yes

The location IDs of the audio sources. The order of the location IDs corresponds to the order of the audio layers specified in the AudioLayer parameter. For more information about location IDs, see AddCasterVideoResource.

For `LocationId`, see Add a video source. It corresponds to the order of the `AudioLayers` elements.

RV01

string

No

The location ID.

RV01

CasterId

string

Yes

The ID of the production studio.

  • If you create a production studio by calling the CreateCaster operation, the CasterId is returned in the response.

  • If you create a production studio in the LIVE console, go to Production Studio > Cloud Production Studio to view the name of the production studio.

Note

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

LIVEPRODUCER_POST-cn-0pp1czt****

Note

In the request parameters, N represents the sequence number of an element. For example, VideoLayer.N.FillMode specifies the fill mode for the Nth video layer. VideoLayer.1.FillMode specifies the fill mode for the first video layer, and VideoLayer.2.FillMode specifies the fill mode for the second video layer.

Response parameters

Parameter

Type

Description

Example

object

LayoutId

string

The ID of the layout. You can use this ID as a request parameter when you call operations to manage layouts, such as deleting, modifying, or querying layouts for a production studio or a virtual studio.

21926b36-7dd2-4fde-ae25-51b5bc8e****

RequestId

string

The request ID.

16A96B9A-F203-4EC5-8E43-CB92E68F****

Examples

Success response

JSON format

{
  "LayoutId": "21926b36-7dd2-4fde-ae25-51b5bc8e****",
  "RequestId": "16A96B9A-F203-4EC5-8E43-CB92E68F****"
}

Error codes

HTTP status code

Error code

Error message

Description

400 MissingParameter %s
400 InvalidParameter.Malformed %s
400 InvalidCasterId.Malformed %s
400 InvalidVideoLayersAndBlendListSize.Mismatch %s
400 InvalidAudioLayersAndMixListSize.Mismatch %s
400 InvalidUserId.Malformed %s
400 InvalidBlendList.ExceedNorm %s
400 InvalidMixList.ExceedNorm %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.