Adds a layout for a production studio.

Usage note

The production studio must have been created. For how, see CreateCaster.

QPS limit

A single user can perform a maximum of 10 queries per second (QPS). Throttling is triggered when the number of calls per second exceeds the QPS limit. The throttling may affect your business. Thus, we recommend that you observe the QPS limit on this operation. For more information about what a single user means and the QPS details, see QPS limit on an API operation in ApsaraVideo Live.

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 AddCasterLayout

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

BlendList.N RepeatList Yes RV01

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

For more information about the location ID, see AddCasterVideoResource. Make sure that the video layers specified by this parameter are in the same order as those specified by the VideoLayers parameter.

CasterId String Yes 9ff2d96b-37ef-40a3-8cb0-4c7b1e2e****

The ID of the production studio.

If you create a production studio through the CreateCaster interface, check the value of the CasterId parameter in the response.

If you create a production studio through the ApsaraVideo Live Console, log in to the console, then check the ID of the production studio through the following path:

Production Studios > Production Studio Management

Note The CasterId is reflected in the Name column on the Production Studio Management page.
MixList.N RepeatList Yes RV01

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

For more information about the location ID, see AddCasterVideoResource. Make sure that the audio layers specified by this parameter are in the same order as those specified by the AudioLayers parameter.

RegionId String No cn-shanghai

The ID of the region.

VideoLayer.N.FillMode String No fit

The scaling mode of video layer N. Valid values:

  • none: The image is not scaled to fill in the specified layout section. Set video layer N based on the image size of the video resource. This is the default value.
  • fit: The image is scaled with the original aspect ratio to fill in the specified layout section. Set video layer N based on the section size. The image is centered in the layout 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.HeightNormalized Float No 1

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

  • If the FillMode parameter of video layer N is set to none, the width of the video image is scaled based on this parameter. The default value is 0, which indicates that the video image is displayed in the original size.
  • If the FillMode parameter of video layer N is set to fit, you must set this parameter to a value greater than 0. In this case, the video image is scaled with the original aspect ratio to fill in the specified layout section based on this parameter.
VideoLayer.N.WidthNormalized Float No 1

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

  • If the FillMode parameter of video layer N is set to none, the height of the video image is scaled based on this parameter. The default value is 0, which indicates that the video image is displayed in the original size.
  • If the FillMode parameter of video layer N is set to fit, you must set this parameter to a value greater than 0. In this case, the video image is scaled with the original aspect ratio to fill in the specified layout section based on this parameter.
VideoLayer.N.PositionRefer String No topLeft

The reference coordinates of video layer N in the production studio. Valid values:

  • topLeft: the upper-left corner. This is the default value.
  • 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.PositionNormalized.N RepeatList No [0,3]

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

The default coordinates are [0,0]. The coordinates indicate the location of video layer N in the production studio. Set this parameter to the normalized value of the coordinates.

VideoLayer.N.FixedDelayDuration Integer No 5000

The fixed delay of video layer N. You can use this parameter to synchronize the video with subtitles. Unit: milliseconds. Valid values: 0 to 5000. Default value: 0.

AudioLayer.N.VolumeRate Float No 1

The multiples of the original volume at which audio layer N plays audio streams. Valid values: 0 to 10.0.

  • The default value 1.0 indicates that audio layer N plays audio streams at the original volume.
  • A value smaller than 1.0 indicates that audio layer N plays audio streams at a lower volume than the original one.
  • A value greater than 1.0 indicates that audio layer N plays audio streams at a higher volume than the original one.
AudioLayer.N.ValidChannel String No all

The valid voice channels of audio layer N. Valid values:

  • leftChannel: the left channel.
  • rightChannel: the right channel.
  • all: both the left and right channels. This is the default value.
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. Valid values: 0 to 5000. Default value: 0.

Note The variable N in request parameter names indicates the sequence number of the video or audio layer. For example, the VideoLayer.N.FillMode parameter specifies the scaling mode of video layer N. The VideoLayer.1.FillMode parameter specifies the scaling mode of the first video layer. The VideoLayer.2.FillMode parameter specifies the scaling mode of the second video layer.

Response parameters

Parameter Type Example Description
RequestId String 16A96B9A-F203-4EC5-8E43-CB92E68F4CD8

The ID of the request.

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

The ID of the layout.

Record the ID as it can be used to manage the layout being created.

Examples

Sample requests

http(s)://live.aliyuncs.com/?Action=AddCasterLayout
&BlendList.1=RV01
&CasterId=9ff2d96b-37ef-40a3-8cb0-4c7b1e2e****
&MixList.1=RV01
&<Common request parameters>

Sample success responses

XML format

<AddCasterLayoutResponse>
      <RequestId>16A96B9A-F203-4EC5-8E43-CB92E68F4CD8</RequestId>
      <LayoutId>21926b36-7dd2-4fde-ae25-51b5bc8e****</LayoutId>
</AddCasterLayoutResponse>

JSON format

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

Error codes

For a list of error codes, visit the API Error Center.