Stream pulling is the process of pulling live streams from third-party streaming URLs. You can use ApsaraVideo Live to process the pulled streams and distribute the streams over Alibaba Cloud CDN for acceleration. Compared to stream ingest, stream pulling is another way to access live streams by using ApsaraVideo Live.
Background information
- Regular stream pulling: specifies the start time and end time for stream pulling. ApsaraVideo Live pulls the streams during the specified period 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.
- If you want to pull third-party live streams that are encoded in the H.265 format, submit a ticket. For more information, see Contact us..
- You cannot pull streams from IPv6 addresses.
- For stream pulling over Secure Reliable Transport (SRT), only regular stream pulling is supported.
- No switch is provided for regular stream pulling over SRT. You only need to ensure that the stream provided by the origin is in the SRT format.
Configure regular stream pulling
- Log on to the ApsaraVideo Live console.
- In the left-side navigation pane, click Domains to go to the Domain Management page.
- Find the streaming domain that you want to configure and click Domain Settings.
- Choose .
- Click the Regular Stream Pulling tab, and then click Add.
- Configure regular stream pulling.
Take note of the following limits:
- You can add up to four back-to-origin URLs.
- You can configure up to 10 templates for regular stream pulling at the same time. If you want to increase the maximum allowed number of templates, you can increase the number of source streams. For more information, see Quota management. After the adjustment, the maximum allowed number of templates for regular stream pulling is the same as the number of source streams.
- The duration from the time when stream pulling starts to the time when stream pulling ends cannot exceed seven days.
The following table describes the parameters for regular stream pulling.
Parameter Description Application Name The name of the application. This parameter is used to generate a 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 name, set this parameter to ali_all_app.
Stream Name The name of the live stream, which must be unique. Source URLs The URL of the third-party live stream. Real-Time Messaging Protocol (RTMP), Flash Video (FLV), HTTP Live Streaming (HLS), and SRT URLs are supported. You can add up to four URLs.
Start Time/End Time The start time and end time of stream pulling. Stream pulling stops when the end time is reached. - Click OK.
Configure triggered stream pulling
- Log on to the ApsaraVideo Live console.
- In the left-side navigation pane, click Domains to go to the Domain Management page.
- Find the streaming domain that you want to configure and click Domain Settings.
- Choose .
- Click the Triggered Stream Pulling tab, and then click Add.
- Configure triggered stream pulling.
Take note of the following limits:
- You can add up to four back-to-origin URLs.
- You can configure up to 20 templates for triggered stream pulling at the same time.
The following table describes the parameters for 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 a 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 name, 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 URL of the third-party live stream. You can add up to four URLs. Protocol for Back-to-origin Stream Pulling RTMP, FLV, and HLS formats are supported. - Click OK.
Modify the configurations of stream pulling
You can modify the configurations of stream pulling to handle unexpected situations in which the origin is unavailable.
- On the Stream Pulling Settings page, click the Triggered Stream Pulling or Regular Stream Pulling tab to view the existing configurations of stream pulling.
- Find the configuration template that you want to modify and click Modify in the Actions column.
- 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.
- Click OK.
- 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 any running business.
- Triggered stream pulling
- After you modify the configurations, existing playback requests comply with the origin configurations before the modification, and new playback requests comply with the modified origin configurations.
- If the AppName in Streaming URL parameter is specified when you configure stream pulling, you cannot leave this parameter empty when you modify the configurations.
Callback logic
- During 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.
- For example, you have Ingest Domain A and Streaming Domain B. You can configure regular stream pulling and triggered stream pulling for Streaming Domain B. If you want to receive callback notifications about the stream pulling status, configure stream ingest callbacks for Ingest Domain A. After the configuration is complete, the preceding callback logic is used for Streaming Domain B. By default, stream pulling is considered successful if the connection is established for 2 seconds.