Adds a video source to a production studio. The number of video sources that you can add is limited by the number of ingest endpoints in the production studio.
Operation description
Before you add a video source, you must create a production studio. The number of video sources that you can add is limited by the number of ingest endpoints in the production studio. For more information about creating a production studio by calling an API operation, see Create a production studio.
QPS limit
This operation is limited to 10 queries per second (QPS) per user. If you exceed this limit, API calls are throttled, which can impact your business. Call this operation at a reasonable rate.
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 |
| CasterId |
string |
Yes |
The region ID. |
LIVEPRODUCER_POST-cn-0pp1czt**** |
| ResourceName |
string |
Yes |
The ID of the production studio.
Note
The name of a production studio in the list on the Cloud Production Studio page is the production studio ID. |
test001 |
| LocationId |
string |
No |
The name of the video source. |
RV01 |
| LiveStreamUrl |
string |
No |
The location identifier for the video source. This parameter is required. The identifier references the video's position in the layout. Each location supports a maximum of one resource. The format is RV followed by a number from 01 to 99. For example, |
rtmp://guide.aliyundoc.com/caster/4a82a3d1b7f0462ea37348366201****?auth_key=1608953344-0-0-ac8c628078541d7055a170ec59a5**** |
| MaterialId |
string |
No |
The Alibaba Cloud streaming URL. Important
|
f080575eb5f4427684fc0715159a**** |
| VodUrl |
string |
No |
The ID of the media asset. Important This parameter is required and takes effect only when the video source is a media asset.
If you call the DescribeCasterConfig operation to query the configuration of the production studio, view the value of the UrgentMaterialId parameter in the response. Note
The value of UrgentMaterialId is the ID of the media asset. |
http://learn.aliyundoc.com/AppName/StreamName.flv |
| BeginOffset |
integer |
No |
The URL of the video-on-demand (VOD) file. Important This parameter is active only when the video source is a file that is not in the Material Library.
Note
The VOD file must be in MP4, FLV, or TS format. |
1000 |
| EndOffset |
integer |
No |
The start offset of the video file, in milliseconds. Important This parameter is valid only when the video source is a file.
Note
A value greater than 0 specifies the offset from the first frame. The system starts to read the file from this offset. |
10000 |
| RepeatNum |
integer |
No |
The end offset value for the video file. Unit: ms. Important This parameter is valid only when the video source is a file.
|
0 |
| PtsCallbackInterval |
integer |
No |
The number of times to repeat the video. Important This parameter is valid only when the video source is a file.
|
2000 |
| FixedDelayDuration |
integer |
No |
The PTS callback interval. The unit is milliseconds. |
0 |
| ImageId |
string |
No |
This field sets a fixed delay for the video to synchronize captions. The unit is ms. The default value is 0. The value range is |
a089175eb5f4427684fc0715159a**** |
| ImageUrl |
string |
No |
The ID of the image asset. Note
This parameter is active and required only when the video source type is Image. |
http://learn.aliyundoc.com/AppName/image.jpg |
The type of a video source is determined by 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. Use this ID as a request parameter to delete or modify a production studio video source. |
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.