ApsaraVideo Live supports stream ingest over the Secure Reliable Transport (SRT) protocol. SRT is a reliable alternative to the Real-Time Messaging Protocol (RTMP) for cross-border stream ingest in weak network environments. RTMP runs over TCP and is prone to congestion and stuttering on cross-border links with high latency and packet loss. SRT runs over UDP and provides automatic repeat request (ARQ)-based packet loss recovery and adaptive bitrate adjustment, which delivers stronger anti-jitter and packet loss resilience than RTMP. Compared with RTMP, SRT has approximately 500 ms higher latency but offers higher stability, especially in weak network environments.
Prerequisites
You have configured and associated an ingest domain and a streaming domain. For more information, see Getting started with ApsaraVideo Live.
Enable SRT
Log on to the ApsaraVideo Live console.
In the left navigation pane, click Domain Names.
Find the streaming domain that you want to manage and click Domain Settings in the Actions column.
Click .
Click the Stream Ingest Information tab. In the Ingest Protocol section, enable the SRT Protocol switch. The switch is off by default.
SRT stream ingest and playback
SRT stream ingest
After you enable SRT, you can obtain an SRT ingest URL from the URL Generators in the console or by concatenating URL components.
SRT ingest URLs use the following formats:
Format 1 (Recommended)
srt://{domain}:1105?streamid=#!::h={domain},r=/{AppName}/{StreamName}?auth_key={access token},m=publish (Recommended)
Format 2
srt://{domain}:1105?streamid=push://{domain}/{AppName}/{StreamName}?auth_key={access token}
Custom parameter encoding rules
When the SRT ingest URL contains custom parameters, you must URL-encode the special characters to avoid parsing conflicts. Example:
srt://{domain}:1105?streamid=#!::h={domain},r=/{AppName}/{StreamName}?auth_key%3D1807696811-21613-0fa3597df7f228fbfae37020de3782b70%26sprio%3D6,m=publishSRT playback
When the SRT protocol is used for stream ingest, the supported playback protocols include RTMP, FLV, HLS, and RTS.
SRT playback is disabled by default. To use SRT playback, contact your account manager or submit a ticket. Alibaba Cloud then adds your specified streaming domain to the allowlist on the backend. You do not need to configure the server or bind an IP address.
After the streaming domain is added to the allowlist, SRT playback initially takes effect only on designated test nodes. Bind a test node and verify playback. After the verification passes, the configuration is deployed globally to all nodes.
The allowlist is processed independently for each streaming domain. Associated domains are not covered by automatic synchronization and therefore do not take effect automatically. Submit a separate request for every streaming domain that requires SRT playback.
If your business requires a lower latency of 200–400 ms, use the RTS (ARTC) protocol instead.
SRT playback URLs support two formats:
srt://{domain}:1105?streamid=#!::h={domain},r=/{AppName}/{StreamName}?auth_key={access token},m=requestsrt://{domain}:1105?streamid=pull://{domain}/{AppName}/{StreamName}?auth_key={access token}
For more information about parameters and authentication, see Generate streaming URLs.
Does the ApsaraVideo Live SRT protocol support HEVC (H.265) encoding?
SRT stream ingest supports H.264, H.265, AAC, and EAC3 encoding. SRT stream pulling (playback) currently supports only H.264 and AAC encoding and does not support HEVC (H.265).