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 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 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 in 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 name of 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": ["flv","m3u8" ] "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: ["flv","m3u8" ].
  • 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: disables stream delay. This is the default value.
  • A value greater than 0: enables stream delay.
  • Empty: clears the stream delay configuration.
UrgentMaterialId String No a2b8e671

The ID of the material that is used as 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 third-party CDN providers. You can specify up to twenty relay URLs over the RTMP protocol.

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 the channel. Valid values:

  • 0: disables the channel. This is the default value.
  • 1: enables the channel.
Note You cannot disable the channel after you enable it. If you set this parameter to 0, the production studio references video resources in a layout without using the channel. If you enable the channel for the first time, make sure that the production studio is in the idle state. After you enable the channel, a new layout that references video resources by using the channel is generated to replace the original one. Therefore, you must specify video resources for the channel. You can use the channel 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 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 attribute 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 attribute specifies the conference mode. In this mode, all video sources are synchronized.

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

In the conference mode, the hostResourceId attribute is not available. Only resource IDs that are required are provided.

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 ID of the request.

Examples

Sample request

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, visit the API Error Center.