Origin stream pulling

更新时间:
复制 MD 格式

Origin stream pulling refers to the process of pulling live streams from third-party sources to the Alibaba Cloud live center for processing and accelerated delivery. You can configure stream pulling in two modes: scheduled pulling and triggered pulling.

Feature introduction

ApsaraVideo Live supports two types of origin pulling:

  • Scheduled pulling: The stream is pulled during a specified time period, regardless of user playback activity.

  • Triggered pulling: The stream is pulled only when a playback request (initial pull) is detected for a specific stream under the domain. During the pulling process, the system determines whether to stop pulling based on the viewer playback status and the running status of backend tasks:

    • If backend tasks, such as recording, time shifting, snapshots, or content moderation, are still running, the system keeps the stream connection active even if no one is watching.

    • If no backend tasks are running and the system detects no viewers for five minutes, the system automatically disconnects the pull task.

      Note

      If you want the system to disconnect the pull task immediately when there are no viewers, regardless of backend task running status, submit a ticket for backend configuration.

Limitations

  • Scheduled pulling

    • Supports pulling third-party live streams from URLs in RTMP, HTTP-FLV, HLS, or SRT format.

    • You can add up to 300 scheduled pulling configurations. To increase this limit, request an increase in the quota for original streams. For more information, see Quota management. The maximum scheduled pulling configuration limit aligns with the original stream limit.

    • The interval between the start time and end time of a pull task cannot exceed 7 days.

  • Triggered pulling

    • Supports pulling third-party live streams from URLs in RTMP, HTTP-FLV, or HLS format.

    • You can add up to 200 triggered pulling configurations.

  • Origin pulling from IPv6 addresses is not supported.

  • To support third-party live streams encoded in H.265, please contact us.

Configure triggered pulling

  1. Log on to the ApsaraVideo Live console.

  2. In the left navigation pane, choose Domain Names.

  3. Find the streaming domain that you want to manage and click Domain Settings. In the left navigation tree, choose Origin Stream Pulling.

  4. On the Trigger Stream Pulling tab, click Add.

  5. Configure triggered pulling.

    Parameter

    Description

    AppName in Streaming URL

    • This AppName is used to generate the streaming URL and does not need to match the AppName of the origin stream. However, if you do not specify an AppName in Source URL, this AppName must be identical to the AppName of the origin stream.

    • To configure stream pulling at the domain level, set this parameter to ali_all_app.

    AppName in Source URL

    • The AppName used for pulling streams from the origin server. It must match the AppName of the origin stream.

    • If left blank, the AppName in Streaming URL is used. In this case, its value must be identical to the AppName of the origin stream.

    Source URL

    The URL of the third-party live stream. You can add up to four URLs. If the active stream is interrupted, the system automatically switches to and pulls from the next backup URL.

    Origin Stream Pulling Protocol

    Supports RTMP, HTTP-FLV, and HLS protocols. The SRT protocol is not supported.

    Transcoding-Triggered Stream Pulling

    • Enabled: Requesting either the transcoded stream URL or the original stream URL automatically triggers ApsaraVideo Live to pull the stream from the origin server.

    • Disabled: Only requesting the original stream URL triggers origin pulling. Requesting a transcoded stream URL cannot trigger origin pulling.

  6. Click OK.

Streaming URLs

After the stream is pulled, combine the AppName with the origin stream name (StreamName) to generate streaming URLs. The StreamName in the streaming URL must be identical to the origin StreamName. The AppName matching rules are as follows:

  • Standard: Use the configured AppName in Streaming URL.

  • Global match (AppName in Streaming URL is configured as ali_all_app):

    • If AppName in Source URL is not configured: Use the original AppName of the origin stream.

    • If AppName in Source URL is configured: You can customize the AppName.

Configure scheduled pulling

  1. Log on to the ApsaraVideo Live console.

  2. In the left navigation pane, choose Domain Names.

  3. Find the streaming domain that you want to manage and click Domain Settings. In the left navigation tree, choose Origin Stream Pulling.

  4. On the Fixed Stream Pulling tab, click Add.

  5. Configure regular stream pulling.

    Parameter

    Description

    Application Name

    This AppName is used to generate the streaming URL. It does not need to match the AppName of the origin stream.

    StreamName

    The name of the live stream. The stream name must be unique among all stream pulling templates.

    Source URL

    The URL of the third-party live stream. Supports RTMP, HTTP-FLV, HLS, and SRT formats. You can add up to four URLs. If the active stream is interrupted, the system automatically switches to and pulls from the next backup URL.

    Start and End Time

    The start and end time for scheduled pulling. The interval between them cannot exceed 7 days.

  6. Click OK.

Note

To start playback, generate a streaming URL using the configured AppName and StreamName. For more information, see Generate live URLs.

Modify pulling configurations

Modify your pulling configuration to handle urgent scenarios where the origin server becomes unavailable.

  1. On the Origin Stream Pulling page, click the Trigger Stream Pulling or Fixed Stream Pulling tab to view the existing configurations.

  2. Find the configuration that you want to modify and click Modify in the Actions column.

  3. Modify the stream pulling configuration.

  4. Click OK.

Important
  • Scheduled pulling

    After modifying the configuration, the system restarts the pull task based on the new settings. Ensure that this operation does not affect active online services.

  • Triggered pulling

    • After modification, existing playback sessions continue to use the old configuration, while new playback requests apply the new configuration.

    • If you specified an AppName in the source URL when you added the configuration, you cannot leave this parameter empty when you modify the configuration.

Callback logic

For RTMP stream ingestion, if the client does not actively disconnect within 2 seconds after ApsaraVideo Live receives the On Publish message, ApsaraVideo Live sends a stream ingestion success callback.

The callback logic for origin stream pulling is identical. Suppose you have an ingest domain A and a streaming domain B. If domain B uses stream pulling (either scheduled or triggered) and requires callbacks, configure the stream ingest callback on the ingest domain A. Once configured, pull events on domain B can trigger callbacks. After a connection is established, if there is no active disconnection for 2 seconds, the pull task is considered successful.

If no stream data reaches the live center for 10 consecutive seconds, ApsaraVideo Live automatically disconnects the current pull task.

Note

We recommend that you do not rely solely on callback notifications to determine whether stream ingestion or pulling is functioning normally. Call the DescribeLiveStreamsPublishList API to verify that the stream actively exists before distributing the streaming URL to users.