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.

Prerequisites

  1. An Alibaba Cloud account is created. For more information, see Sign up with Alibaba Cloud.
  2. 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.
    Note
    • 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.

Background information

If you are using ApsaraVideo Live for the first time, you can start with Limits.

Activate ApsaraVideo Live

  1. Log on to the Alibaba Cloud International site (alibabacloud.com). In the top navigation bar, choose Products > Media Services > ApsaraVideo Live.
  2. On the ApsaraVideo Live product page, click Buy Now.
  3. 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 use ApsaraVideo Live to push and play streams, you must add a stream pushing domain and a streaming domain.
Note
  • 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.
  1. Log on to the ApsaraVideo Live console.
  2. 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.

Note
  1. 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.
  2. 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.
    1. Log on to the Alibaba Cloud DNS console.
    2. On the Manage DNS page, find the domain name that you want to manage and click Configure in the Actions column.
    3. Click Add Record and add a CNAME record.
      Add a record
      • Type: Select CNAME- Canonical name from the drop-down list.
      • Host: Enter the prefix of the domain name for CDN.
        Domain name for CDN Host
        testcdn.aliyun.com testcdn
        www.aliyun.com www
        aliyun.com @
        *.aliyun.com *
      • ISP Line: Use the default value.
      • Value: Enter the CNAME that you copied in the previous step.
      • TTL: Use the default value.
    4. Click Confirm.
  3. 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.
  4. 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 ping or dig command 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. Verify the CNAME record

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.

  1. On the Domain Management page, find the streaming domain that you added and click Domain Settings.
    Domain Settings
  2. Choose Stream Management > Basic Settings and click the Basic Information tab.
    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.
  3. Click the Stream Ingest Information tab.
  4. 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.

    1. In the left-side navigation pane of the ApsaraVideo Live console, click Domains. The Domain Management page appears.
    2. Find the streaming domain that you want to configure and click Domain Settings.
    3. Choose Stream Management > Access Control, click the URL Authentication tab, and then click Change Settings. Click Change Settings
    4. Modify the URL signing configurations and click OK. URL Authentication

Generate stream pushing URLs and streaming URLs

  1. Choose Stream Management > URL Generator.
  2. Select a streaming domain and its associated ingest domain.
  3. Set the Application Name and Stream Name parameters.
  4. Set the Transcoding Template parameter as required.
  5. Click Generate URLs. The ingest URL and streaming URLs are generated.
    001

Push and play streams

  1. Download and install a stream pushing tool and a media player.
    • 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.
    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.
  2. 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.

    The rtmp://push.aliyunlive.com/app/stream?auth_key=1543302081-0-0-9c6e7c8190c10bdfb3c0************ stream pushing URL is used as an example.

    • URL: Enter rtmp://push.aliyunlive.com/app/.
    • Stream Key: Enter stream?auth_key=1543302081-0-0-9c6e7c8190c10bdfb3c0************.
    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.

    For information about how to configure and use OBS, see OBS.

  3. Enter the streaming URL in the media player.
    1. Open the VLC media player and choose Media > Open Network Streaming.
    2. 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.

Copy the streaming URL to ApsaraVideo Player for web and click Preview to play the streams. ApsaraVideo Player for web

Other features

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.