ApsaraVideo Live provides basic features of collecting and distributing live streams. You can use a stream pushing tool to push streams to live centers of ApsaraVideo Live based on the specified pushing URLs. ApsaraVideo Live processes and distributes the pushed streams. Then, the audience can use media players to watch the streams based on the specified streaming URLs. You can specify the types of videos to be pushed to live centers in different scenarios based on your business requirements. This topic describes the stream pushing, stream pulling, and streaming features and shows you how to implement these features.

Definition

  • Stream pushing
  • Stream pulling
  • Streaming

Process of live streaming

To use the basic features of ApsaraVideo Live, you can use a stream pushing tool to push streams to live centers of ApsaraVideo Live for content distribution based on the specified pushing URLs. Then, the audience can use media players to watch the streams based on the specified streaming URLs.

The live streaming service of ApsaraVideo Live involves the following steps:

  1. Prepare tools and the network environment
  2. Pull a stream (Optional)
  3. Obtain a pushing URL and a streaming URL
  4. Push the stream
  5. Play and watch the stream

Prepare tools and the network environment

  • Stream pushing tool and media player
    • Stream pushing tool: You can download and use Open Broadcaster Software (OBS). To download OBS, visit Download OBS Studio.
    • Media player: You can use the VLC media player. To download VLC, visit VLC media player.
  • Network environment
    The following table compares two types of networks.
    Network type Benefit Drawback
    Wired network Stable Not convenient enough
    Wi-Fi Convenient Not stable enough
    • A wired network is more stable than a Wi-Fi and the network signal is not often interrupted. We recommend that you use a wired network if the condition permits.
    • A Wi-Fi is more convenient than a wired network. We recommend that you use a Wi-Fi for a live streaming activity.

    Upstream bandwidth detection

    A live streaming activity has high requirements for network conditions. A stable network is required to ensure smooth stream playback. The upstream bandwidth is determined by the quality and resolution of videos in a live streaming activity. Videos with higher quality and higher resolutions require larger upstream bandwidth. We recommend that you use Speedtest, a network speed test tool, to measure the speed of your upstream Internet connection.
    Note We recommend that you keep your upstream bandwidth equal to or larger than 1 Mbit/s.

Pull a stream

If you use a third-party stream for live streaming, you can use the stream pulling feature of ApsaraVideo Live to pull the stream to a live center of ApsaraVideo Live for distribution. You need only to configure stream pulling. You can configure regular stream pulling or triggered stream pulling.
  • Regular stream pulling: specifies the start time and end time to pull live streams.
  • Triggered stream pulling: automatically triggers ApsaraVideo Live to pull live streams from the origin when the origin starts to play the live streams.

To specify the source URL for stream pulling from the origin, perform the following steps in the ApsaraVideo Live console: Click Domain Management in the left-side navigation pane. On the Domain Management page, click Domain Settings in the Actions column of a domain name. On the page that appears, click Stream Pulling Settings on the left side. Then, click Add and set the parameters for stream pulling. For more information, see Configure stream pulling.

Note The IP address of the Alibaba Cloud server that is used for stream pulling is dynamically assigned. If an IP address whitelist is configured for the origin, ApsaraVideo Live may fail to pull streams from the source URL.

Obtain a pushing URL and a streaming URL

To obtain a pushing URL and a streaming URL, perform the following steps:
  1. Add domain names

    You must first add an ingest domain and a streaming domain that have ICP filings. For more information about the domain names for CDN, see the "Add a domain name" section of the Add a domain name topic. For more information about how to add domain names, see Add a domain name and Configure a CNAME record.

  2. Bind the domain names

    After you add the domain names, you must bind the ingest domain to the streaming domain so that you can ingest and play streams. For more information about the overall procedure of binding domain names, see the "Bind the domain names" section of the Bind the domain names topic. For more information about the detailed operations in the ApsaraVideo Live console, see Bind an ingest domain to a streaming domain.

  3. Configure URL signing
    By default, URL signing is enabled. We recommend that you keep this feature enabled to prevent illegal recording and distribution. You can use the default URL signing or custom URL signing. For more information about URL signing, see URL signing. For more information about the detailed operations, see Configure URL signing.
    Note In some cases, you may be unable to enable URL signing. Before you disable URL signing for the first time, make sure that you understand the risk of unauthorized use of your service and agree to the Terms for Disabling URL Authentication.
  4. Configure the optional features.
  5. Construct a pushing URL and a streaming URL.

    After you add and configure a pushing domain and a streaming domain, you can construct a pushing URL and a streaming URL based on these domain names in the ApsaraVideo Live console. For more information, see Ingest and streaming URLs.

Push the stream

To push the stream, perform the following steps:

  1. Install OBS that you have downloaded as a stream pushing tool.
  2. Obtain the pushing URL.

    Obtain the pushing URL in the ApsaraVideo Live console by following the instructions in Obtain a pushing URL and a streaming URL.

  3. Set the required parameters in OBS and use the obtained pushing URL to push the stream.
    You must split the signed pushing URL into two parts and 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************ 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 pushing URL consists of a pushing domain, an application name, a stream name, and an access token. Replace them based on your business scenario.

Play and watch the stream

To play and watch the stream, perform the following steps:

  1. Install VLC that you have downloaded as a media player.
  2. Obtain the streaming URL.

    Obtain the streaming URL in the ApsaraVideo Live console by following the instructions in Obtain a pushing URL and a streaming URL.

  3. Use VLC to play and watch the stream.

    Enter the signed streaming URL, such as rtmp://play.aliyunlive.com/app/stream?auth_key=1543300311-0-0-d47ce016332bf280cf275******** in the Please enter a network URL field and click Play in VLC.

    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.