All Products
Search
Document Center

ApsaraVideo Live:AddCasterLayout

Last Updated:Dec 05, 2024

Adds a layout for a production studio.

Operation description

First, create a director desk and add video resources to the director desk, then call this interface to add the director desk layout. To create a director desk using the API, refer to Create Director Desk.

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 business operations. Please use the API reasonably. For more information, see QPS Limitation.

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:AddCasterLayoutcreate
*Caster
acs:live:*:{#accountId}:caster/{#CasterId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
VideoLayerarray<object>Yes

Video layout.

objectYes

Video layout.

FillModestringNo

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.
fit
FixedDelayDurationintegerNo

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.

5000
HeightNormalizedfloatNo

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.
1
PositionNormalizedarrayNo

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

Note The coordinates indicate the location of video layer N in the production studio. Set this parameter to the normalized value of the coordinates.
floatNo

value.

0
PositionReferstringNo

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.
topLeft
WidthNormalizedfloatNo

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.
1
AudioLayerarray<object>Yes

Audio layout.

objectYes

Audio layout.

FixedDelayDurationintegerNo

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.

5000
ValidChannelstringNo

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.
all
VolumeRatefloatNo

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.
1.0
BlendListarrayYes

The element represents the location ID of the video resource, i.e., LocationId. Refer to Adding Video Source for LocationId, which corresponds in order with the VideoLayers elements.

stringYes

LocationId.

RV01
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

LocationId.

RV01
CasterIdstringYes

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.
LIVEPRODUCER_POST-cn-0pp1czt****
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

ParameterTypeDescriptionExample
object
LayoutIdstring

The ID of the layout.

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

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

The ID of the request.

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

Examples

Sample success responses

JSONformat

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

Error codes

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

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

Change history

Change timeSummary of changesOperation
No change history