Configures the live streaming latency.
Operation description
-
You can call this operation to configure the latency of a streaming domain.
-
Because an integer number of groups of pictures (GOPs) are cached, the latency is not less than the GOP size. The actual latency is calculated based on the GOP size. For example, if RtmpDelay is set to 4 seconds and the GOP size is 2 seconds, the minimum latency is 2 seconds (4 seconds minus 2 seconds) and the maximum latency is 6 seconds (4 seconds plus 2 seconds). If the GOP size is greater than the value of RtmpDelay, for example, the GOP size is 5 seconds and RtmpDelay is set to 4 seconds, the latency ranges from 0 to 9 seconds.
-
Configuration for the latency of an audio-only stream is invalid. By default, the latency is close to 0.
-
For HTTP Live Streaming (HLS)-based playback, the segment size equals the latency divided by 3. Round the value down to the nearest integer. The value cannot be less than 1 second. Then, calculate the maximum number of segments. If the segment size is greater than or equal to 3 seconds, the maximum number of segments is 4. Otherwise, the maximum number of segments is 6.
-
The actual HLS segment size is not smaller than the GOP size.
-
The latency of HLS-based playback equals the configured segment size multiplied by 3.
-
If you do not call this operation, the default latency is 2 seconds for Real-Time Messaging Protocol (RTMP)-based playback and 4 seconds for Flash Video (FLV)-based playback. By default, the size of an HLS segment is 5 seconds. In this case, the latency is 15 seconds and the maximum number of segments is 6.
QPS limits
You can call this operation up to 1,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of this limit when calling this operation.
Try it now

RAM authorization
Action |
Access level |
Resource type |
Condition key |
Dependent action |
live:SetLiveStreamDelayConfig |
update |
*Domain
|
None | None |
Request parameters
Parameter |
Type |
Required |
Description |
Example |
DomainName |
string |
Yes |
The streaming domain. |
example.com |
HlsDelay |
integer |
No |
The latency of HLS-based playback. Unit: seconds. Note
If this parameter is empty, the latency is set based on the HlsLevel parameter. |
4 |
HlsLevel |
string |
No |
The latency level of HLS-based playback. Ignore this parameter if the HlsDelay parameter is configured. Valid values:
Note
If both the HlsDelay and HlsLevel parameters are empty, the default value short is used. |
short |
FlvDelay |
integer |
No |
The latency of FLV-based playback. Unit: seconds. Note
If this parameter is empty, the latency is set based on the FlvLevel parameter. |
8 |
FlvLevel |
string |
No |
The latency level of FLV-based playback. Ignore this parameter if the FlvDelay parameter is configured. Valid values:
Note
If both the FlvDelay and FlvLevel parameters are empty, the default value short is used. |
medium |
RtmpDelay |
integer |
No |
The latency of RTMP-based playback. Unit: seconds. Note
If this parameter is empty, the latency is set based on the RtmpLevel parameter. |
4 |
RtmpLevel |
string |
No |
The latency level of RTMP-based playback. Ignore this parameter if the RtmpDelay parameter is configured. Valid values:
Note
If both the RtmpDelay and RtmpLevel parameters are empty, the default value short is used. |
short |
Response parameters
Parameter |
Type |
Description |
Example |
object |
|||
RequestId |
string |
The request ID. |
4C747C97-7ECD-4C61-8A92-67AD806331FF |
Examples
Success response
JSON
format
{
"RequestId": "4C747C97-7ECD-4C61-8A92-67AD806331FF"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.