ApsaraVideo Live provides Real-Time Streaming (RTS) demos for mobile and web clients. We recommend that you use the RTS demo for mobile clients to experience the RTS feature. This topic describes how to run RTS demos.

Prerequisites

  • An authenticated ingest URL is generated. For more information, see Generate ingest and streaming URLs.
  • The RTS feature is enabled. For more information, see Enable RTS.
  • Open Broadcaster Software (OBS) is downloaded and installed. For more information, see OBS.

Environment requirements

The following table describes the requirements for different operating systems.

Operating system Requirement
iOS iOS 9.0 or later
Android Android 4.3 or later

Procedure

  1. Ingest a stream.
    Method 1: Ingest a stream over Real-Time Messaging Protocol (RTMP) by using OBS
    1. Launch OBS.
    2. In the menu bar, choose File > Settings.
    3. On the Settings page, click Stream. On the page that appears, enter the generated ingest URL in the RTMP format in the Server field. Example: rtmp://example.aliyundoc.com/liveApp****/liveStream****?auth_key=1543302081-0-0-9c6e7c8190c10bdfb3c0****.
      001
      Note
      • The ingest URL consists of an ingest domain, application name, stream name, and token. Replace them based on your business requirements.
      • You can specify a value for Stream Key or leave the field empty.
    4. In the left-side navigation pane, click Output. On the page that appears, set the Keyframe Interval parameter to a value less than or equal to 3 and the Profile parameter to baseline.
      002
    5. In the left-side navigation pane, click Advanced. On the page that appears, select Dynamically change bitrate to manage congestion in the Network section.
    Method 2: Ingest a stream over RTS by using the RTS demo for web
    1. Access the RTS player for web.
    2. Click the Stream Ingest tab.
    3. Expand the none drop-down box and select camera or screen based on your business requirements.

      If you select camera, click Mic and Camera at the bottom of the page to authorize the player to access your devices. After the authorization is successful, expand the Select Microphone and Select Camera drop-down lists to select corresponding devices.

      Stream ingest on the web
    4. Click Create Local Stream.
    5. Enter the generated ingest URL in the RTS format. Example: artc://example.aliyundoc.com/liveApp****/liveStream****?auth_key=1543302081-0-0-9c6e7c8190c10bdfb3c0****.
    6. Click Start.
  2. Play an RTS stream.
    Method 1: Play an RTS stream on a mobile client
    1. Scan the following QR code to install the RTS demo. Alternatively, you can copy the URL that is displayed after you scan the QR code to your browser to download and install the demo.
      001
    2. Open the RTS demo and scan the QR code or enter the streaming URL of the RTS stream.
      Note Before you use the RTS demo on an iOS device, tap Settings > General > Device Management. On the page that appears, find the permissions required by Taobao and tap Trust.
    3. Click Start to play the RTS stream.
    Method 2: Play an RTS stream by using the RTS demo for web
    1. Access the RTS player for web.
    2. Click the Stream Pulling tab.
    3. Enter the streaming URL of the RTS stream.
      003
      Note
      • Make sure that an HTTPS certificate is configured for the streaming domain of your RTS stream due to the Web Real-Time Communications (WebRTC) security policy of browsers. Otherwise, the stream may fail to play.
      • Web RTS SDK does not support video streams that contain bidirectional frames (B-frames) and audio streams that are encoded in the Advanced Audio Coding (AAC) format. If a video stream or an audio stream does not meet this requirement, transcode the stream and use the URL of the transcoded stream as the streaming URL. For more information about transcoding, see Configure RTS transcoding.
    4. Click Start to play the RTS stream.