Changes the video source for a production studio.
Operation description
Usage notes
You must call the CreateCaster operation to create a production studio before you call this operation to modify input sources of the production studio.
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:ModifyCasterVideoResource | update | *Caster acs:live:*:{#accountId}:caster/{#CasterId} |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
CasterId | string | Yes | The ID of the production studio. If you create a production studio through the CreateCaster interface, check the value of the CasterId parameter in the response. If you create a production studio through the ApsaraVideo Live Console, log in to the console, then check the ID of the production studio through the following path: Production Studios > Production Studio Management Note
The CasterId is reflected in the Name column on the Production Studio Management page.
| LIVEPRODUCER_POST-cn-0pp1czt**** |
ResourceId | string | Yes | The ID of the video resource. It is reflected in the ResourceId parameter when you call the AddCasterVideoResource operation. | 05ab713c-676e-49c0-96ce-cc408da1**** |
ResourceName | string | No | The name of the video resource. | test001 |
LiveStreamUrl | string | No | The URL of the live stream. This parameter takes effect and is required only when the video resource is a live stream. | rtmp://guide.aliyundoc.com/caster/4a82a3d1b7f0462ea37348366201****?auth_key=1608953344-0-0-ac8c628078541d7055a170ec59a5**** |
MaterialId | string | No | The ID of the material. | f080575eb5f4427684fc0715159a**** |
VodUrl | string | No | 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.
| http://developer.aliyundoc.com/AppName/StreamName.flv |
BeginOffset | integer | No | 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.
| 0 |
EndOffset | integer | No | This parameter takes effect only when the video resource is a video file. Unit: milliseconds.
| 10000 |
RepeatNum | integer | No | The number of playback times after the first playback is complete. This parameter takes effect only when the video resource is a file. Valid values:
| 0 |
PtsCallbackInterval | integer | No | The interval between presentation timestamp (PTS) callbacks. Unit: milliseconds. This parameter takes effect only when the video resource is a VOD file. | 2000 |
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 only available 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
{
"CasterId": "LIVEPRODUCER_POST-cn-0pp1czt****",
"RequestId": "CF60DB6A-7FD6-426E-9288-122CC1A52FA7",
"ResourceId": "98461064-1c94-4dc1-85ce-94098764****"
}
Error codes
HTTP status code | Error code | Error message |
---|---|---|
400 | InvalidCasterId.Malformed | %s |
400 | InvalidUserId.Malformed | %s |
400 | InvalidParameter.Malformed | %s |
400 | InvalidResourceId.Malformed | %s |
400 | InvalidLiveStreamUrl.Malformed | %s |
400 | InvalidMaterialId.Malformed | %s |
400 | InvalidVodUrl.Malformed | %s |
401 | IllegalOperation | %s |
404 | InvalidCaster.NotFound | %s |
404 | InvalidResource.NotFound | %s |
500 | InternalError | %s |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-03-31 | 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 |