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
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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
live:AddCasterVideoResource | create | *Caster acs:live:*:{#accountId}:caster/{#CasterId} |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
CasterId | string | Yes | The ID of the production studio.
Note
You can find the ID of the production studio in the Instance Name column.
| LIVEPRODUCER_POST-cn-0pp1czt**** |
ResourceName | string | Yes | The name of the video source. | test001 |
LocationId | string | No | 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 | RV01 |
LiveStreamUrl | string | No | 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**** |
MaterialId | string | No | 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**** |
VodUrl | string | No | 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 |
BeginOffset | integer | No | 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 |
EndOffset | integer | No | 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.
| 10000 |
RepeatNum | integer | No | 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 |
PtsCallbackInterval | integer | No | The interval between presentation timestamp (PTS) callbacks. Unit: milliseconds. | 2000 |
FixedDelayDuration | integer | No | 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 |
ImageId | string | No | 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**** |
ImageUrl | string | No | 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 |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "CF60DB6A-7FD6-426E-9288-122CC1A52FA7",
"ResourceId": "e5542d98-b08c-46bf-83e9-5b09d08c****"
}
Error codes
HTTP status code | Error code | Error message |
---|---|---|
400 | InvalidCasterId.Malformed | %s |
400 | InvalidUserId.Malformed | %s |
400 | InvalidParameter.Malformed | %s |
400 | InvalidLiveStreamUrl.Malformed | %s |
400 | InvalidMaterialId.Malformed | %s |
400 | InvalidVodUrl.Malformed | %s |
400 | ResourceNumberExceed | %s |
400 | MissingParameter | %s |
400 | DuplicateLocationID | %s |
400 | UnexpectedLocationID | %s |
401 | IllegalOperation | %s |
404 | InvalidCaster.NotFound | %s |
500 | InternalError | %s |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-08-08 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2023-03-31 | The Error code has changed. The request parameters of the API has changed | View Change Details |