All Products
Search
Document Center

ApsaraVideo Live:AddCasterVideoResource

更新時間:Sep 20, 2024

Adds an input source to a production studio.

Usage notes

Create a production studio, and then call this operation to add an input source to the production studio. The number of input sources is limited by the number of input channels of the production studio. For information about how to create a production studio by calling an operation, see CreateCaster.

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

  • 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 ID/Name column.
ResourceName String Yes test001

The name of the input source.

LocationId String No RV01

The ID that is used to identify the position of the input source. This parameter is required.

Define the reference numbers in the layout. Each reference number is associated with only one resource. The value of this parameter must be in the RV[Number] format, where Number is 01 to 99.

LiveStreamUrl String No rtmp://guide.aliyundoc.com/caster/4a82a3d1b7f0462ea37348366201****?auth_key=1608953344-0-0-ac8c628078541d7055a170ec59a5****

The streaming URL.

Important This parameter is required if the input source is a live stream.
Note Do not specify this parameter in the request if the input source is not a live stream.
MaterialId String No f080575eb5f4427684fc0715159a****

The ID of the material from the media library.

Important This parameter takes effect and is required only if the input source is a material.

If you query the configurations of the production studio by calling the DescribeCasterConfig operation, obtain the value of the response parameter UrgentMaterialId.

Note The value of the UrgentMaterialId parameter is the ID of the material from the media library.
VodUrl String No http://learn.aliyundoc.com/AppName/StreamName.flv

The URL of the VOD file.

Important This parameter takes effect only if the input source 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 input source. Unit: milliseconds.

Important This parameter takes effect only if the input source is a video file.
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 reading the input source. Unit: milliseconds.

Important This parameter takes effect only if the input source is a video file.
  • 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 playbacks after the first playback is complete. Valid values:

Important This parameter takes effect only if the input source is a video file.
  • 0 (default): specifies that the video is played only once.
  • -1: specifies that the video is played in loop mode.
PtsCallbackInterval Integer No 2000

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

FixedDelayDuration Integer No 0

The fixed delay of the video layer. This parameter is used to synchronize the video with subtitles. Unit: milliseconds. Valid values: 0 to 5000. Default value: 0.

ImageId String No a089175eb5f4427684fc0715159a****

The ID of the image from the media library.

Note This parameter takes effect and is required only if the input source is an image.
ImageUrl String No http://learn.aliyundoc.com/AppName/image.jpg

The URL of the image.

Note This parameter takes effect only if the input source is an image that is not from the media library. You can upload an image in the JPG or PNG format. The image can be up to 10 MB in size.

Note The type of the input source can be indicated by the URL.

Response parameters

Parameter

Type

Example

Description

RequestId String CF60DB6A-7FD6-426E-9288-122CC1A52FA7

The request ID.

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

The resource ID. You can use the ID as a request parameter in the API operation that is used to delete the input source in the production studio or modify the input source in the production studio.

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

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

<?xml version="1.0" encoding="UTF-8" ?>
<AddCasterVideoResourceResponse>
	<RequestId>CF60DB6A-7FD6-426E-9288-122CC1A52FA7</RequestId>
	<ResourceId>e5542d98-b08c-46bf-83e9-5b09d08c****</ResourceId>
</AddCasterVideoResourceResponse>

JSON format

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

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

Error codes

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