Adds a video resource to a production studio.
Usage note
- The production studio to which the video resource is added must have been created. For how, see CreateCaster.
- The number of video resources is limited by the input channels of the production studio.
QPS limit
A single user can perform a maximum of 10 queries per second (QPS). Throttling is triggered when the number of calls per second exceeds the QPS limit. The throttling may affect your business. Thus, we recommend that you observe the QPS limit on this operation. For more information about what a single user means and the QPS details, see QPS limit on an API operation in ApsaraVideo Live.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | AddCasterVideoResource |
The system specifies the parameters. Value: AddCasterVideoResource. |
CasterId | String | Yes | 9ff2d96b-37ef-40a3-8cb0-4c7b1e2e**** |
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.
|
ResourceName | String | Yes | test001 |
The name of the video resource. |
RegionId | String | No | cn-shanghai |
The ID of the region. |
LocationId | String | No | RV01 |
The location ID of the video resource in the production studio. This parameter specifies the layer where the video resource is placed in the production
studio. Each location ID can be assigned to only one video resource and must be in
the RV[Number] format. The values specified by this parameter must be in the ascending
order, such as RV01 to RV12. The number must be in the range of |
LiveStreamUrl | String | No | rtmp://****-demo.aliyundoc.com/caster/4a82a3d1b7f0462ea37348366201****? auth_key=1608953344-0-0-ac8c628078541d7055a170ec59a5**** |
The URL of the live stream. This parameter is required when the video resource is a live stream. Note Do not specify this parameter in the request if the video resource is not a live stream.
|
StreamId | String | No | faaa9a6b-1234-1a20-2345-874378483**** |
The ID of the live stream. |
MaterialId | String | No | f080575eb5f4427684fc0715159a**** |
The ID of the material from the media library. This parameter takes effect and is required only when the video resource is a material. If you query the configuration information of the production studio through the DescribeCasterConfig interface, please check the UrgentMaterialId value returned by the DescribeCasterConfig interface call. |
VodUrl | String | No | http://developer.aliyundoc.com/AppName/StreamName.flv |
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.
|
BeginOffset | Integer | No | 1000 |
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.
|
EndOffset | Integer | No | 10000 |
The offset of the position where the system stops to read the video resource. This parameter takes effect only when the video resource is a video file. Unit: milliseconds.
|
RepeatNum | Integer | No | 0 |
The number of times the video resource repeats after the first playback is complete. Valid values:
This parameter takes effect only when the video resource is a video file. |
PtsCallbackInterval | Integer | No | 2000 |
The interval between presentation timestamp (PTS) callbacks. Unit: milliseconds. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | CF60DB6A-7FD6-426E-9288-122CC1A52FA7 |
The ID of the request. |
ResourceId | String | e5542d98-b08c-46bf-83e9-5b09d08c**** |
The ID of the video resource. Record this ID as it can be used for managing the video resources being added. |
Examples
Sample requests
http(s)://live.aliyuncs.com/?Action=AddCasterVideoResource
&CasterId=9ff2d96b-37ef-40a3-8cb0-4c7b1e2e****
&ResourceName=test001
&<Common request parameters>
Sample success responses
XML
format
<AddCasterVideoResourceResponse>
<RequestId>CF60DB6A-7FD6-426E-9288-122CC1A52FA7</RequestId>
<ResourceId>e5542d98-b08c-46bf-83e9-5b09d08c****</ResourceId>
</AddCasterVideoResourceResponse>
JSON
format
{
"RequestId": "CF60DB6A-7FD6-426E-9288-122CC1A52FA7",
"ResourceId": "e5542d98-b08c-46bf-83e9-5b09d08c****"
}
Error codes
For a list of error codes, visit the API Error Center.