Creates a pulled-stream relay task.
Operation description
- You can call this operation to create a pulled-stream relay task.
- The pulled source can be a live stream or video-on-demand (VOD) resources.
- After a task is created, it starts at the specified start time and ends at the specified end time. A task that ends is automatically deleted.
- Make sure that the destination URL specified in the task is not used by another task. Otherwise, conflicts occur and stream ingest fails.
- The events for pulled-stream relay callbacks include state changes of a pulled-stream relay task and exit of a pulled-stream relay task. For more information, see Pulled-stream relay callbacks.
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.
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:
- For mandatory resource types, indicate with a prefix of * .
- 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:CreateLivePullToPush | create | *All Resources * |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
Region | string | Yes | The region where the task is started. Valid values:
Enumeration Value:
| cn-shanghai |
TaskName | string | No | The name of the task. Default value: "". Fuzzy search for task names is supported. | test |
StartTime | string | Yes | The start time of the task. Note
| 2024-08-26T10:30:00Z |
EndTime | string | Yes | The end time of the task. Note
| 2024-08-27T14:30:00Z |
SourceType | string | Yes | The type of the source stream. Valid values:
| live |
SourceProtocol | string | No | The protocol of the source stream. Valid values:
Note
This parameter is required if you set the SourceType parameter to live, but does not take effect if you set the SourceType parameter to vod or url.
| rtmp |
SourceUrls | array | Yes | The source URLs. Note
| |
string | Yes | The source URL of the stream. Note
| rtmp://pulltest.****.aliyunlive.com/pulltest493/pulltest-w434 | |
DstUrl | string | Yes | The destination URL to which the stream is relayed. Note
| rtmp://pushtest.********.aliyunlive.com/pulltest493/pulltest-w434 |
RepeatNumber | integer | No | The number of playbacks after the first playback is complete. Valid values:
Note
This parameter is applicable to only video resources from ApsaraVideo VOD or a third party.
| 0 |
FileIndex | integer | No | The file index, which specifies the sequence of the file where the playback starts. | 0 |
Offset | integer | No | The offset of the position where the system starts to read the video resource. Unit: seconds. Valid values: positive numbers. Note
| 2 |
CallbackUrl | string | No | The HTTP callback URL. By default, this parameter is left empty. Note
| https://callback*****.com |
RetryInterval | integer | No | The retry interval. Unit: seconds. Valid values: [60,300]. Default value: 60. | 60 |
RetryCount | integer | No | The number of retries allowed. Default value: 3. | 3 |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "16A96B9A-F203-4EC5-8E43-CB92E68*****",
"RetCode": 0,
"Description": "OK",
"TaskId": "fd245384-4067-4f91-9d75-9666a6bc9****"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidParameter | %s. | Parameter error |
400 | InvalidParam.CodeIllegalDuration | %s. | The value of start time should be less than the value of end time . |
400 | CodeInvalidAliUid | This aliuid does not have a live domain name. | This aluid does not have a live domain name. |
400 | CodeNotEnoughResource | Exceeded configuration limits or insufficient resources. | Exceeded configuration limits or insufficient resources |
400 | CodeConfigAlreadyExists | Code Config Already Exists | - |
500 | InternalError | %s. | error on the live liveapi server. |
For a list of error codes, visit the Service error codes.