ApsaraVideo Live is a cloud service that ingests, processes, and distributes live audio and video. This guide walks you through basic procedure of building a live streaming application, including domain setup, URL generation, and first live stream.
Basic concepts
Read the following topics to learn the basics of ApsaraVideo Live:
Preparations
Prepare your account
If you do not have an Alibaba Cloud account, visit the Registration page to create one. An Alibaba Cloud account is the entity that pays for cloud resources.
ApsaraVideo Live supports two billing models: pay-as-you-go and resource plans.
Pay-as-you-go is recommended for this tutorial. If the traffic generated during testing does not exceed 10 GB, the estimated cost is a maximum of USD 0.42, excluding costs for domain registration, SSL certificates, and ICP filing.
NoteThe actual fees may vary by region and billing method. The bills displayed in the console shall prevail.
Make sure your account has a sufficient balance.
Procedure
Add ingest and streaming domains: ApsaraVideo Live implements live streaming based on domain names. In this step, you will add and configure the domains for ingesting and playing back in the console.
Add CNAME record to enable acceleration: This step binds your domain name to an accelerated domain name assigned by Alibaba Cloud to ensure fast and stable live content delivery.
Associate ingest and streaming domains: A typical live streaming workflow uses separate domains for ingest and playback. This step associates your ingest domain to its corresponding streaming domain.
Generate ingest and streaming URLs: This step uses the URL generator tool to create URLs based on the configured domains.
Ingest and play a stream: This step demonstrates the end-to-end process. It shows you how to push your live feed using the demo application of Push SDK and how to watch it using VLC media player.
Step 1: Add ingest and streaming domains
To stream live, you must add an ingest domain and a streaming domain. The two cannot be the same, but can be subdomains of the same root domain.
For example, you can use a.test.com as the ingest domain and b.test.com as the streaming domain.
Prepare the domain name.
If you do not have a domain name, register one with Alibaba Cloud Domain Names.
To provide services in the Chinese mainland, you must apply for an Internet Content Provider (ICP) number for your domain name.
NoteTo test without an ICP filing, select a live center outside the Chinese mainland and set the acceleration region to Outside Chinese Mainland.
ICP filling is required only for the root domain.
Log on to the ApsaraVideo Live console.
In the left navigation pane, click Domain Names. The Domain Management page appears.
Click Add Domain Name.
To add a subdomain, append a prefix to the registered root domain. The subdomain does not require separate registration. Ensure you can differentiate between the ingest and streaming subdomains.
Configure the parameters for your domain name.
ImportantIf you add a domain name for the first time, you must verify your ownership.

Click Next. Record the generated CNAME record value for the next step.

Step 2: Add CNAME record to enable acceleration
Point each domain to its assigned CNAME to enable acceleration. The following procedure uses Alibaba Cloud DNS as an example.
If you use regional DNS to apply the CNAME record only to traffic originating outside the Chinese mainland, the console may show a Pending Configuration status. This is because our verification server is located in the Chinese mainland and cannot detect your settings. This is a display issue only and does not affect your acceleration service.
If we detect that your CNAMEs are used for unauthorized or malicious activities, we reserve the right to close your Alibaba Cloud account and remove the domain names.
Log on to Alibaba Cloud DNS.
In the navigation pane on the left, choose Public Zone.
Find the domain name that you want to configure and click Settings in the Actions column.

Click Add Record and configure the following parameters:

Parameter
Description
Record Type
Select CNAME.
Hostname
Enter the prefix. For examples, see the following table.
Query Source
Select the default value.
Record Value
Enter the CNAME value you copied.
TTL
Select the default value.
Prefix
Example domain name
Description
demo
demo.aliyundoc.com
Resolve a subdomain.
@
aliyundoc.com
Resolve a root domain.
*
*.aliyundoc.com
Perform wildcard DNS resolution.
Click OK to complete the CNAME configuration.
Check whether the CNAME record takes effect
Method 1: Click CNAME Configuration Guide. In the right-side panel, click Verify.

Method 2: Run the nslookup -type=cname yourdomain.com command. If the returned result is consistent with the CNAME value of the domain name in the ApsaraVideo Live console, the configuration takes effect.

(Optional) Configure an SSL certificate
For security reasons, if you want to play a stream in a native browser, you must configure SSL certificates for ingest and streaming domains. For more information, see Configure HTTPS secure acceleration.
Step 3: Associate ingest and streaming domains
ApsaraVideo Live uses edge ingest. You must associate ingest and streaming domains to enable end-to-end process from ingestion to distribution.
In the navigation pane on the left, click Domain Names. Find the streaming domain that you added and click Domain Settings in the Actions column.
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.

Step 4: Generate ingest and streaming URLs
Use the built-in URL generator to create signed ingest and streaming URLs for pushing and pulling live streams.
Log on to the ApsaraVideo Live console.
In the navigation pane on the left, choose .
Configure the following parameters:

Parameter
Description
Streaming Domain
Select your streaming domain from the drop-down list.
Authentication
It displays the default signing method (Type A: authentication via timestamp and signature) and validity period.
NoteTo modify validity period, see URL signing.
Ingest Domain
If you have associated domains, the associated ingest domain is auto-populated.
If you do not need ingest URLs, you can leave it empty.
AppName
A unique identifier for your streaming application or business scenario.
StreamName
A unique name of the stream.
Transcoding Template
(Optional) Select a transcoding template if you configured transcoding. Leave it blank for original quality.
The system displays transcoding templates that match the specified AppName.
Click Generate URLs. Copy the generated URLs or scan the QR codes to use them.
To learn about how URLs are constructed, see Generate ingest and streaming URLs.
Step 5: Ingest and play a stream
If exceptions occur during the ingest and playback process, you can use the troubleshooting tool in the console to diagnose common issues and get suggestions. For more information, see Troubleshooting.
Ingest a stream
Ingest is the process of sending the collected audio and video streams to a live center of ApsaraVideo Live. Below is an example on how to ingest a stream by using the demo application of Push SDK.
Scan the QR code on your mobile device and install the demo application.
NoteOn an iOS device, you may receive a message indicating that the demo is from an untrusted enterprise developer. Go to Settings > General > VPN & Device Management, find the permissions required by Taobao, and tap Trust.
Open the application.
Choose Camera Pushing or Screen Sharing.
NoteWhen using a mobile device to ingest local video streams, only the original YUV format is supported.
Scan the QR code generated in Step 4 to automatically fill in the ingest URL. For example,
rtmp://demo.aliyundoc.com/app/stream?auth_key=**********-0-0-9c6e7c8190c10bdfb3c0************. Configure other parameters as needed.
Click Start to start ingesting from your mobile device.
Go to Stream Management to view and manage your active streams.
For other ingest methods, see Live stream ingest.
Play a live stream
Live stream playback is the process of delivering a live stream from a live center of ApsaraVideo Live to a player. 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 streaming URL. Example:
rtmp://example.aliyundoc.com/app/stream?auth_key=1543300311-0-0-d47ce016332bf280cf275********.Click Play.
If stream ingest is interrupted, the playback will fail.
For other playback methods, see Live stream playback.
References
To learn more about the features of ApsaraVideo Live, see Feature overview.
To learn how to add CNAME records at other DNS providers, see Configure CNAME resolution for a domain name.