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 try the RTS feature. This topic describes how to run RTS demos.
Prerequisites
A signed ingest URL is generated. For more information, see Step 4: Generate ingest and streaming URLs.
The RTS feature is enabled. For more information, see Step 1: Enable RTS.
Open Broadcaster Software (OBS) is 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
Ingest a stream.
Method 1: Ingest a stream over Real-Time Messaging Protocol (RTMP) by using OBS. For more information, see Live stream ingest.
Method 2: Ingest a stream over WebRTC-HTTP ingestion protocol (WHIP) by using OBS. For more information, see Use OBS to ingest an RTS stream (based on WHIP).
Method 3: Ingest an RTS stream by using the RTS demo for web.
Access the RTS player for web.
Click the Stream Ingest tab.
Expand the none drop-down list and select camera or screen based on your business requirements.
If you select camera, click Get devices in the lower part of the page and grant access permissions on the microphone and camera. Then, select your microphone and camera from the Select Microphone and Select Camera drop-down lists.
Click Create Local Stream.
Enter the generated ingest URL in the RTS format. Example:
artc://example.aliyundoc.com/liveApp****/liveStream****?auth_key=1543302081-0-0-9c6e7c8190c10bdfb3c0****
.Click Start.
NoteIf you encounter issues such as stream ingest exceptions during stream ingest, you can use the troubleshooting tool to troubleshoot the issues. The tool allows you to diagnose common stream ingest issues and provides suggestions for you to resolve specific exceptions. For more information, see Troubleshooting.
Play an RTS stream.
Method 1: Play an RTS stream on a mobile client
Scan the following QR code to install the demo of ApsaraVideo MediaBox SDK. If a URL is provided after you scan the QR code, copy the URL to your browser to download and install the demo.
In the demo, tap Live Push > RTS. Enter the streaming URL of the RTS stream or scan the QR code of the stream.
NoteBefore you use the demo on an iOS device, go to
, find the permissions required by Taobao, and tap Trust.Click Start Playback to play the RTS stream.
Method 2: Play an RTS stream by using the RTS demo for web
Access the RTS player for web.
Click the Stream Pulling tab.
Enter the streaming URL of the RTS stream.
NoteThe browsers implement security policies for Web Real-Time Communication (WebRTC). Make sure that an HTTPS certificate is configured for the streaming domain of your RTS stream. Otherwise, the stream may fail to play.
Web RTS SDK does not support videos that contain B-frames and audio that is encoded in the AAC format. If the video or audio of your 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.
Click Start to play the RTS stream.
If you encounter issues such as playback exceptions during streaming, you can use the troubleshooting tool to troubleshoot the issues. The tool allows you to diagnose common stream playback issues and provides suggestions for you to resolve specific exceptions. For more information, see Troubleshooting.