All Products
Search
Document Center

ApsaraVideo Live:AddCasterVideoResource

Last Updated:Dec 05, 2024
This topic is generated by a machine translation engine without any human intervention. ALIBABA CLOUD DOES NOT GUARANTEE THE ACCURACY OF MACHINE TRANSLATED CONTENT. To request a human-translated version of this topic or provide feedback on this translation, please include it in the feedback form.

Adds an input source to a production studio. The number of input sources is limited by the number of input channels of the production studio.

Operation description

Create a production studio, and then call this operation to add a video source to the production studio. The number of video 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 API 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 limit on an API operation in ApsaraVideo Live.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
live:AddCasterVideoResourcecreate
*Caster
acs:live:*:{#accountId}:caster/{#CasterId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
CasterIdstringYes

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.
LIVEPRODUCER_POST-cn-0pp1czt****
ResourceNamestringYes

The name of the video source.

test001
LocationIdstringNo

The ID that is used to identify the position of the video source.

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.

RV01
LiveStreamUrlstringNo

The streaming URL.

**

Important This parameter is required if the video source is a live stream.

Note Do not specify this parameter in the request if the video source is not a live stream.
rtmp://guide.aliyundoc.com/caster/4a82a3d1b7f0462ea37348366201****?auth_key=1608953344-0-0-ac8c628078541d7055a170ec59a5****
MaterialIdstringNo

The ID of the material from the media library.

**

Important This parameter takes effect and is required only if the video 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.
f080575eb5f4427684fc0715159a****
VodUrlstringNo

The URL of the VOD file.

**

Important This parameter takes effect only if the video source is a file that is not from the media library.

Note The VOD file must be in the MP4, FLV, or TS format.
http://learn.aliyundoc.com/AppName/StreamName.flv
BeginOffsetintegerNo

The offset of the position where the system starts to read the video source. Unit: milliseconds.

**

Important This parameter takes effect only if the video source is a file.

Note A value greater than 0 specifies an offset from the first frame.
1000
EndOffsetintegerNo

The offset of the position where the system stops reading the video source. Unit: milliseconds.

**

Important This parameter takes effect only if the video source is a file.

  • A value greater than 0 specifies an offset from the first frame.
  • A value less than 0 specifies an offset from the last frame.
10000
RepeatNumintegerNo

The number of playbacks after the first playback is complete. Valid values:

**

Important This parameter takes effect only if the video source is a file.

  • 0: specifies that the video source is played only once. This is the default value.
  • -1: specifies that the video source is played in loop mode.
0
PtsCallbackIntervalintegerNo

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

2000
FixedDelayDurationintegerNo

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

0
ImageIdstringNo

ID of the media library image material.

Note This parameter is only available and must be provided when the video source type is an image.
a089175eb5f4427684fc0715159a****
ImageUrlstringNo

Image material URL.

Note This parameter is available only when the video source type is an image and the image file has not been imported into the material library. Supports uploading images in jpg, png formats, with a maximum file size of 10MB.
http://learn.aliyundoc.com/AppName/image.jpg
Note The type of the video source can be indicated by the URL.

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

CF60DB6A-7FD6-426E-9288-122CC1A52FA7
ResourceIdstring

The ID of the resource. This parameter can be used as a request parameter in the API operation that you can call to delete the video source in the production studio or modify the video source in the production studio.

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

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError message
400InvalidCasterId.Malformed%s
400InvalidUserId.Malformed%s
400InvalidParameter.Malformed%s
400InvalidLiveStreamUrl.Malformed%s
400InvalidMaterialId.Malformed%s
400InvalidVodUrl.Malformed%s
400ResourceNumberExceed%s
400MissingParameter%s
400DuplicateLocationID%s
400UnexpectedLocationID%s
401IllegalOperation%s
404InvalidCaster.NotFound%s
500InternalError%s

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-08-08The Error code has changed. The request parameters of the API has changedView Change Details
2023-03-31The Error code has changed. The request parameters of the API has changedView Change Details