This topic shows you how to add and configure domain names for Content Delivery Network (CDN), obtain a streaming URL, and push and play streams.

Prerequisites

  1. An Alibaba Cloud account is created. For more information, see Sign up with Alibaba Cloud.
  2. Two licensed domains are available. For more information about how to apply for an ICP license, see ICP filing.
    Note
    • If you select a live center and use CDN nodes for domain names that are hosted outside mainland China, you do not need to apply for an ICP license.
    • If the ingest domain and streaming domain that you want to add are second-level domains under the same top-level domain, you need to apply for an ICP license only for the top-level domain.

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 accept the service agreement, and click Activate Now. Then, you can go to the ApsaraVideo Live console.

Add an ingest domain and streaming domain

To use ApsaraVideo Live to push and play streams, you must add an ingest domain and streaming domain.
Note
  • To add an ingest domain, set the Domain Type parameter to Ingest Domain. To add a streaming domain, set the Domain Type parameter to Streaming Domain.
  • The ingest domain and streaming domain must be different.
  • 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 has been configured for the domain name that you specified. You can perform the following steps to configure a CNAME record.
  2. Add a CNAME record for the domain name.
    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 procedure 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 streaming domain, you must perform the same steps to add a CNAME record for the ingest domain.
    Note The CNAME records take effect shortly after they are added.
    • A new CNAME record takes effect immediately. A modified CNAME record takes effect within 72 hours.
    • If you encounter record conflict issues when you add a CNAME record, change the domain name or solve the problem by referring to Evaluate record conflicts.
    • 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, ignore the message.
  4. Check whether the CNAME record takes effect.
    The time required for a CNAME record to take effect varies with 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 an ingest domain to a streaming domain

ApsaraVideo Live uses the edge pushing method. To push and play streams, you must bind an ingest 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 ingest domain that you want to bind to, and then click OK.

Configure URL authentication

The URL authentication feature can be used to protect resources on origin servers from unauthorized access and downloads. By default, URL authentication is enabled. We recommend that you keep this feature enabled to prevent your content from being pirated.

You can use the default URL authentication method or a custom URL authentication method based on your business requirements.

  • Default URL authentication

    If you select the default URL authentication method, no additional configuration is required.

  • Custom URL authentication

    If you do not want to use the default configuration, you can customize Primary Key, Secondary Key, and Validity Period and enter the original URL.

    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 authentication configurations and click OK. URL Authentication

Generate ingest 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 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, VLC media player is used as an example. For more information about the download URL, visit VLC media player.
    Note The third-party products that are described 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 ingest URL in the stream pushing tool.
    Split the signed ingest URL and enter them in the URL and Stream Key fields.
    • URL: Enter the part of the ingest URL up to the application name, including the application name.
    • Stream Key: Enter the part of the ingest URL starting from the stream name.

    For example, if the ingest URL is rtmp://push.aliyunlive.com/app/stream?auth_key=1543302081-0-0-9c6e7c8190c10bdfb3c0************, specify the following values for each field.

    • URL: Enter rtmp://push.aliyunlive.com/app/.
    • Stream Key: Enter stream?auth_key=1543302081-0-0-9c6e7c8190c10bdfb3c0************.
    obs
    Note In this example, the ingest URL consists of an ingest domain, an application name, a stream name, and an access token. In actual practice, use the actual values of your ingest URL.

    For more information about OBS configurations and usage, see OBS.

  3. Enter the streaming URL in the media player.
    1. Open VLC media player and choose Media > Open Network Streaming.
      vlc
    2. Enter the streaming URL in the Please enter a network URL field and click Play.
      For example, the streaming URL is rtmp://play.aliyunlive.com/app/stream?auth_key=1543300311-0-0-d47ce016332bf280cf275********. Stream playback
      Note In this example, the streaming URL consists of a streaming domain, an application name, a stream name, and an access token. In actual practice, use the actual values of your streaming URL.

      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
Note As most major browsers no longer support Flash, you cannot preview streaming URLs by using the RTMP protocol in ApsaraVideo Player for web. However, you can still preview streaming URLs by using the FLV, HLS, and ARTC protocols.

Other features

ApsaraVideo Live provides various features, such as permission management, basic services, live stream acceleration, live stream security, live stream latency control, HTTP configuration, media processing for live streams, live stream management, statistics, and log management. For more information about how to use the preceding features, see Overview.