All Products
Search
Document Center

ApsaraVideo Live:ModifyCasterLayout

Last Updated:Dec 12, 2024

Modifies the layout configurations pf a production studio. You need to pass only parameters that you want to modify.

Operation description

You can call the CreateCaster operation to create a production studio and then call this operation to modify a layout of the production studio. This operation supports the default and adaptive scaling modes.

QPS limit

You can call this operation up to 10 times per second per account. Requests that exceed this limit are dropped and you will experience service interruptions. We recommend that you take note of this limit when you call this operation.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
live:ModifyCasterLayoutupdate
*Caster
acs:live:*:{#accountId}:caster/{#CasterId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
VideoLayerarray<object>Yes

The video layers.

objectYes

The information about the video layer.

FillModestringNo

The scaling mode of the video layer. Valid values:

  • none (default): indicates that the video layer is not scaled. The video layer is displayed based on its original size.
  • fit: indicates that the video layer is adapted to the fill area. In this case, the video layer is scaled proportionally, with its original aspect ratio retained. The video layer is placed in the center, with its longer sides aligned with the fill area. If the aspect ratio of the video layer is different from that of the fill area, the content of the lower layer is displayed alongside the shorter sides. If there is no lower layer, black bars are displayed instead.
fit
FixedDelayDurationintegerNo

The fixed delay of the video layer. This parameter is used to synchronize the video with subtitles. Unit: milliseconds. Default value: 0. Valid values: 0 to 5000.

5000
HeightNormalizedfloatNo

The normalized value of the height of the video layer.

  • If the FillMode parameter of the video layer is set to none, the width of the video layer is proportionally scaled based on this parameter. The default value is 0, which indicates that the video layer is not scaled.
  • If the FillMode parameter of the video layer is set to fit, the value of this parameter is greater than 0.
1
PositionNormalizedarrayNo

The normalized value of the position of the video layer, in the format of [x,y]. Default value: [0,0].

Note The values of x and y are normalized.
floatNo

The normalized value of the position of the video layer, in the format of [x,y]. Default value: [0,0].

Note The values of x and y are normalized.
[0,3]
PositionReferstringNo

The reference coordinates of the video layer. Valid values:

  • topLeft (default): the upper-left corner
  • topRight: the upper-right corner
  • bottomLeft: the lower-left corner
  • bottomRight: the lower-right corner
  • center: the center
  • topCenter: the upper center
  • bottomCenter: the lower center
  • leftCenter: the left center
  • rightCenter: the right center
topLeft
WidthNormalizedfloatNo

The normalized value of the width of the video layer.

  • If the FillMode parameter of the video layer is set to none, the height of the video layer is proportionally scaled based on this parameter. The default value is 0, which indicates that the video layer is not scaled.
  • If the FillMode parameter of the video layer is set to fit, the value of this parameter is greater than 0.
1
AudioLayerarray<object>Yes

The audio layers.

objectYes

The information about the audio layer.

FixedDelayDurationintegerNo

The fixed delay of the audio layer. This parameter is used to synchronize the audio with subtitles. Unit: milliseconds. Default value: 0. Valid values: 0 to 5000.

5000
ValidChannelstringNo

The sound channels that are used for volume input in the audio layer. Valid values:

  • leftChannel: the left channel
  • rightChannel: the right channel
  • all (default): both the left and right channels
all
VolumeRatefloatNo

The normalized value of the height of the audio layer. The width of the audio layer is proportionally scaled based on this parameter.

The default value is 0, which indicates that the audio layer is not scaled.

1
BlendListarrayYes

The location IDs of the video layers, which are in the same order as the video layers.

For more information, see AddCasterVideoResource .

stringYes

The location ID.

For more information, see AddCasterVideoResource .

RV02
MixListarrayYes

The location IDs of the audio layers, which are in the same order as the audio layers.

For more information, see AddCasterVideoResource .

stringYes

The location ID.

For more information, see AddCasterVideoResource .

RV02
CasterIdstringYes

The ID of the production studio.

  • If the production studio was created by calling the CreateCaster operation, check the value of the response parameter CasterId to obtain the ID.
  • If the production studio was created by using the ApsaraVideo Live console, obtain the ID on the Production Studio Management page. To go to the page, log on to the ApsaraVideo Live console and click Production Studios in the left-side navigation pane.
Note You can find the ID of the production studio in the Instance ID/Name column.
LIVEPRODUCER_POST-cn-0pp1czt****
LayoutIdstringYes

The ID of the layout. If the layout was added by calling the AddCasterLayout operation, check the value of the response parameter LayoutId to obtain the ID.

21926b36-7dd2-4fde-ae25-51b5bc8e****
Note N in the preceding request parameters specifies the sequence number. VideoLayer.N.FillMode specifies the scaling mode of video layer N. For example, VideoLayer.1.FillMode specifies the scaling mode of the first video layer, and VideoLayer.2.FillMode specifies the scaling mode of the second video layer.

Response parameters

ParameterTypeDescriptionExample
object
LayoutIdstring

The ID of the layout. You can use this ID to query information about the layout.

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

The request ID.

16A96B9A-F203-4EC5-8E43-CB92E68F4CD8

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError message
400InvalidCasterId.Malformed%s
400InvalidUserId.Malformed%s
400InvalidLayoutId.Malformed%s
400InvalidParameter.Malformed%s
400InvalidVideoLayersAndBlendListSize.Mismatch%s
400InvalidAudioLayersAndMixListSize.Mismatch%s
400InvalidPositionNormalized.Malformed%s
400InvalidBlendList.ExceedNorm%s
400InvalidMixList.ExceedNorm%s
400InvalidVideoLayersConfig%s
400InvalidAudioLayersConfig%s
400InvalidHeightOrWidthNormalized%s
401IllegalOperation%s
404InvalidCaster.NotFound%s
404InvalidLayout.NotFound%s
500InternalError%s

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history