CreateLivePullToPush
Creates a pull-to-push streaming task.
Operation description
For billing details, see Pull-to-push streaming billing.
Call this operation to create a pull-to-push streaming task.
You can create live stream pulling tasks or video-on-demand (VOD) stream pulling tasks.
After a task is created, it starts running at the specified start time and automatically stops and is deleted at the specified end time.
Ensure that the destination ingest URL specified in the task is not used by other tasks. Otherwise, stream ingest fails because multiple tasks push streams to the same URL simultaneously.
Pull-to-push streaming callback events include task status change callbacks and task exit callbacks. For more information, see Pull-to-push streaming event callbacks.
QPS limit
The QPS limit per user for this operation is 10 calls per second. If the limit is exceeded, API calls are throttled, which may affect 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:CreateLivePullToPush |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
No |
The region ID. |
cn-beijing |
| Region |
string |
Yes |
The region where the task starts. Valid values:
Valid values:
|
cn-shanghai |
| TaskName |
string |
No |
The task name. This parameter supports fuzzy match. Default value: "". |
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:
Valid values:
|
live |
| SourceProtocol |
string |
No |
The protocol of the source stream. Valid values:
Note
This parameter is required only when the SourceType parameter is set to live. It is invalid when the value is vod or url. |
rtmp |
| SourceUrls |
array |
Yes |
The list of source stream URLs. Note
|
|
|
string |
No |
The source stream URL. Note
|
rtmp://pulltest.****.aliyunlive.com/pulltest493/pulltest-w434 |
|
| DstUrl |
string |
Yes |
The destination ingest URL. Note
|
rtmp://pushtest.********.aliyunlive.com/pulltest493/pulltest-w434 |
| RepeatNumber |
integer |
No |
The number of times the video is replayed after playback finishes. Valid values:
Note
This parameter applies only to VOD or third-party video streams. |
0 |
| FileIndex |
integer |
No |
The file index. Playback starts from the nth file. |
0 |
| Offset |
integer |
No |
The start offset of the video file. Unit: seconds. Valid values: greater than 0. Note
|
2 |
| CallbackUrl |
string |
No |
The HTTP callback URL. Default value: empty. Note
|
https://callback*****.com |
| RetryInterval |
integer |
No |
The retry interval. Unit: seconds. Valid values: 60 to 300. Default value: 60. |
60 |
| RetryCount |
integer |
No |
The number of retries. Default value: 3. |
3 |
| ReqAuth |
string |
No |
Specifies whether to enable authentication for callbacks. |
no |
| AuthKey |
string |
No |
The authentication key. It must be 16 to 64 characters in length and can contain only printable ASCII characters (0x21-0x7e). It is used to verify the callback source when receiving callbacks. |
abcd |
| NotifyItemSwitch |
string |
No |
Specifies whether to receive callbacks when the playlist switches for non-live pull-to-push streaming tasks. |
off |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
The request ID. |
16A96B9A-F203-4EC5-8E43-CB92E68***** |
| RetCode |
integer |
The return code. Note
|
0 |
| Description |
string |
The error description. |
OK |
| TaskId |
string |
The task ID. |
fd245384-4067-4f91-9d75-9666a6bc9**** |
Examples
Success response
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 | The configuration already exists. |
| 500 | InternalError | %s. | error on the live liveapi server. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.