Standard live streaming typically has 3 to 6 seconds of end-to-end latency. Real-Time Streaming (RTS) reduces this to the millisecond level and improves resistance to packet loss. Use RTS for scenarios that demand low latency and high interactivity, such as e-commerce live streaming, online education, live sports, and live shows.
This guide walks you through activating ApsaraVideo Live, configuring domains, enabling RTS, and testing your first stream.
Key concepts
Term | Description |
Ingest domain | The domain that receives your live stream from the encoder or Push SDK. |
Streaming domain | The domain that delivers your live stream to viewers. |
AppName | The application-level path segment in your ingest and streaming URLs (for example, |
StreamName | The unique identifier for a specific live stream within an AppName. |
Live center | A region-specific processing hub for cloud features such as transcoding, recording, snapshot capture, and production studio. |
ApsaraVideo Real-Time Communication (ARTC) | The Alibaba Cloud protocol for RTS, built on Web Real-Time Communication (WebRTC). |
Prerequisites
Before you begin, make sure that you have:
An ingest domain and a streaming domain
A completed Internet Content Provider (ICP) filing for your domain names (if serving within the Chinese mainland)
ICP filing is not required if your live center is outside the Chinese mainland and the acceleration region is set to Outside Chinese Mainland.
If your ingest and streaming domains are subdomains under the same primary domain, only the primary domain needs an ICP filing.
Choose a latency mode
RTS offers two latency modes. Select the mode that matches your use case before you proceed with configuration.
Feature | Sub-second | Half-second |
End-to-end latency | 400 to 800 ms | 200 to 400 ms |
Protocol | ARTC (based on WebRTC) | ARTC (based on WebRTC) |
Standard live streaming compatibility | Yes. Supports RTMP ingest, origin fetch, and playback over RTMP, FLV, and HLS. | No. ARTC only. |
Ingest tools | Common tools. Recommended: ApsaraVideo Live Push SDK | WHIP with OBS Studio, ApsaraVideo Live Push SDK |
Playback tools | Common players. Recommended: ApsaraVideo Player SDK | ApsaraVideo Player SDK only |
Cloud features (transcoding, recording) | Supported | Not supported (use stream relay to another domain) |
Best for | Low-latency streaming with protocol flexibility | Ultra-low-latency streaming where every millisecond counts |
In half-second mode, the streaming domain does not support cloud features such as transcoding and recording. To use these features, configure a stream relay to forward the live stream to a separate streaming domain.
Avoid unnecessary transcoding fees
When viewers use the Web SDK for sub-second playback, native WebRTC does not support B-frames and requires Opus audio encoding. The system handles codec mismatches automatically, but this triggers transcoding fees:
Ingested stream | Automatic action | Fee |
Contains B-frames + AAC audio | Video transcoding (removes B-frames) + audio transcoding (AAC to Opus) | Standard video transcoding fees based on source resolution |
No B-frames + AAC audio | Audio transcoding (AAC to Opus) | Audio-only transcoding fees |
Already optimized (no B-frames + Opus) | None | No extra fees |
To avoid these fees, disable B-frames in your encoder settings and use Opus audio encoding. Alternatively, use the Native SDK for playback, which natively supports B-frames and AAC without triggering transcoding.
If you also configure a live stream transcoding template, those fees apply in addition to the automatic codec conversion fees.
For pricing details, see Billing of live transcoding.
Step 1: Activate ApsaraVideo Live
Log on to the ApsaraVideo Live console.
Click Activate Now. Select Pay-by-traffic as the metering method. Read and agree to the ApsaraVideo Live Terms of Service.
Click Activate Now.
For a video walkthrough, see Activate ApsaraVideo Live.
Step 2: Add an ingest domain and a streaming domain
Prepare domain names
Register a domain name if you do not have one. See Register a domain name.
Apply for an ICP filing if you plan to serve within the Chinese mainland.
Tip: To try the basic features without an ICP filing, select a live center outside the Chinese mainland and set the acceleration region to Outside Chinese Mainland.
Add domain names in the console
Log on to the ApsaraVideo Live console.
In the left navigation pane, click Domain Names.
Click Add Domain Name.
On the Add Domain Name page, configure the following parameters:
Parameter
Description
Domain Type
Select Ingest Domain or Streaming Domain. This cannot be changed after creation. A domain cannot serve as both ingest and streaming.
Domain Name
Enter a subdomain such as
push.example.comorpull.example.com. Wildcard domains (for example,*.example.com) are not supported.Duplicate domain names are not allowed. If you see the error that prompts the specified domain already exists, check whether the domain is already added to another cloud service such as ApsaraVideo VOD.
You can add up to 20 domain names per account. To increase this quota when your average daily peak bandwidth exceeds 50 Mbit/s, submit a ticket.
Content served from the domain must comply with Domain name requirements.
Acceleration Region
For the ingest domain, select the acceleration region based on the host's location. For the streaming domain, select based on your audience's location.
In the following cases, ICP filing is required:
Acceleration Region is set to Chinese Mainland or Global.
Acceleration Region is set to Outside Chinese Mainland, but the selected live center is in Chinese Mainland.
For further guidance, see How do I select the acceleration region for a domain name?.
Live Center
Select a region for cloud media processing. The ingest domain and its associated streaming domain must use the same live center region. This cannot be changed after creation.
For available regions, see Supported regions. For guidance, see How do I select a live center?
When you add a domain name for the first time, ApsaraVideo Live verifies its ownership. The subdomain must belong to the same Alibaba Cloud account.
Note down the generated CNAME record for use in the next step. Repeat steps 3-5 to add the second domain (ingest or streaming).
For a video walkthrough, see Add a domain name.
Step 3: Configure CNAME records
Point your domain names to the CNAME addresses assigned by ApsaraVideo Live. The following procedure uses Alibaba Cloud DNS as an example.
Log on to Alibaba Cloud DNS.
In the navigation pane on the left, choose Public Zone.
Find the domain name that you want to configure and click Settings in the Actions column. Specify the following parameters:
Parameter
Description
Record Type
Select CNAME.
Hostname
Enter the prefix. For examples, see the following table.
Query Source
Use the default value.
Record Value
Enter the CNAME value from Step 2.
TTL
Use the default value.
Prefix
Example domain name
Description
demo
demo.aliyundoc.com
Resolve a subdomain.
@
aliyundoc.com
Resolve a root domain.
*
*.aliyundoc.com
Perform wildcard DNS resolution.
Click OK to complete the CNAME configuration.
Repeat steps 3-4 for each domain name.
Verify CNAME configuration
Use either of the following methods to verify that the CNAME record is effective:
Console verification: On the Add CNAME Record page, click CNAME Configuration Guide. In the CNAME Verification section, click Verify.
Command-line verification: Run the following command and confirm that the result matches the CNAME value in the ApsaraVideo Live console:
nslookup -type=cname <your-domain>
The CNAME verification servers are deployed in the Chinese mainland. If you configure DNS records only for regions outside the Chinese mainland, the verification servers cannot resolve the CNAME. In this case, the CNAME status shows Pending Configuration in the console, but this does not affect the acceleration service.
CNAMEs for Alibaba Cloud CDN, DCDN, ApsaraVideo Live, and ApsaraVideo VOD are intended exclusively for scheduling and resolution. Alibaba Cloud reserves the right to suspend domains and accounts that misuse CNAMEs.
Step 4: Associate the ingest domain with the streaming domain
In the left-side navigation pane, click Domain Names. Find the streaming domain and click Domain Settings in the Actions column.
Click the Stream Ingest Information tab.
Click Add Stream Ingest Information (or the Edit icon next to Ingest Domain) and select the ingest domain to associate.
For a video walkthrough, see Associate an ingest domain with a streaming domain.
Step 5: Enable RTS
Log on to the ApsaraVideo Live console.
In the left navigation pane, choose Live + > RTS.
Select the streaming domain for which you want to enable RTS.
Turn on the Enable RTS switch and select a latency mode:
Sub-second (End-to-End Latency: 400-800 ms): Compatible with standard live streaming protocols. Supports RTMP ingest, origin fetch, and playback over RTMP, FLV, and HLS.
Half-second (End-to-End Latency: 200-400 ms): ARTC only, not compatible with standard live streaming protocols.
The RTS configuration takes several minutes to deploy across the network. Wait a few minutes before testing.
Configure stream relay (half-second mode only)
In half-second mode, the streaming domain does not support cloud features such as transcoding and recording. To access these features, relay the live stream to another streaming domain:
Click Configure Stream Relay.
Select an ingest domain that is associated with a streaming domain and that does not have half-second RTS mode or dual-stream disaster recovery enabled.
For example, if the relay-receiving ingest domain is push.example.com and its associated streaming domain is pull.example.com, pull the stream from pull.example.com using standard live streaming protocols to use features such as transcoding and recording.
Additional notes
To associate one ingest domain with multiple streaming domains, see Associate primary and secondary streaming domains.
RTS and standard live streaming can share a streaming domain. However, RTS uses the UDP protocol while standard live streaming uses TCP. For best results, use a separate streaming domain for RTS.
Step 6: Generate ingest and streaming URLs
Method 1: Generate URLs in the console
After enabling RTS, click Generate URLs. Enter an AppName and a StreamName to generate ARTC protocol ingest and streaming URLs.
Method 2: Manually construct URLs
Construct URLs based on your domain names, AppName, StreamName, and (optionally) a transcoding template ID and access token. The URL format depends on whether the stream is transcoded and whether URL signing is enabled.
URL type | Format | Components |
Ingest URL |
| Ingest domain + AppName + StreamName + access token |
Streaming URL |
| Streaming domain + AppName + StreamName + access token |
Transcoded stream URL |
| Streaming domain + AppName + StreamName + transcoding template ID + access token |
Usage notes:
The AppName and StreamName must be the same in both the ingest and streaming URLs for the associated domains.
A transcoded stream URL is only generated after you configure a transcoding template. View the transcoding template ID in the console. See Live stream transcoding.
The access token (
auth_key) is an encrypted string generated by an MD5 signing algorithm. This requires URL signing to be enabled. See Components of a signed URL.When constructing URLs manually, replace the placeholders (for example,
<ingest-domain>,<access-token>) with actual values.
Step 7: Test stream ingest and playback
After enabling RTS and generating URLs, use the Try RTS tool in the console to quickly test stream ingest and playback. Ingest a stream from your camera or by sharing your screen.
The tool uses a proxy signaling domain for quick trials. When you integrate the Web SDK for production, configure an SSL certificate and the correct Access-Control-Allow-Origin response header for both the ingest and streaming domains.In addition to the console tool, Alibaba Cloud provides mobile and web demos that you can try.
SDKs for integration
Platform | References |
Mobile | |
Web |
If playback issues occur, use the troubleshooting tool to diagnose common live playback problems.
Configure an SSL certificate (optional)
Browser security policies require HTTPS for WebRTC connections. To enable RTS playback in a browser, configure an SSL certificate for both your ingest and streaming domain names. See Configure HTTPS secure acceleration.
If you use the ApsaraVideo Live Push SDK, ApsaraVideo Player SDK, or RTS demos, you do not need to configure an SSL certificate.
Configure URL signing (optional)
URL signing protects your live streams from unauthorized access. This feature is enabled by default when you add a domain name.
After enabling URL signing, you can use the default signing method or customize the Primary Key, Secondary Key, and Validity Period.
Procedure
In the left-side navigation pane, click Domain Names. Find the streaming domain with RTS enabled and click Domain Settings in the Actions column.
Choose Streaming Management > Access Control.
Click the URL Signingtab, then click Modify.
If you previously disabled URL signing, turn on the URL Signing switch first.
Configure the following parameters:
Parameter
Description
Authentication Type
ApsaraVideo Live streaming domains support only method A signing. If a URL signing error occurs, a 403 error is returned. Recalculate the signature if you receive an MD5 calculation error (for example,
X-Tengine-Error:denied by req auth: invalid md5hash=...) or a timestamp error (for example,X-Tengine-Error:denied by req auth: expired timestamp=...).Primary Key
A randomly generated key. View or change this key in Access Control > URL Signing.
Secondary Key
A custom secondary key for the signing method.
Validity Period
The time window during which a signed URL is valid. Default: 1,440 minutes (1 day) for new domains. Minimum: 1 minute, no upper limit. Active stream sessions are not interrupted when the validity period expires, but new requests fail.
For a video walkthrough, see Configure URL signing.
Verify RTS latency
Add a time calibrator URL to your stream ingest to measure RTS latency. Compare the time displayed in the stream with a standard time source.
Example using OBS Studio:
On the OBS Studio main interface, in the Sources section, add a browser source.
Enter the time calibrator URL.
Click Start Streaming.
Compare the time shown in the playback stream with the time displayed on the calibrator source.
FAQ
Do I need an ICP filing?
Not always. If your live center is outside the Chinese mainland and the acceleration region is set to Outside Chinese Mainland, no ICP filing is required. An ICP filing is required when the acceleration region is Chinese Mainland or Global, or when it is Outside Chinese Mainland but the live center is in the Chinese mainland.
Why am I being charged transcoding fees?
In sub-second mode, the Web SDK requires Opus audio and cannot decode B-frames. If your ingested stream contains B-frames or AAC audio, the system automatically transcodes the stream, which incurs transcoding fees. To avoid these fees, disable B-frames in your encoder and use Opus audio, or use the Native SDK for playback (which supports B-frames and AAC natively).
Can I use the same streaming domain for RTS and standard live streaming?
Yes, but this is not recommended. RTS uses the UDP protocol, while standard live streaming uses TCP. Using a separate streaming domain for RTS provides better isolation and simplifies troubleshooting.
What happens when a signed URL expires during a live stream?
Active stream ingest or playback sessions are not interrupted. Only new requests for stream ingest or playback fail after the validity period expires.