Adds a video resource to a production studio. The number of video resources is limited by the input channels of the production studio.

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 AddCasterVideoResource

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

CasterId String Yes LIVEPRODUCER_POST-cn-0pp1czt****

The ID of the production studio.

ResourceName String Yes test001

The name of the video resource.

RegionId String No cn-shanghai

The ID of the region.

LocationId String No RV01

The location ID of the video resource in the production studio.

This parameter specifies the layer where the video resource is placed in the production studio. Each location ID can be assigned to only one video resource and must be in the RV[Number] format. The values specified by this parameter must be in the ascending order, such as RV01 to RV12. The number must be in the range of [01,99].

LiveStreamUrl String No rtmp://sophon-test.aliyunlive.com/caster/4a82a3d1b7f0462ea37348366201****? auth_key=1608953344-0-0-ac8c628078541d7055a170ec59a5****

The URL of the live stream. This parameter is required when the video resource is a live stream.

Note Do not specify this parameter in the request if the video resource is not a live stream.
StreamId String No faaa9a6b-1234-1a20-2345-874378483****

The ID of the live stream.

MaterialId String No f080575eb5f4427684fc0715159a****

The ID of the material from the media library. This parameter takes effect and is required only when the video resource is a material.

VodUrl String No http://live.aliyun.com/AppName/StreamName.flv

The URL of the video-on-demand (VOD) file. This parameter takes effect only when the video resource is a video file that is not from the media library.

Note The VOD file must be in the MP4, FLV, or TS format.
BeginOffset Integer No 1000

The offset of the position where the system starts to read the video resource. This parameter takes effect only when the video resource is a video file. Unit: milliseconds.

Note A value greater than 0 indicates an offset from the first frame.
EndOffset Integer No 10000

The offset of the position where the system stops to read the video resource. This parameter takes effect only when the video resource is a video file. Unit: milliseconds.

  • A value greater than 0 indicates an offset from the first frame.
  • A value less than 0 indicates an offset from the last frame.
RepeatNum Integer No 0

The number of times the video resource repeats after the first playback is complete. Valid values:

  • 0: indicates that the video resource is played only once. This is the default value.
  • -1: indicates that the video resource is played in loop mode.

This parameter takes effect only when the video resource is a video file.

PtsCallbackInterval Integer No 2000

The interval between presentation timestamp (PTS) callbacks. Unit: milliseconds.

Note The type of the video resource is indicated by the live stream URL.

Response parameters

Parameter Type Example Description
RequestId String CF60DB6A-7FD6-426E-9288-122CC1A52FA7

The ID of the request.

ResourceId String e5542d98-b08c-46bf-83e9-5b09d08c****

The ID of the video resource.

Examples

Sample requests

http(s)://live.aliyuncs.com/? Action=AddCasterVideoResource
&CasterId=LIVEPRODUCER_POST-cn-0pp1czt****
&ResourceName=test001
&<Common request parameters>

Sample success responses

XML format

<AddCasterVideoResourceResponse>
	  <RequestId>CF60DB6A-7FD6-426E-9288-122CC1A52FA7</RequestId>
	  <ResourceId>e5542d98-b08c-46bf-83e9-5b09d08c****</ResourceId>
</AddCasterVideoResourceResponse>

JSON format

{
  "RequestId": "CF60DB6A-7FD6-426E-9288-122CC1A52FA7",
  "ResourceId": "e5542d98-b08c-46bf-83e9-5b09d08c****"
}

Error codes

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