This topic describes how to use ApsaraVideo Live to stream live content.
Before you start
You can read the following topics to learn about the basic knowledge of ApsaraVideo Live:
Procedure
Step 1: Add an ingest domain and a streaming domain
To use ApsaraVideo Live, you must add an ingest domain and a streaming domain. The two domains cannot be the same, but can be different subdomains of a primary domain.
Prepare domain names.
If you do not have a domain name, you can register one with Alibaba Cloud Domain Names. For more information, see Register a generic domain name.
If you want to provide services in the Chinese mainland, you must apply for an Internet Content Provider (ICP) number for your domain name. For more information, see ICP filing process.
NoteIf you want to try the basic features of ApsaraVideo Live, we recommend that you select a live center in a region outside the Chinese mainland and set the acceleration region to Outside Chinese Mainland. This eliminates the need for ICP filing.
If the ingest domain and streaming domain are subdomains of a primary domain, ICP filling is required only for the primary domain.
Log on to the ApsaraVideo Live console.
In the left-side navigation pane, click Domain Names. The Domain Management page appears.
Click Add Domain.
In the Add Domain Name step, configure parameters based on your business requirements.
ImportantWhen you add a domain name to ApsaraVideo Live for the first time, ApsaraVideo Live verifies the ownership of the domain name. For more information, see Verify the ownership of a domain name.
Note down the generated CNAME for use in the next step.
Step 2: Add CNAME records to enable acceleration
To enable acceleration for ApsaraVideo Live, you must add CNAME records at your DNS provider to map your ingest domain and streaming domain to the CNAME that is assigned by ApsaraVideo Live. The following example shows how to add a CNAME record when your DNS provider is Alibaba Cloud.
The server that Alibaba Cloud CDN uses to resolve the CNAME of a domain name is deployed in the Chinese mainland. If you configure region-specific DNS settings for your domain name, for example, you add a CNAME record for your domain name in regions outside the Chinese mainland, including Hong Kong (China), Macao (China), and Taiwan (China), the domain name cannot be mapped to the CNAME. The status of the CNAME is Pending Configuration in the Alibaba Cloud CDN console. However, CDN acceleration for the domain name is not affected.
CNAMEs that are assigned by Alibaba Cloud CDN, Dynamic Content Delivery Network (DCDN), ApsaraVideo Live, and ApsaraVideo VOD can be used only for domain name resolution. If Alibaba Cloud discovers that your CNAME is used for unauthorized or malicious activities, Alibaba Cloud reserves the right to close your Alibaba Cloud account and remove the domain names.
Log on to the Alibaba Cloud DNS console.
In the left-side navigation pane, click Domain Name Resolution. The Domain Name Resolution page appears.
Find the domain name for which you want to add a CNAME record and click DNS Settings in the Actions column.
Click Add DNS Record and configure the parameters that are described in the following table.
Parameter
Description
Record Type
Select CNAME from the drop-down list.
Hostname
Specify a prefix for the domain name. For more information about regular prefixes of domain names and sample domain names, see the following table.
DNS Request Source
Use the default value.
Record Value
Enter the CNAME that you obtained.
TTL Period
Use the default value.
Prefix
Sample domain name
Description
demo
demo.aliyundoc.com
The subdomain name.
@
aliyundoc.com
The root domain name.
*
*.aliyundoc.com
The wildcard domain name.
Click OK.
Check whether a CNAME record takes effect
Step 3: Associate the streaming domain with the ingest domain
ApsaraVideo Live uses the edge ingest method. To ingest and play streams, you must associate the streaming domain with the ingest domain.
In the left-side navigation pane, click Domain Names. On the page that appears, find the streaming domain that you added and click Domain Settings in the Actions column. The page appears.
On the Basic Settings page, click the Basic Information tab.
On the Basic Information tab, you can view the CNAME record, the time when the domain name was created, the type of the domain name, the live center, the acceleration region, and the quota limits.
NoteYou can manage quotas of ApsaraVideo Live only in the China (Beijing), China (Shanghai), China (Shenzhen), and Singapore regions. To increase quotas for other live centers, submit a ticket. For more information, see Contact us.
For more information about how to manage quotas of ApsaraVideo Live, see Quota management.
For more information about how to modify the acceleration region, see the Modify the acceleration region section of this topic.
Click the Stream Ingest Information tab.
Click Add Stream Ingest Information or the Edit icon next to Ingest Domain and select the ingest domain that you want to associate.
(Optional) Configure SSL certificates
For security reasons, if you want to implement RTS in a native browser, you must configure Secure Sockets Layer (SSL) certificates for the ingest domain and the streaming domain. For more information, see Configure HTTPS secure acceleration.
If you use RTS SDK or the RTS demo, SSL certificates are not required.
Step 4: Generate ingest and streaming URLs
Ingest and streaming URLs are used to ingest and play streams. You can use the live URL generator in the ApsaraVideo Live console to generate the URLs. For more information, see Live URL generator.
Step 5: Perform stream ingest and playback
Live stream ingest
Live stream ingest is the process of delivering the collected audio and video streams to a live center of ApsaraVideo Live. The following steps provide an example on how to ingest a stream by using OBS Studio.
Download and install OBS Studio. Download link: OBS Studio.
Run OBS Studio.
In the menu bar, choose .
On the Settings page, click Stream and configure the following parameters.
Parameter
Description
Service
Select Custom....
Server
Enter the generated ingest URL that is signed. Example:
rtmp://demo.aliyundoc.com/app/stream?auth_key=1543302081-0-0-9c6e7c8190c10bdfb3c0************
.Stream Key
Leave this parameter empty.
Go to the homepage of OBS Studio. Find the Sources section, add a source, and then click Start Streaming.
(Optional) Install the Queen SDK plug-in for OBS to debug retouching effects. For more information, see User guide to the Queen SDK plug-in for OBS.
In the ApsaraVideo Live console, go to the Stream Management page. On the Active Streams tab, you can view and manage the ingested audio or video stream.
If you encounter issues such as stream ingest exceptions during stream ingest, you can use the troubleshooting tool to troubleshoot the issues. The tool allows you to diagnose common stream ingest issues and provides suggestions for you to resolve specific exceptions. For more information, see Troubleshooting.
Live stream playback
Live stream playback is the process of delivering a live stream from a live center of ApsaraVideo Live to a player for playback. The following steps provide an example on how to play a stream by using VLC media player.
Download and install VLC media player. Download link: VLC media player.
Run VLC media player.
In the menu bar, choose .
On the Network tab, enter a network URL, which is a streaming URL. Example:
rtmp://example.aliyundoc.com/app/stream?auth_key=1543300311-0-0-d47ce016332bf280cf275********
.Click Play.
If you encounter issues such as playback exceptions during streaming, you can use the troubleshooting tool to troubleshoot the issues. The tool allows you to diagnose common stream playback issues and provides suggestions for you to resolve specific exceptions. For more information, see Troubleshooting.
References
You can read the Developer guide overview topic to learn about more features of ApsaraVideo Live.
For information about how to add a CNAME record at other DNS providers, see Add a CNAME record.
For more information about how to check whether a CNAME record takes effect, see Check whether the DNS records take effect.
For more information about the methods that you can use to generate ingest and streaming URLs, see Generate ingest and streaming URLs.
For information about how to use other stream ingest tools to ingest a stream, see Live stream ingest.
For information about how to use other players to play a stream, see Live stream playback.
For more information about the Queen SDK plug-in for OBS, see User guide to the Queen SDK plug-in for OBS.