This topic describes how to ingest, pull, and play streams.
Terms
ApsaraVideo Live provides basic features of collecting and distributing live streams. You can use a stream ingest tool to ingest streams to live centers of ApsaraVideo Live by using the specified stream ingest URLs. ApsaraVideo Live processes and distributes the ingested streams. Then, the viewers can play the streams in media players by using the specified streaming URLs. You can specify the types of videos to be ingested to live centers in different scenarios based on your business requirements.
- Stream ingest
- Stream pulling
- Streaming
Process of live streaming
To use the basic features of ApsaraVideo Live, you can use a stream ingest tool to ingest streams to live centers of ApsaraVideo Live for content distribution by using the specified stream ingest URLs. Then, the viewers can play the streams in media players by using the specified streaming URLs.
The live streaming service of ApsaraVideo Live involves the following steps:
Prepare tools and the network environment
Download a suitable tool based on your business requirements.
Stream ingest tool | Download link |
---|---|
Stream ingest on PCs In the example in Step 2, the demo of RTS SDK for OBS on PCs is used. |
|
Stream ingest on mobile devices In the example in Step 2, the ApsaraVideo Live demo application is used. |
Scan the following QR code to install the ApsaraVideo Live demo application. |
Media player | Download link |
---|---|
Streaming on PCs In the example in Step 2, the third-party player VLC is used. |
To download VLC, visit VLC media player. |
Streaming on mobile devices In the example in Step 2, the ApsaraVideo Live demo application is used. |
Scan the preceding QR code to install the demo of ApsaraVideo Live. If the ApsaraVideo Live demo application is installed, skip this step. |
Network type | Benefit | Drawback |
---|---|---|
Wired network | Stable | Not convenient enough |
Wi-Fi | Convenient | Not stable enough |
- A wired network is more stable than a Wi-Fi network, and the network signal is not often interrupted. We recommend that you use a wired network if possible.
- A Wi-Fi network is more convenient than a wired network. We recommend that you use a Wi-Fi network for streaming of live events.
Upstream bandwidth detection
Pull a stream
- 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 streaming.
To specify the source URL for stream pulling from the origin, perform the following steps in the ApsaraVideo Live console: Click Domain Settings in the Actions column of a domain name. On the page that appears, click Stream Pulling Settings on the left side. Then, click Add and set the parameters for stream pulling. For more information, see Configure stream pulling.
in the left-side navigation pane. On the Domain Management page, click- The IP address of the Alibaba Cloud server that is used for stream pulling is dynamically assigned. If an IP address whitelist is configured for the origin, ApsaraVideo Live may fail to pull streams from the source URL.
- IPv6 addresses are not supported by regular stream pulling or triggered stream pulling.
Obtain an ingest URL and a streaming URL
You can use the URL generator in the ApsaraVideo Live console or use the concatenating rules to construct an ingest URL and a streaming URL. For more information, see Construct an ingest URL and a streaming URL.
Ingest the stream
Follow the operation guide in the following table to ingest streams based on the stream ingest tool that you use.
Device | Operation guide |
---|---|
PC In this example, the demo of RTS SDK for OBS on PCs is used. |
|
Mobile device In this example, the ApsaraVideo Live demo application is used. |
|
After a stream is ingested, you can log on to the ApsaraVideo Live console and check whether the ingest endpoint for the stream exists in the list displayed on the Ingest Endpoint Management page. If yes, the stream ingest is successful.
Play and watch the stream
Follow the operation guide in the following table to play streams based on the media player that you use.
Device | Operation guide |
---|---|
PC In this example, the third-party player VLC is used. |
Note In this example, the streaming URL consists of a streaming domain, an application
name, a stream name, and an access token. You can replace the sample values with the
actual ones of your streaming URL.
For information about cross-domain errors for playing streams, see What can I do if a message indicating a cross-origin error appears when the player plays streams based on M3U8 playlists? |
Mobile device In this example, the ApsaraVideo Live demo application is used. |
|
Web In this example, ApsaraVideo Player SDK for web is used. |
Notice
|