Pulled-stream relay
Pulled-stream relay lets you pull existing live or video-on-demand (VOD) sources and push them as new live streams.
Overview
Pulled-stream relay pulls content from third-party live streams or recorded videos and broadcasts it to viewers in real time, without traditional ingest steps.
Workflow:
Typical scenario: Vehicle surveillance access
Vehicle-mounted devices often output video streams in private protocols such as JT/T 1078 or the Jiangsu Province standard. To connect such a stream to ApsaraVideo Live, use a protocol conversion gateway to convert the private-protocol stream into a standard RTMP stream. Then, create a pulled-stream relay task. Set Source Stream Type to Live Stream, set the source stream protocol to RTMP, and enter the converted RTMP source stream URL and the destination ingest URL. Mobile clients can then play the stream by using Alibaba Cloud Player SDK.
Usage notes
This feature is a paid feature. Billing starts at 00:00 on December 05, 2025. Pricing: Pulled-stream relay fees.
Each task pushes one stream. To push multiple streams, create multiple tasks.
To avoid conflicts during stream pulling and stream ingest, make sure that only one active task uses a given destination ingest URL at a time. Two destination ingest URLs are considered the same when all parts, including StreamName, are identical, even if their
auth_keyvalues differ. If multiple tasks use the same destination ingest URL concurrently, the later task can overwrite or displace the earlier stream, which can interrupt or disrupt the live broadcast.You are responsible for ensuring that the content used with this feature complies with all applicable laws and regulations. ApsaraVideo Live provides only the stream transmission service. If any legal threats are identified, ApsaraVideo Live will stop the service for the related content and reserves the right to take legal action.
To pull or push streams outside the Chinese mainland, set the task region to a region outside the Chinese mainland.
This feature supports event callbacks. For details, see Pulled-stream relay event callbacks.
Each account can run up to 100 concurrent tasks.
Prerequisites
ApsaraVideo Live is activated.
You have the required information about the live or VOD source.
Source type
Information
Live
The playback URL of the live stream.
Supported protocols: RTMP, SRT, and HTTP-FLV.
VOD
The media asset ID of the VOD source. To get the ID, refer to Obtain or update media asset information.
Video
The URL path of the video source.
NoteThe video URL path must start with http:// or https:// and end with .mp4 or .flv.
NoteMaximum 30 VOD media asset IDs or video source URL paths.
Supported video codecs: H.264 and H.265.
Supported audio codec: AAC. Sampling rate: 16 kHz to 44.1 kHz.
VOD sources must use MP4 or FLV format.
An ingest URL is generated from your ingest domain. For more information, see Generate streaming URLs.
Procedure
Create a task
- Log on to the ApsaraVideo Live console.
In the navigation pane on the left, choose Feature Management > Pulled-stream Relay.
Select a live center region.
Click Create Task.
Configure the task parameters.
The following table describes the task parameters.
Parameter
Description
Region
The region of the stream pulling task. Select a region based on the source-data region or stream ingest region.
NoteSupported regions: China (Shanghai), China (Beijing), China (Shenzhen), Singapore, and Indonesia (Jakarta).
Task Name
A custom name for the task.
Task Time
The start and end times of the task. By default, the start time is five minutes after the current time, and the end time is 24 hours after the start time. The time picker provides 5 minutes, 30 minutes, and 1 hour shortcuts. A shortcut adjusts the start time based on the current time and retains a valid end time.
NoteThe task starts automatically at the specified start time. If it stops or fails to start, click Enable or Restart in the console.
Callback Information
Required. The callback URL for pulled-stream relay task events.
Source Type
The source stream type. For parameter details, see this list item.
Live Stream:Supports RTMP, SRT, and HTTP-FLV source stream protocols.
VOD Asset:Support MP4 video format. If there are multiple videos with the same video ID, the video with the highest transcoding resolution is selected. If the transcoded video has the same resolution, one of the videos is randomly selected. If there is no transcoded video, the original video is selected.
Video Path
Playback Times
The number of times to loop videos in the playlist. Select an infinite loop or specify a count.
NoteThis parameter is available only for VOD Asset or Video Path sources, and controls Playback Times.
Destination Ingest URL
The destination ingest URL to push the stream to. For a live-stream source, rtmp:// and rtmps:// are supported. For a video-on-demand or video-path source, only rtmp:// is supported.
NoteExample of an ApsaraVideo Live ingest URL:
rtmp://ingestdomain.com/***/****?auth_key=****922353-0-0-*****f68cba72490a3328a1167c9****
Parameters in Callback configuration:
Video switch notification: This switch is displayed only for a VOD Asset or Video Path source and is disabled by default. When enabled, a callback notifies your business server when the source switches files.
Callback authentication: This switch is disabled by default. When enabled, callback requests include the
ALI-LIVE-TIMESTAMPandALI-LIVE-SIGNATUREheaders.ALI-LIVE-SIGNATURE calculation method
ALI-LIVE-SIGNATURE=LOWERCASE_HEX(MD5(SIGNCONTENT)) SIGNCONTENT=PullFlowPushTaskID|ALI-LIVE-TIMESTAMP Value|Authentication KEYField Description:
PullFlowPushTaskID:After the creation is completed, it can be obtained in the console.
ALI-LIVE-TIMESTAMP:The UNIX timestamp (in seconds) at which the callback request originated.
Authentication KEY:The authentication key configured by the user for the callback address.
Authentication key: This field is displayed only when Callback authentication is enabled. Enter 16 to 64 visible ASCII characters (0x21 to 0x7e).
Parameters by source stream type:
If Source Stream Type is set to Live Stream, the source supports RTMP, SRT, and HTTP-FLV.
If Source Stream Type is set to VOD Asset, enter the media asset ID in the video list. You can add up to 30 videos, and the system plays them in sequence. For Playback Times, select Loop or Specified.
If Source Stream Type is set to Video Path, enter the video URL.
NoteThe video URL path must start with http:// or https:// and end with .mp4 or .flv.
Click Submit to create the task.
You can also use the CreateLivePullToPush API operation to create a task.
Query a task
- Log on to the ApsaraVideo Live console.
In the navigation pane on the left, choose Feature Management > Pulled-stream Relay.
Select the region where you created the Pulled-stream Relay task. Then, you can perform a term query by Task ID, Task Name, or Destination Ingest URL.
You can also use the DescribeLivePullToPush API operation.
Copy a task
In the left-side navigation pane, choose Feature Management > Pulled-stream Relay to go to the Pulled-stream Relay page.
Select the live center region of the task. Find the task in the task list and click Copy in the Actions column.
On the task creation page, review or change the prefilled configuration and click Submit to create a task. The following rules apply:
If the original task is Not Started, the original configuration and the start and end times are prefilled. The task name is not prefilled.
If the original task is Running, Recovering, or Stopped, the original configuration is prefilled, the start time is set to five minutes after the current time, and the original end time is retained. The task name is not prefilled.
If the original task is Ended, the Copy action is unavailable.
In all copy scenarios, Task Name is cleared. If you leave it empty, the system generates a name in the
taskname_Timestampformat.
Modify a task
- Log on to the ApsaraVideo Live console.
In the navigation pane on the left, choose Feature Management > Pulled-stream Relay.
On the Pulled-stream Relay page, find the task that you want to modify and click Edit in the Actions column.
On the edit page, modify the parameters as needed and click Submit.
If a task is in the Not Started state, you can modify Task Time, Callback URL, Playback Times, editable source settings in Source Information, Callback authentication, Authentication key, and Video switch notification.
If a task is in the Stopped state, you can modify Callback URL, Playback Times, editable source settings in Source Information, Callback authentication, Authentication key, and Video switch notification.
In all task states, Region, Destination URL, Source Type, and Source Protocol cannot be modified. Task configurations cannot be modified in other states.
You can also use the UpdateLivePullToPush API operation.
Delete a task
Pulled-stream relay tasks cannot be recovered.
- Log on to the ApsaraVideo Live console.
In the navigation pane on the left, choose Feature Management > Pulled-stream Relay.
On the Pulled-stream Relay page, find the task that you want to delete and click Delete in the Actions column.
In the dialog box that appears, click Delete to delete the task.
You can also use the DeleteLivePullToPush API operation.
Start a task
Only tasks in the Stopped state can be enabled.
The task starts automatically at the specified start time.
- Log on to the ApsaraVideo Live console.
In the navigation pane on the left, choose Feature Management > Pulled-stream Relay.
On the Pulled-stream Relay page, find the task that you want to start and click Enable in the Actions column.
In the dialog box that appears, click Enable to start the task.
Restart a task
Only tasks in the Running state can be restarted.
- Log on to the ApsaraVideo Live console.
In the navigation pane on the left, choose Feature Management > Pulled-stream Relay.
On the Pulled-stream Relay page, find the task that you want to restart and click Restart in the Actions column.
In the dialog box that appears, click Restart to restart the task.
You can also use the RestartLivePullToPush API operation.
Stop a task
You can Stop a task with the Running status.
- Log on to the ApsaraVideo Live console.
In the navigation pane on the left, choose Feature Management> Pulled-stream Relay.
On the Pulled-stream Relay page, find the task that you want to stop and click Stop in the Actions column.
In the dialog box that appears, click Stop to stop the task.
You can also use the StopLivePullToPush API operation.
FAQ
How do I generate a streaming URL after creating a task?
The streaming URL for a pulled-stream relay task must be generated based on the associated streaming domain, AppName, and StreamName that correspond to the destination ingest URL. You can generate this URL by using the URL generator in the console or by custom concatenation.
Will a pulled-stream relay task automatically resume if the third-party source stream disconnects?
When a third-party source stream disconnects, the task status changes to Recovering (abnormal). By default, the system attempts to pull the stream again every minute, up to three times.
If the source stream recovers and the stream is pulled successfully within 3 minutes, the task status automatically changes to Running (Normal).
If all three retries fail, the task status changes to Offline, and the system no longer automatically attempts to pull the stream. To restart the task, click the Restart button in the console or call the RestartLivePullToPush API.