All Products
Search
Document Center

ApsaraVideo Live:SetCasterConfig

Dernière mise à jour :Jul 17, 2026

Configures detailed settings for a production studio, including the name, transcoding configuration, recording configuration, and other parameters.

Operation description

Create a production studio by calling the CreateCaster operation first, and then call this operation to configure detailed settings for the production studio.

Warning This operation fully replaces the existing configuration. If you set a parameter to empty, the existing configuration of that parameter in the production studio is cleared.

QPS limit

The single-user QPS limit for this operation is 10 calls per second. If this limit is exceeded, the API call is throttled, which may affect your business. Call this operation appropriately.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

live:SetCasterConfig

update

*Caster

acs:live:*:{#accountId}:caster/{#CasterId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

No

The region ID.

cn-shanghai

CasterId

string

Yes

The production studio ID.

  • If you created the production studio by calling the CreateCaster operation, check the CasterId value returned by the CreateCaster operation.

  • If you created the production studio in the ApsaraVideo Live console, go to ApsaraVideo Live console > Production Studio > Cloud Production Studio to view the ID.

Note

The production studio name in the production studio list on the Cloud Production Studio page of the ApsaraVideo Live console is the production studio ID.

a2b8e671-2fe5-4642-a2ec-bf93880e****

CasterName

string

No

The name of the production studio.

liveCaster****

DomainName

string

No

The primary streaming domain.

Complete the domain name configuration before starting the production studio. If this parameter is empty, the domain name configuration of the production studio is cleared by default.

example.com

TranscodeConfig

string

No

The transcoding configuration.

A JSON-formatted string. Use upper camel case for internal fields of the struct. If this parameter is set to empty, the transcoding configuration is cleared by default. If the transcoding template is empty, an error is returned when the production studio starts.

{"casterTemplate": "lp_ld"}

RecordConfig

string

No

The recording configuration in JSON format. The configuration elements are as follows:

  • endpoint: the API endpoint of the Alibaba Cloud service.

  • ossBucket: the name of the OSS bucket.

  • videoFormat: the video file formats supported for export. Example: [{\"OssObjectPrefix\":\"record/{AppName}/{StreamName}/{StartTime}_{EndTime}\",\"Format\":\"m3u8\",\"CycleDuration\":21600,\"SliceOssObjectPrefix\":\"record/{AppName}/{StreamName}/{UnixTimestamp}\"},{\"OssObjectPrefix\":\"record/{AppName}/{StreamName}/{StartTime}_{EndTime}\",\"Format\":\"flv\",\"CycleDuration\":21600}].

  • interval: the time interval, in milliseconds (ms).

Note

If this parameter is set to empty, the recording feature is not enabled. If this parameter is set to empty, the recording configuration is cleared by default.

{ "endpoint": "http://oss-cn-********.aliyuncs.com/api", "ossBucket****": "liveBucket****", "VideoFormat":[{\"OssObjectPrefix\":\"record/{AppName}/{StreamName}/{StartTime}_{EndTime}\",\"Format\":\"m3u8\",\"CycleDuration\":21600,\"SliceOssObjectPrefix\":\"record/{AppName}/{StreamName}/{UnixTimestamp}\"},{\"OssObjectPrefix\":\"record/{AppName}/{StreamName}/{StartTime}_{EndTime}\",\"Format\":\"flv\",\"CycleDuration\":21600}] "interval": 5 }

Delay

number

No

The stream delay, in seconds.

  • 0 (default): disables stream delay.

  • Greater than 0: enables stream delay.

  • Empty: clears the stream delay configuration by default.

Note

The maximum value is 300 seconds.

0

UrgentMaterialId

string

No

The media asset ID of the standby video in the media library. If this parameter is set to empty, the standby configuration is cleared by default.

a2b8e671

UrgentLiveStreamUrl

string

No

The URL of the standby live stream.

rtmp://demo.aliyundoc.com

SideOutputUrl

string

No

The ingest URL that corresponds to the custom bypass output address of the production studio. If this parameter is empty, the ingest URL that corresponds to the output address automatically generated by Alibaba Cloud is used by default.

Note

Currently, SideOutputUrl supports only the RTMP protocol for stream ingest.

rtmp://****/aliyundoc.com:8000/caster/4a82a3d1b7f0462ea37348366201****?auth_key=1608953344-0-0-53f0758162964516ac850f2ddc3f****

SideOutputUrlList

string

No

The list of multi-destination relay streaming addresses. The addresses can be CDN ingest URLs from Alibaba Cloud or third-party providers. A maximum of 20 RTMP relay addresses can be added to a production studio.

Note

Specify multiple addresses in the array format: ["rtmp://domain/app1/stream1","rtmp://domain/app2/stream2"].

rtmp://domain/app/stream?***

CallbackUrl

string

No

The callback URL. To receive callback notifications, enter a valid receiving address that accepts the HTTP protocol. If this parameter is set to empty, callback notifications for the production studio are canceled by default.

Note

For more information about production studio callbacks, see Cloud production studio callback information.

http://****/aliyundoc.com:8000/caster/4a82a3d1b7f0462ea37348366201****?auth_key=1608953344-0-0-53f0758162964516ac850f2ddc3f****

ProgramEffect

integer

No

Specifies whether the program list takes effect.

  • 0: does not take effect.

  • 1: takes effect.

1

ProgramName

string

No

The name of the program list. This parameter can be configured when the program list feature is used.

program_name

ChannelEnable

integer

No

Specifies whether to enable Channel. If Channel was previously enabled (ChannelEnable=1), you must explicitly pass ChannelEnable=1 in each call to maintain the channel status. Otherwise, the error InvalidCaster.ChannelDisableUnsupported is returned.

  • 0 (default): disabled.

  • 1: enabled.

Note

Channel is disabled by default and cannot be disabled after it is enabled. When Channel is disabled, resources are directly referenced by layouts. To enable Channel for the first time, the production studio must be stopped. Existing layouts are discarded. Resources must first be assigned to a Channel, and new layouts directly reference the Channel. Through Channel, you can adjust the playback progress and status of video sources. In this mode, if the video source, PVW, and PGM areas reference the same resource, the corresponding views remain synchronized.

1

SyncGroupsConfig

string

No

The multi-view synchronization configuration that synchronizes multiple video sources. Multi-view synchronization has two modes:

  • mode: 0 (streamer mode. Multiple video sources are synchronized based on the specified mode.)

  • mode: 1 (conference mode. There is no concept of a streamer video. All video sources are synchronized with each other.)

Streamer mode: hostResourceId: the streamer video source in streamer mode.

Conference mode: the hostResourceId field is not required. Only the resource IDs in resourceIds need to be provided.

"[{\"mode\":0,\"resourceIds\":[\"5a6c1c33-8424-46f6-813c-c152220a****\",\"4e6521dc-a40a-4077-b6bf-1fb12a76****\"],\"hostResourceId\":\"3aa2b39a-fd0e-4b8c-be73-b7af31c4****\"}]"

UrgentImageId

string

No

The media asset ID of the standby image in the media library.

a089175eb5f4427684fc0715159a****

UrgentImageUrl

string

No

The URL of the standby image.

http://learn.aliyundoc.com/AppName/image.jpg

AutoSwitchUrgentOn

boolean

No

Specifies whether to enable automatic switchover to the standby video when the stream is interrupted.

  • true: enabled.

  • false: disabled.

true

AutoSwitchUrgentConfig

string

No

The automatic standby switchover configuration. eofThres: the duration of stream interruption after which the system automatically switches to the standby video, in seconds.

{"eofThres":3}

Response elements

Element

Type

Description

Example

object

CasterId

string

The production studio ID. This ID can be used as a request parameter for querying the production studio stream address, starting the production studio, adding video resources, adding layouts, querying the layout list, adding components, and adding a program list.

b4810848-bcf9-4aef-bd4a-e6bba2d9****

RequestId

string

The request ID.

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

Examples

Success response

JSON format

{
  "CasterId": "b4810848-bcf9-4aef-bd4a-e6bba2d9****",
  "RequestId": "16A96B9A-F203-4EC5-8E43-CB92E68F4CD8"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidUserId.Malformed %s, please check userId. The userId passed in is invalid, please check.
400 InvalidCasterId.Malformed %s, please check and try again later. The parameter CasterId is invalid, please check and try again.
400 InvalidParameter.Malformed There are invalid parameters: %s. There are invalid parameters: %s.
400 IncorrectCasterStatus.Inuse %s, please check and try again later. Caster status is inuse, please check and try again later.
400 MissingParameter %s. Missing parameter
400 InvalidCaster.ChannelDisableUnsupported %s, please check. Disabling an enabled Channel is not supported.
400 IncorrectCasterStatus.EnableChannel %s, please check and try again later. Caster status does not support EnableChannel settings, please check and try again.
403 PermissionDenied %s, please check and try again later. Access denied, please check and try again.
404 InvalidCaster.NotFound %s, please check and try again later. The guide station does not exist, please check and try again.
404 InvalidDomainName.NotFound %s, please check and try again later. Domain name does not exist, please check and try again.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.