Adds a video source to a production studio. The number of video sources is limited by the number of input channels of the production studio.
Operation description
Create a production studio before calling this operation to add a video source. The number of video sources is limited by the number of input channels of the production studio. To create a production studio by using an API operation, see CreateCaster.
QPS limit
The single-user QPS limit for this operation is 10 calls per second. If the limit is exceeded, the API call is throttled, which may affect your business. Call this operation appropriately.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
live:AddCasterVideoResource |
create |
*Caster
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
No |
The region ID. |
cn-shanghai |
| CasterId |
string |
Yes |
The production studio ID.
Note
The production studio name in the production studio list on the Cloud Production Studio page of the ApsaraVideo Live console is the production studio ID. |
LIVEPRODUCER_POST-cn-0pp1czt**** |
| ResourceName |
string |
Yes |
The name of the video source. |
test001 |
| LocationId |
string |
No |
The location identifier of the video source. This parameter is required. Defines the reference number of a scene in the layout. Each location can be associated with at most one resource. The format must match "RV01~RV12", which is RV + a number in the range of |
RV01 |
| LiveStreamUrl |
string |
No |
The ApsaraVideo Live streaming URL. Important
|
rtmp://guide.aliyundoc.com/caster/4a82a3d1b7f0462ea37348366201****?auth_key=1608953344-0-0-ac8c628078541d7055a170ec59a5**** |
| MaterialId |
string |
No |
The media asset library material ID. Important This parameter is available and required only when the video source type is material.
If you call the DescribeCasterConfig operation to query the production studio configuration, check the UrgentMaterialId parameter value returned by the DescribeCasterConfig operation. Note
The UrgentMaterialId value is the media asset library material ID. |
f080575eb5f4427684fc0715159a**** |
| VodUrl |
string |
No |
The video-on-demand file URL. Important This parameter is available only when the video source type is file video and the video file has not been imported to the media asset library.
Note
Video-on-demand files are limited to MP4, FLV, and TS formats. |
http://learn.aliyundoc.com/AppName/StreamName.flv |
| BeginOffset |
integer |
No |
The start offset of the video file. Unit: milliseconds. Important This parameter takes effect only when the video source type is file video.
Note
A value greater than 0 indicates that reading starts from the offset time relative to the first frame. |
1000 |
| EndOffset |
integer |
No |
The end offset of the video file. Unit: milliseconds. Important This parameter takes effect only when the video source type is file video.
|
10000 |
| RepeatNum |
integer |
No |
The number of times the video repeats after playback completes. Valid values: Important This parameter takes effect only when the video source type is file video.
|
0 |
| PtsCallbackInterval |
integer |
No |
The PTS callback interval. Unit: milliseconds. |
2000 |
| FixedDelayDuration |
integer |
No |
The fixed delay for the video, which can be used for subtitle synchronization. Unit: ms. Default value: 0. Value range: |
0 |
| ImageId |
string |
No |
The media asset library image material ID. Note
This parameter is available and required only when the video source type is image. |
a089175eb5f4427684fc0715159a**** |
| ImageUrl |
string |
No |
The image material URL. Note
This parameter is available only when the video source type is image and the image file has not been imported to the media asset library. JPG and PNG formats are supported. The maximum file size is 10 MB. |
http://learn.aliyundoc.com/AppName/image.jpg |
The video source type is determined based on the resource type in the streaming URL.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
CF60DB6A-7FD6-426E-9288-122CC1A52FA7 |
| ResourceId |
string |
The resource ID. This ID can be used as a request parameter for deleting or modifying a video source in the production studio. |
e5542d98-b08c-46bf-83e9-5b09d08c**** |
Examples
Success response
JSON format
{
"RequestId": "CF60DB6A-7FD6-426E-9288-122CC1A52FA7",
"ResourceId": "e5542d98-b08c-46bf-83e9-5b09d08c****"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidCasterId.Malformed | %s, please check and try again later. | The parameter CasterId is invalid, please check and try again. |
| 400 | InvalidParameter.Malformed | There are invalid parameters: %s. | There are invalid parameters: %s. |
| 400 | InvalidUserId.Malformed | %s, please check userId. | The userId passed in is invalid, please check. |
| 400 | InvalidLiveStreamUrl.Malformed | %s, please check and try again later. | The parameter LiveStreamUrl is invalid, please check and try again. |
| 400 | InvalidMaterialId.Malformed | %s, please check and try again later. | The parameter MaterialId is invalid, please check and try again. |
| 400 | InvalidVodUrl.Malformed | %s, please check and try again later. | Parameter VodUrl is invalid, please check and try again. |
| 400 | ResourceNumberExceed | %s, please check and try again later. | The number of resources exceeds the limit. Please check and try again. |
| 400 | MissingParameter | %s. | Missing parameter |
| 400 | DuplicateLocationID | %s, please check and try again later. | The parameter LocationID duplicate. Check and try again. |
| 400 | UnexpectedLocationID | %s, please check and try again later. | The LocationId is invalid, please check and try again. |
| 401 | IllegalOperation | %s, please check and try again later. | Operation not allowed, please check and try again. |
| 500 | InternalError | %s, please try again later. | Internal error, please try again later. |
| 404 | InvalidCaster.NotFound | %s, please check and try again later. | The guide station does not exist, please check and try again. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.