All Products
Search
Document Center

ApsaraVideo Live:Reduce latency to 200–400 ms with RTS

Last Updated:Dec 11, 2025

Use Real-Time Streaming (RTS) to reduce live streaming latency to under 400 ms and provide viewers with a smooth, real-time experience.

Overview

RTS uses Alibaba Cloud's Global Realtime Transport Network (GRTN) and the WebRTC protocol to achieve an end-to-end latency of 200–400 ms. This solution is also forward-compatible with standard live streaming.

image

Achieve 200–400 ms end-to-end latency with RTS:

  1. A streamer uses the Push SDK to ingest the live stream over the WebRTC protocol to the nearest point of presence (POP).

  2. GRTN transmits the live stream in real time across its 3,200+ global POPs using smart routing and QoS technologies.

  3. Viewers pull the stream from the nearest POP over the WebRTC protocol for playback on their devices, achieving an end-to-end latency of 200–400 ms.

(Optional) Enable internal relay to support media processing, RTS, and standard live streaming:

  1. After you enable stream relay, ApsaraVideo Live automatically transmuxes the ingested stream to generate an RTMP stream.

  2. You can configure media services such as transcoding, recording, and snapshot capture for this stream.

  3. Viewers can still achieve low-latency playback, with an end-to-end latency of 400–800 ms, by pulling the stream over WebRTC.

  4. To use standard live streaming, pull and play the stream over RTMP, FLV, or HLS.

Implementation

Before you begin

Configure HTTPS certificates for ingest and streaming domains

Because this topic uses a browser-based demo, you must configure HTTPS certificates for your ingest and streaming domains. This is a security requirement for WebRTC in browsers. For instructions, see Configure HTTPS secure acceleration.

If you use a native SDK for stream ingest and playback, you do not need to configure HTTPS certificates.

Enable RTS

  1. Log on to theApsaraVideo Live console.

  2. In the left navigation pane, choose Live + > RTS.

  3. Select a streaming domain.

  4. Turn on the switch and select Half-second (End-to-End Latency: 200-400 ms).

image

Generate ingest and streaming URLs

Method 1: Generate URLs in the console

After enabling RTS, click Generate URLs. Enter an AppName and StreamName to generate ARTC-based ingest and streaming URLs.

image

Method 2: Manually assemble URLs

When you manually construct ingest and streaming URLs, check whether the live stream is transcoded and whether URL signing is enabled. You also need the ingest domain, streaming domain, AppName, StreamName, transcoding template ID (if applicable), and access token (if applicable). The following table describes the URL construction rules.

URL type

Format

Construction rule

Ingest URL

RTMP, RTS, and SRT protocols are supported. We recommend using an RTMP URL for stream ingest. For example:

RTMP: rtmp://demo.aliyundoc.com/app/stream?auth_key={access_token}

Note

RTS also supports stream pulling over the ARTC protocol.

Ingest domain + AppName + StreamName + Access token

Streaming URL

RTMP, FLV, M3U8, and ARTC protocols are supported. We recommend using an ARTC URL for playback. For example:

ARTC: artc://example.aliyundoc.com/app/stream?auth_key={access_token}

Streaming domain + AppName + StreamName + Access token

Transcoded stream URL

RTMP, FLV, M3U8, and ARTC protocols are supported. We recommend using an ARTC URL for playback. For example:

ARTC: artc://example.aliyundoc.com/app/stream_{transcoding_template_ID}?auth_key={access_token}

Streaming domain + AppName + StreamName_Transcoding template ID + Access token

Note
  • For associated ingest and streaming domains, you can start stream ingest and playback if the AppName and StreamName are the same for both.

  • A transcoded stream URL requires a transcoding template. You can view the transcoding template ID in the console. For more information, see Live stream transcoding.

  • The access token (auth_key) is an encrypted string that is generated by a signing algorithm. This requires the URL signing feature to be enabled. You can use the MD5 algorithm to calculate the access token. For more information, see Construct a signed URL.

  • Replace {transcoding_template_ID} and {access_token} with the actual data. Do not include the curly braces {}.

Ingest the RTS stream

You can integrate one of the following Push SDKs:

Platform

Reference

iOS

Push SDK for iOS

Note

The Push SDK for iOS supports WebRTC-based stream ingest by default.

Android

Push SDK for Android

Note

The Push SDK for Android supports WebRTC-based stream ingest by default.

Use OBS for stream ingest based on the WHIP protocol

Push a live stream to RTS using OBS

The following example uses the RTS web demo:

  1. Go to the RTS web demo.

  2. In the demo, select the Stream Ingest mode.

  3. From the none drop-down list, select camera or screen.

    If you select camera, click the Get devices button to grant the required browser permissions. Then, select your specific microphone and camera from their respective drop-down lists.

  4. Enter the RTS ingest URL that you generated in the Generate ingest and streaming URLs step and click Create Local Stream.

  5. Click Start to begin ingesting the stream.RTS推流

Play the RTS stream

You can integrate one of the following ApsaraVideo Player SDKs:

Platform

Reference

Web

Player SDK for Web

iOS

iOS player

Flutter

Flutter player

Windows

Note

To obtain the SDK for Windows, contact the sales team.

This topic uses the RTS web demo as an example:

  1. Go to the RTS web demo.

  2. In the demo, select the Stream Pulling mode.

  3. Enter the RTS streaming URL that you generated in the Generate ingest and streaming URLs step.

  4. Click Start.rts 播放

(Optional) Configure stream relay

  1. On the RTS settings page, select Half-second (End-to-End Latency: 200-400 ms).

  2. Click Configure Stream Relay. Enable the feature and select the destination domain to receive the relayed RTMP stream.

Note

For example, the destination ingest domain is push.example.com, and its associated streaming domain is pull.example.com.

  • You cannot enable the RTS half-second latency mode on the destination ingest domain or its associated streaming domain.

  • No fees are charged for internal stream relay.

image

(Optional) Configure media processing for relayed stream

After configuring stream relay, you can configure media processing templates based on the streaming domain (pull.example.com) associated with the destination ingest domain.

In the left navigation pane, choose Feature Management and select the feature you want to configure.

image

(Optional) Play the relayed stream as a standard live stream

After stream is relayed, you can use the streaming domain (pull.example.com) associated with the destination ingest domain to play the original stream or the transcoded stream using standard live streaming (RTMP/FLV/HLS). For more information, see Play a live stream.