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 pushing streams to ApsaraVideo Live.

Configure regular stream pulling

Regular stream pulling and triggered stream pulling are supported:
  • Regular stream pulling: specifies the start time and end time to pull live streams.
  • Triggered stream pulling: automatically triggers ApsaraVideo Live to pull live streams from the origin when the origin starts to play the live streams.
Notice Stream pulling does not support third-party live streams that are encoded in the H.265 format.
  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.
    If your requirements cannot be met, submit a ticket.
    Configure regular stream pulling

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

    Parameter Description
    AppName The name of the video application. The value of this parameter must be the same as the application name specified in the pushing URL. Otherwise, the configuration does not take effect. If you need to configure stream pulling for all applications in your domain, enter an asterisk (*).
    StreamName 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.
    If your requirements cannot be met, submit a ticket.
    Configure 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. The value of this parameter must be the same as the application name specified in the pushing URL. Otherwise, the configuration does not take effect. If you need to configure stream pulling for all applications in your domain, enter an asterisk (*).
    AppName in Source URL The name of the application for back-to-origin stream pulling. If you do not set this parameter, the application name specified in the streaming URL is used.
    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.

Callback logic

Callback logic for live stream pushing status
  1. During stream pushing over Real-Time Messaging Protocol (RTMP), ApsaraVideo Live checks whether the stream pushing client closes the connection within 2 seconds after ApsaraVideo Live receives an OnPublish message. If the stream pushing client does not close the connection, ApsaraVideo Live sends a callback notification about successful stream pushing. 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 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 pushing callbacks for stream pushing domain A. After the configuration, ApsaraVideo Live uses the same callback logic as that for live stream pushing status to send callback notifications about the stream pulling status under 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 stream pushing or pulling is successful based on callback notifications and the list of online streams.