All Products
Search
Document Center

ApsaraVideo Live:ModifyCasterLayout

Last Updated:Nov 14, 2024

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

Operation description

Instructions

First, create a director console via the CreateCaster interface, then invoke this interface to modify the layout configuration by passing the changes; elements not to be modified need not be passed. Currently, this interface supports two fill methods for elements: default and adaptive.

QPS Limitation

The per-user QPS limit for this interface is 10 times/second. Exceeding this limit will result in API calls being throttled, which may impact your services. Please use judiciously. For more information, refer to QPS Limitations.

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

Video information.

objectYes
FillModestringNo

The scaling mode of the layer. Valid values:

  • none (default): The image is not scaled to fill in the specified layout section.
  • fit: The video layer is set based on the section size. The image is centered in the section with the long side of the image equaling that of the section. If the aspect ratio of the image is inconsistent with that of the section, the short side of the image may be shorter than that of the section. The area outside the image displays the next video layer or the background if no next video layer exists. By default, the background color is black.
fit
FixedDelayDurationintegerNo

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

5000
HeightNormalizedfloatNo

The normalized value of the height of the element of video layer N.

  • If you set the scaling mode to none, the width is proportionally scaled based on the height. The default value is 0, which specifies that the video is displayed in its original size.****
  • If you set the scaling mode to fit, this parameter must be specified and requires a value that is greater than 0. The value is the normalized value of the height of the section.
1
PositionNormalizedarrayNo

Normalized position value of the layer element in the format [x,y]. Default is [0,0].

Note Note: x and y need to be normalized.
floatNo

The normalized value of the [x,y] coordinates of video layer N in the production studio. The default value is [0,0].

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

The reference coordinates of video layer N in the production studio. 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 position
  • topCenter: the upper center position
  • bottomCenter: the lower center position
  • leftCenter: the left center position
  • rightCenter: the right center position
topLeft
WidthNormalizedfloatNo

The normalized value of the width of the element of video layer N.

  • If you set the scaling mode to none, the height is proportionally scaled based on the width. The default value is 0, which specifies that the video is displayed in its original size.
  • If you set the scaling mode to fit, this parameter must be specified and requires a value that is greater than 0. The value is the normalized value of the width.
1
AudioLayerarray<object>Yes

Audio information.

objectYes
FixedDelayDurationintegerNo

The fixed delay of audio layer N. You can use this parameter 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 N. Valid values:

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

The normalization ratio of the height for the layer element, where the element's width will be scaled proportionally based on this height. The default value is 0, indicating that the element is displayed in its original size.

1
BlendListarrayYes

The element represents the location ID of the video resource, i.e., LocationId. LocationId refers to Adding Video Source, and it corresponds to the order of VideoLayers elements.

stringYes

The location ID of video layer N in the production studio.

For more information, see AddCasterVideoResource .

RV02
MixListarrayYes

The element represents the location ID of the audio resource, i.e., LocationId. LocationId is referred to in Adding Video Source, and corresponds in order with the AudioLayers elements.

stringYes

The location ID of audio layer N in the production studio.

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 created 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