CreateLivePullToPush

Updated at:
Copy as MD

Call CreateLivePullToPush to create a pull-to-push task.

Operation description

Important Pull-to-push is a paid feature. Billing officially starts from 00:00 on December 5, 2025.
  • For pricing details, see Pull-to-push pricing.

  • Call this operation to create a pull-to-push task.

  • Supports creating live stream pull tasks and VOD pull 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.

  • The push destination URL specified in the task must not be used by other tasks. Otherwise, multiple tasks pushing to the same URL simultaneously will cause push failures.

  • Pull-to-push callback events include task running status change callbacks and task exit callbacks. For more information, see Pull-to-push event callbacks.

QPS limit

The single-user QPS limit for this operation is 10 calls per second. If the limit is exceeded, API calls will be throttled, which may affect your business. Please call this operation appropriately.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

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

Region ID.

cn-beijing

Region

string

Yes

Specifies the region where the task is launched. Valid values:

  • ap-southeast-1 (Singapore)

  • ap-southeast-5 (Indonesia)

  • cn-beijing (Beijing)

  • cn-shanghai (Shanghai)

  • cn-shenzhen (Shenzhen)

Valid values:

  • cn-shenzhen :

    Shenzhen

  • cn-qingdao :

    Qingdao

  • preregion :

    Pre-release

  • cn-beijing :

    Beijing

  • cn-shanghai :

    Shanghai

  • ap-southeast-1 :

    Singapore

  • eu-central-1 :

    Germany - Frankfurt

  • ap-northeast-1 :

    Japan - Tokyo

  • ap-southeast-5 :

    Indonesia

  • me-central-1 :

    Saudi Arabia - Riyadh

cn-shanghai

TaskName

string

No

Task name, used to support fuzzy query. Default value: "".

test

StartTime

string

Yes

Task start time.

Note
  • Format: yyyy-MM-ddTHH:mm:ssZ (UTC time).

2024-08-26T10:30:00Z

EndTime

string

Yes

Task end time.

Note
  • Format: yyyy-MM-ddTHH:mm:ssZ (UTC time).

  • EndTime must be later than StartTime.

  • EndTime must be later than the current time.

2024-08-27T14:30:00Z

SourceType

string

Yes

Source stream type. Valid values:

  • live: live stream.

  • vod: ApsaraVideo VOD resource.

  • url: third-party video file resource.

Valid values:

  • vod :

    ApsaraVideo VOD resource

  • live :

    Live stream

  • url :

    Third-party video file resource

live

SourceProtocol

string

No

Source stream protocol name.

Valid values:

  • rtmp

  • srt

  • http-flv

  • hls

Note

This parameter is required only when the SourceType parameter is set to live, and is invalid when the value is vod or url.

rtmp

SourceUrls

array

Yes

List of source stream URL addresses.

Note
  • For the live type, only one complete live playback URL is supported.

  • For the vod and url types, a maximum of 30 URLs can be specified.

  • The live type supports: rtmp, srt, and http-flv protocols.

  • For the vod type, specify ApsaraVideo VOD media asset IDs.

  • The url type supports: mp4 and http-flv protocols.

string

No

Source stream URL address.

Note
  • For the live type, only one complete live playback URL is supported.

  • For the vod and url types, a maximum of 30 URLs can be specified.

  • The live type supports: rtmp, srt, and http-flv protocols.

  • For the vod type, specify ApsaraVideo VOD media asset IDs.

  • The url type supports: mp4 and http-flv protocols.

rtmp://pulltest.****.aliyunlive.com/pulltest493/pulltest-w434

DstUrl

string

Yes

Destination URL address for pushing the stream.

Note
  • The rtmp protocol is supported.

  • Maximum length is 2000 characters.

rtmp://pushtest.********.aliyunlive.com/pulltest493/pulltest-w434

RepeatNumber

integer

No

Number of times to repeat playback after the initial playback is complete. Valid values:

  • 0 (default): no repeat playback.

  • -1: loop indefinitely.

  • Other positive integers: number of times to repeat playback after the initial playback is complete.

Note

This parameter applies only to VOD or third-party video streams.

0

FileIndex

integer

No

File index. Starts playback from the nth file.

0

Offset

integer

No

Start offset. The offset value from the beginning of the video file. Unit: seconds. Valid values: greater than 0.

Note
  • Indicates the position to start reading from, relative to the first frame (applies to the first video).

  • This parameter applies only to VOD or third-party video streams.

2

CallbackUrl

string

No

HTTP callback URL. Default value: empty.

Note
  • The URL that receives task-related callbacks.

  • Maximum length is 2000 characters.

  • If this parameter is not specified, no task event callbacks will be sent.

https://callback*****.com

RetryInterval

integer

No

Retry interval, in seconds. Valid values: [60, 300]. Default value: 60 seconds.

60

RetryCount

integer

No

Number of retries. Default value: 3.

3

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

Request ID.

16A96B9A-F203-4EC5-8E43-CB92E68*****

RetCode

integer

Return code.

Note
  • "0" is returned under normal conditions.

  • For abnormal conditions, refer to the error code list below.

0

Description

string

Error description.

OK

TaskId

string

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
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.