This topic describes how to switch from standard streaming to Real-Time Streaming (RTS).
Prerequisites
Step 1: Enable RTS
Step 2: Generate an ingest URL and a streaming URL for RTS
You can generate an ingest URL and a streaming URL by using the ApsaraVideo Live console or construct the URLs by using the concatenating rules.
Method 1: Generate the URLs by using the console
If you want to quickly generate ingest and streaming URLs, use the URL generator in the console. For more information, see Live URL generator.
Method 2: Construct the URLs
Before you construct an ingest URL or a streaming URL for a live stream by using the concatenating rules, check whether the stream is transcoded and authenticated. Then, obtain an ingest domain, a streaming domain, an application name, a stream name, a transcoding template ID, and an access token. The transcoding template ID and access token are optional. The following table describes the concatenating rules.
URL type | URL format | Concatenating rule |
---|---|---|
Ingest URL | The Real-Time Messaging Protocol (RTMP), RTS, and Secure Reliable Transport (SRT)
formats are supported. We recommend that you use the RTMP format. Example:
Ingest URL in the RTMP format: Note RTS allows you to pull streams over RTS.
|
Ingest domain + Application name + Stream name + Access token |
Streaming URL | The RTMP, Flash Video (FLV), M3U8, and RTS formats are supported. We recommend that
you use the RTS format. Example:
Streaming URL in the RTS format: |
Streaming domain + Application name + Stream name + Access token |
Transcoded stream URL
Note You must provide a transcoding template ID to construct a transcoded stream URL. The
transcoded stream URL is required only if a transcoding template is used.
|
The RTMP, FLV, M3U8, and RTS formats are supported. We recommend that you use the
RTS format. Example:
Transcoded stream URL in the RTS format: |
Streaming domain + Application name + Stream name_Transcoding template ID + Access token |
- Bound streaming domain and ingest domain can be used as long as the application name and stream name of the streaming domain match those of the ingest domain.
- You must provide a transcoding template ID to generate a transcoded stream URL. You can view the transcoding template ID in the console. For more information, see Transcoding management.
- An access token (auth_key) is an encrypted string that is generated based on the URL authentication algorithm. Access tokens are required if you enable URL authentication. You can use the MD5 algorithm to obtain access tokens. For more information, see Construct a signed URL.
- When you construct a URL by using the concatenating rules, replace {Transcoding template ID} or {Access token} with the actual value without {}.
Step 3: Start RTS-based stream ingest
We recommend that you use the RTMP format for RTS-based stream ingest. In the following example, OBS Studio is used to ingest streams over RTMP. If you want to use the RTS format for stream ingest, you need to integrate Push SDK. For more information, see Use Push SDK to ingest streams.
Step 4: Start RTS playback
The following table lists the players integrated with RTS SDK for RTS playback. Alibaba Cloud RTS provides demos for both mobile and web clients.
- Players:
Player References ApsaraVideo Player for mobile clients Integrate Native RTS SDK with ApsaraVideo Player SDK Third-party players that are based on FFmpeg Integrate Native RTS SDK with a third-party player that is based on FFmpeg ApsaraVideo Player for web Overview - For information about the RTS demo, see Play an RTS stream.
Other operations: verify the latency of RTS
You can add a time calibrator URL during stream ingest to verify the latency of RTS by comparing the streaming time with UTC. OBS Studio is used in this example.
Go to the homepage of OBS Studio. Add a time calibrator URL in the Sources section, and click Start Streaming.