All Products
Search
Document Center

ApsaraVideo Live:SetCasterConfig

Last Updated:Dec 15, 2023

Configures a production studio.

Usage notes

You can call the CreateCaster operation to create a production studio and then call this operation to configure the production studio. This operation allows you to set all parameters for a production studio. If a parameter is not specified, the production studio does not have the relevant configuration.

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 SetCasterConfig

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

CasterId String Yes a2b8e671-2fe5-4642-a2ec-bf93880e****

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 Name column.
CasterName String No liveCaster****

The name of the production studio.

DomainName String No example.com

The main streaming domain.

Complete the configuration of the domain name before the production studio is started. If you do not specify this parameter, the domain configuration for the production studio is cleared.

TranscodeConfig String No {"casterTemplate": "lp_ld"}

The transcoding configuration.

The value is a JSON string. Use upper camel case for fields of the string. If you do not specify this parameter, the transcoding configuration is cleared. If no transcoding template is available, an error occurs when the production studio is started.

RecordConfig String No { "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 }

The recording configuration. The value is a JSON string. You can configure the following fields:

  • endpoint: the API server address of an Alibaba Cloud service.
  • ossBucket: the name of the Object Storage Service (OSS) bucket.
  • videoFormat: the format in which the video file can be exported. 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 interval between recordings. Unit: milliseconds.
Note If you do not specify this parameter, the recording feature is disabled and the recording configuration for the production studio is cleared.
Delay Float No 0

Specifies whether to enable stream delay. Unit: seconds. Valid values:

  • 0 (default): disables stream delay.
  • A value greater than 0: enables stream delay.
  • Empty: clears the stream delay configuration.

    Note The maximum value can be 300 seconds.

UrgentMaterialId String No a2b8e671

The ID of the standby video from the media library. If you do not specify this parameter, the standby video configuration for the production studio is cleared.

UrgentLiveStreamUrl String No rtmp://demo.aliyundoc.com

The URL of the standby live stream.

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

The custom stream redirect URL.

If you do not specify this parameter, the production studio uses the redirect URL generated by the system.

Note Redirect URLs support only the Real-Time Messaging Protocol (RTMP) protocol.
SideOutputUrlList String No rtmp://domain/app/stream?***

The stream relay URLs. A relay URL can be an Alibaba Cloud URL or a URL from a third-party CDN provider. You can specify up to 20 relay URLs over the RTMP protocol.

Note Use the following format to specify multiple relay URLs: "rtmp://domain/app1/stream1","rtmp://domain/app2/stream2".
CallbackUrl String No http://****/aliyundoc.com:8000/caster/4a82a3d1b7f0462ea37348366201****?auth_key=1608953344-0-0-53f0758162964516ac850f2ddc3f****

The callback URL. Enter a valid HTTP address for receiving callback notifications. If you do not specify this parameter, the production studio does not send callback notifications.

ProgramEffect Integer No 1

Specifies whether to enable the carousel playback feature. Valid values:

  • 0: disables carousel playback.
  • 1: enables carousel playback.
ProgramName String No program_name

The name of the playlist for carousel playback. You can specify this parameter if you enable the carousel playback feature.

ChannelEnable Integer No 1

Specifies whether to enable channels. Valid values:

  • 0 (default): disables channels.
  • 1: enables channels.
Note You cannot disable channels after you enable them. If you set this parameter to 0, the production studio references video resources in a layout without using channels. If you enable channels for the first time, make sure that the production studio is in the idle state. After you enable channels, a new layout that references video resources by using channels is generated to replace the original one. Therefore, you must specify video resources for channels. You can use the channels to change the playback progress or status. If the video resource, preview, and program modules of the production studio use the same video source, the three modules display the same content.
SyncGroupsConfig String No "[{\"mode\":0,\"resourceIds\":[\"5a6c1c33-8424-46f6-813c-c152220a****\",\"4e6521dc-a40a-4077-b6bf-1fb12a76****\"],\"hostResourceId\":\"3aa2b39a-fd0e-4b8c-be73-b7af31c4****\"}]"

The multi-view synchronization configuration. You can specify this parameter to synchronize multiple video sources.

There are two modes of multi-view synchronization.

  • A value of 0 for the mode field specifies the streamer mode. In this mode, multiple video sources are synchronized based on the settings by the streamer.
  • A value of 1 for the mode field specifies the conference mode. In this mode, all video sources are synchronized.

In the streamer mode, the hostResourceId field specifies the video source on the streamer side.

In the conference mode, the hostResourceId field is not available. You need to provide only resource IDs that are required.

UrgentImageId String No a089175eb5f4427684fc0715159a****

The ID of the standby image from the media library.

UrgentImageUrl String No http://learn.aliyundoc.com/AppName/image.jpg

The URL of the standby image.

AutoSwitchUrgentOn Boolean No true

Specifies whether the production studio automatically switches to the standby resource in case of a stream interruption.

  • true
  • false
AutoSwitchUrgentConfig String No {"eofThres":3}

The configuration for automatic switchover to the standby resource.

The eofThres field specifies the duration after which the production studio automatically switches to the standby resource if a stream interruption occurs. Unit: seconds.

Response parameters

Parameter

Type

Example

Description

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

The ID of the production studio. You can specify the ID in a request to query the streaming URLs of the production studio, start the production studio, add a video resource, a layout, a component, or a playlist to the production studio, or query layouts of the production studio.

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

The request ID.

Examples

Sample requests

http(s)://live.aliyuncs.com/?Action=SetCasterConfig
&CasterId=a2b8e671-2fe5-4642-a2ec-bf93880e****
&<Common request parameters>

Sample success responses

XML format

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

<?xml version="1.0" encoding="UTF-8" ?>
<SetCasterConfigResponse>
	<RequestId>16A96B9A-F203-4EC5-8E43-CB92E68F4CD8</RequestId>
	<casterId>b4810848-bcf9-4aef-bd4a-e6bba2d9****</casterId>
</SetCasterConfigResponse>

JSON format

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

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

Error codes

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