This topic shows you how to add and configure domain names for Content Delivery Network (CDN), obtain a streaming URL, and then push and play streams.
- An Alibaba Cloud account is created. For more information, see Sign up with Alibaba Cloud.
- Two domain names for which Internet Content Provider (ICP) filings are obtained are
prepared. For more information about how to apply for an ICP filing, see ICP Filing.
- If you select a region outside mainland China for the Live Center parameter and Outside Mainland China for the Edge Group parameter when you add a domain name, you do not need to apply for an ICP filing for the domain name.
- If the stream pushing domain and streaming domain that you want to add are second-level domain names under the same top-level domain name, you need only to apply for an ICP filing for the top-level domain name.
If you are using ApsaraVideo Live for the first time, you can start with Limits.
Activate ApsaraVideo Live
- Log on to the Alibaba Cloud International site (alibabacloud.com). In the top navigation bar, choose .
- On the ApsaraVideo Live product page, click Buy Now.
- On the ApsaraVideo Live activation page, select Pay-By-Traffic as the billing method. Read and agree to the service agreement, and click Activate Now. Then, you can go to the ApsaraVideo Live console.
Add a stream pushing domain and a streaming domain
- To add a stream pushing domain, set the Domain Type parameter to Ingest Domain. To add a streaming domain, set the Domain Type parameter to Streaming Domain.
- You cannot use the same domain name as a stream pushing domain and a streaming domain at the same time.
- When you add a domain name to ApsaraVideo Live, ApsaraVideo Live verifies the ownership of the domain name. For more information, see Verify the ownership of a domain name.
- Log on to the ApsaraVideo Live console.
- In the left-side navigation pane, click Domains to go to the Domain Management page.
Configure a CNAME record
You must configure a canonical name (CNAME) record to map your domain name for CDN to the CNAME that is allocated by ApsaraVideo Live. This way, the requests sent to the domain name can be redirected to the CDN nodes provided by ApsaraVideo Live for content delivery acceleration.
- On the Domain Management page, find the streaming domain that you added in the previous step and copy the
CNAME of the domain name. Note If an exclamation point (!) exists in the CNAME column, no CNAME record is configured for the specified domain name. You can perform the following steps to configure a CNAME record.
- Add a CNAME record. The following example shows you how to add a CNAME record for a domain name in the Alibaba Cloud DNS console. If your DNS service is provided by other DNS service providers, such as DNSPod, Xinnet, or GoDaddy, add a CNAME record for your domain name in the system of your service provider. The procedure is similar to the one that is described in this topic.
- Log on to the Alibaba Cloud DNS console.
- On the Manage DNS page, find the domain name that you want to manage and click Configure in the Actions column.
- Click Add Record and add a CNAME record.
- Type: Select
CNAME- Canonical namefrom the drop-down list.
- Host: Enter the prefix of the domain name for CDN.
Domain name for CDN Host
- ISP Line: Use the default value.
- Value: Enter the CNAME that you copied in the previous step.
- TTL: Use the default value.
- Type: Select
- Click Confirm.
- After you add a CNAME record for the stream pushing domain, you must perform the same
steps to add a CNAME record for the streaming domain. Note The CNAME records take effect soon after they are added.
- A newly added CNAME record takes effect in real time. A modified CNAME record takes effect within 72 hours.
- If a new CNAME record conflicts with the existing records, you can change your domain name.
- It takes about 10 minutes until the status of the CNAME is updated. Therefore, even if you have configured a CNAME record, the No CNAME record is added message may be displayed on the Domain Management page in the ApsaraVideo Live console. In this case, you can ignore the message.
- Check whether the CNAME record takes effect. The duration before the added CNAME record takes effect depends on the DNS service provider. You can run the
digcommand followed by a domain name for CDN to check whether the new CNAME record takes effect. If your request to the domain name for CDN is redirected to
*.*kunlun*.com, both the CNAME record and the CDN service take effect.
Bind a stream pushing domain to a streaming domain
ApsaraVideo Live uses the edge pushing method. To push and play streams, you must bind a stream pushing domain to a streaming domain.
- On the Domain Management page, find the streaming domain that you added and click Domain Settings.
- Choose Basic Information tab. and click the On this tab, you can view the CNAME record, time when the domain name was added, domain type, live center, and edge group of the domain.
- Click the Stream Ingest Information tab.
- Click the Edit icon next to Add Stream Ingest Information or Ingest Domain, select the stream pushing domain to be bound to the streaming domain, and then click OK.
Configure URL signing
The URL signing feature can be used to protect resources on origin servers from unauthorized access and downloads. By default, URL signing is enabled. We recommend that you keep this feature enabled to prevent illegal recording and distribution.
You can select the default URL signing or custom URL signing method as required to enable URL signing.
- Default URL signing
If you select the default URL signing method, no configuration is required.
- Custom URL signing
If you do not select the default URL signing method, you can modify the configurations of the Primary Key, Secondary Key, and Validity Period parameters.
- In the left-side navigation pane of the ApsaraVideo Live console, click Domains. The Domain Management page appears.
- Find the streaming domain that you want to configure and click Domain Settings.
- Choose URL Authentication tab, and then click Change Settings. , click the
- Modify the URL signing configurations and click OK.
Generate stream pushing URLs and streaming URLs
- Choose .
- Select a streaming domain and its associated ingest domain.
- Set the Application Name and Stream Name parameters.
- Set the Transcoding Template parameter as required.
- Click Generate URLs. The ingest URL and streaming URLs are generated.
Push and play streams
- Download and install a stream pushing tool and a media player.
Note The third-party products involved in this topic are only for reference. Alibaba Cloud does not make any guarantee, either explicitly or implicitly, with respect to the performance and reliability of the third-party products, as well as potential impacts of operations on the products.
- Download and install a stream pushing tool. In this topic, Open Broadcaster Software (OBS) is used as an example. For more information about the download URL, visit Download OBS Studio.
- Download and install a media player. In this topic, the Video Lan Client (VLC) media player is used as an example. For more information about the download URL, visit VLC media player.
- Enter the signed stream pushing URL in the stream pushing tool. Split the signed stream pushing URL into the URL and the stream name and then enter them in the URL and Stream Key fields.
- URL: Enter the value before the application name, including the application name.
- Stream Key: Enter the value after the stream name, including the stream name.
rtmp://push.aliyunlive.com/app/stream?auth_key=1543302081-0-0-9c6e7c8190c10bdfb3c0************stream pushing URL is used as an example.
Note In this example, the stream pushing URL consists of a stream pushing domain, an application name, a stream name, and an access token. Replace them based on your business scenario.
- URL: Enter
- Stream Key: Enter
For information about how to configure and use OBS, see OBS.
- Enter the streaming URL in the media player.
- Open the VLC media player and choose .
- Enter the streaming URL in the Please enter a network URL field and click Play. The
rtmp://play.aliyunlive.com/app/stream?auth_key=1543300311-0-0-d47ce016332bf280cf275********streaming URL is used as an example.Note In this example, the streaming URL consists of a streaming domain, an application name, a stream name, and an access token. Replace them based on your business scenario.
For information about how to configure and use the VLC media player, see VLC media player.
For information about cross-domain errors for playing streams, see What can I do if I receive a message indicating a cross-domain error when the player plays streams based on M3U8 playlists?
You can also play streams by using ApsaraVideo Player for web on a PC.
ApsaraVideo Live provides various features for you, such as permission management, basic features, live streaming acceleration, live streaming security protection, live streaming latency control, HTTP configuration, media processing for live streams, live streaming management, data statistics, and log management. For more information about how to use the preceding features, see Overview.