All Products
Search
Document Center

ApsaraVideo Live:ModifyCasterLayout

Last Updated:Jun 05, 2024

Modifies a layout.

Usage notes

You can call the CreateCaster operation to create a production studio and then call the ModifyCasterLayout operation to modify a layout of the production studio.

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. For more information, see QPS limits.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter

Type

Required

Example

Description

Action String Yes ModifyCasterLayout

The operation that you want to perform. Set the value to ModifyCasterLayout.

VideoLayer.N.FillMode String No fit

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.
VideoLayer.N.FixedDelayDuration Integer No 5000

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.

VideoLayer.N.HeightNormalized Float No 1

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.
VideoLayer.N.PositionNormalized.N Float No [0,3]

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.
VideoLayer.N.PositionRefer String No topLeft

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
VideoLayer.N.WidthNormalized Float No 1

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.
AudioLayer.N.FixedDelayDuration Integer No 5000

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.

AudioLayer.N.ValidChannel String No all

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
AudioLayer.N.VolumeRate Float No 1

BlendList.N String No RV02

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

For more information, see AddCasterVideoResource.

MixList.N String No RV02

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

For more information, see AddCasterVideoResource.

CasterId String Yes LIVEPRODUCER_POST-cn-0pp1czt****

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.
LayoutId String Yes 21926b36-7dd2-4fde-ae25-51b5bc8e****

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.

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

Parameter

Type

Example

Description

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

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

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

The request ID.

Examples

Sample requests

http(s)://live.aliyuncs.com/?Action=ModifyCasterLayout
&BlendList.1=RV02
&CasterId=LIVEPRODUCER_POST-cn-0pp1czt****
&LayoutId=21926b36-7dd2-4fde-ae25-51b5bc8e****
&MixList.1=RV02
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<?xml version="1.0" encoding="UTF-8" ?>
<ModifyCasterLayoutResponse>
	<RequestId>16A96B9A-F203-4EC5-8E43-CB92E68F4CD8</RequestId>
	<LayoutId>21926b36-7dd2-4fde-ae25-51b5bc8e52d8</LayoutId>
</ModifyCasterLayoutResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

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

Error codes

For a list of error codes, see Service error codes.