Stream pulling is the process of pulling live streams from third-party streaming URLs. You can use ApsaraVideo Live to process and deliver the pulled streams for Alibaba Cloud CDN acceleration. You can use stream pulling for live streaming as an alternative to ingesting streams to ApsaraVideo Live.

Background information

Regular stream pulling and triggered stream pulling are supported.
  • Regular stream pulling: specifies the start time and end time to pull live streams. The live streams are pulled during the specified duration regardless of whether playback requests are sent.
  • Triggered stream pulling: automatically triggers ApsaraVideo Live to pull live streams when the streaming URL of the specified domain name is used for streaming. When live streams are not played, ApsaraVideo Live does not pull live streams from the origin.
Notice Stream pulling does not support third-party live streams that are encoded in the H.265 format.

Configure regular stream pulling

  1. Log on to the ApsaraVideo Live console.
  2. In the left-side navigation pane, click Domains to go to the Domain Management page.
  3. Select the streaming domain that you want to configure and click Domain Settings.
    Configure the domain name
  4. Choose Templates > Stream Pulling Settings.
  5. Click the Regular Stream Pulling tab and then Add.
  6. Configure regular stream pulling.
    Limits:
    • You can add up to four source URLs.
    • You can use up to 10 templates to pull streams at the same time.
    • The period from the start time to the end time of stream pulling must be within seven days.
    Stream Pulling Settings

    The following table describes the parameters that you can set to configure regular stream pulling.

    Parameter Description
    Application Name The name of the video application. This parameter is used to generate the streaming URL. The value of this parameter does not need to be the same as the application name that is specified in the ingest URL.

    If you want to configure stream pulling for all applications in your domain, set this parameter to ali_all_app.

    Stream Name The name of the live stream. The live stream must be different from live streams that are specified in other stream pulling templates.
    Source URLs The source URL of the third-party live stream. You can add up to four source URLs.
    Start Time/End Time The start time and end time of stream pulling. Stream pulling stops when the current time is later than the end time.
  7. Click OK.

Configure triggered stream pulling

  1. Log on to the ApsaraVideo Live console.
  2. In the left-side navigation pane, click Domains to go to the Domain Management page.
  3. Select the streaming domain that you want to configure and click Domain Settings.
    Configure the domain name
  4. Choose Templates > Stream Pulling Settings.
  5. Click the Triggered Stream Pulling tab and then Add.
  6. Configure triggered stream pulling.
    Limits:
    • You can add up to four source URLs.
    • You can use up to 20 templates to pull streams at the same time.
    Configure Settings for Triggered Stream Pulling

    The following table describes the parameters that you can set to configure triggered stream pulling.

    Parameter Description
    AppName in Streaming URL The name of the application to which the live stream belongs. This parameter is used to generate the streaming URL. The value of this parameter does not need to be the same as the application name that is specified in the ingest URL.

    However, if you do not set the AppName in Source URL parameter, the value of this parameter must be the same as the application name that is specified in the ingest URL.

    If you want to configure stream pulling for all applications in your domain, set this parameter to ali_all_app.

    AppName in Source URL The name of the application for back-to-origin stream pulling. The value of this parameter must be the same as the application name that is specified in the ingest URL.

    If you do not set this parameter, the value of the AppName in Streaming URL parameter is used. In this case, the value of the AppName in Streaming URL parameter must be the same as the application name that is specified in the ingest URL.

    Source URL The source URL of the third-party live stream. You can add up to four source URLs.
    Protocol for Back-to-origin Stream Pulling The protocol for back-to-origin stream pulling. Valid values: RTMP and HTTP-FLV.
  7. Click OK.

Modify the configurations of stream pulling

You can modify the configurations of stream pulling to handle urgent situations where the origin is unavailable.

  1. On the Stream Pulling Settings page, click the Triggered Stream Pulling or Regular Stream Pulling tab to view the existing configurations of stream pulling.
  2. Find the configuration template that you want to modify and click Modify in the Actions column.
    Modify
  3. In the Stream Pulling Settings dialog box, modify the configurations of stream pulling.
    For more information about the parameters, see the Configure regular stream pulling and Configure triggered stream pulling sections of this topic.
  4. Click OK.
Usage notes
  • Regular stream pulling

    After you modify the configurations, streams are pulled again based on the modified configurations. Make sure that the modification does not affect online business.

  • Triggered stream pulling
    • After you modify the configurations, the existing playback is based on the origin configurations before the modification, and the new playback is based on the modified origin configurations.
    • If the AppName in Source URL parameter is set when stream pulling is configured, you cannot leave this parameter empty when you modify the configurations.

Callback logic

Callback logic for stream ingest status
  1. During a stream ingest over Real-Time Messaging Protocol (RTMP), ApsaraVideo Live checks whether the stream ingest client closes the connection within 2 seconds after ApsaraVideo Live receives an OnPublish message. If the stream ingest client does not close the connection, ApsaraVideo Live sends a callback notification about the successful stream ingest. You may require ApsaraVideo Live to send this callback notification only when ApsaraVideo Live receives live streaming data after the connection is established. In this case, submit a ticket.
  2. Assume that you have stream pushing domain A and streaming domain B, and you use the stream pulling feature for live streaming under streaming domain B. You can configure ApsaraVideo Live to pull a stream at the specified point in time, or enable ApsaraVideo Live to automatically pull a stream when the origin server starts live streaming. If you want to receive a callback notification about the stream pulling status, configure stream ingest callbacks for the ingest domain A. After the configuration, ApsaraVideo Live uses the same callback logic as that for stream ingest status to send callback notifications about the stream pulling status under the streaming domain B. By default, ApsaraVideo Live sends a callback notification about successful stream pulling if the stream pulling client does not close the connection within 2 seconds after the connection is established. If you require ApsaraVideo Live to send this callback notification only when live streaming data is received, submit a ticket.
Note We recommend that you deliver the streaming URL only after you determine that the stream ingest or pulling is successful based on callback notifications and the list of online streams.