All Products
Search
Document Center

ApsaraVideo Live:SetLiveStreamDelayConfig

Last Updated:Dec 16, 2025

Configures the live streaming latency.

Operation description

  • You can call this operation to configure the live streaming latency for a streaming domain.

  • The server-side cache stores an integer number of Groups of Pictures (GOPs). Therefore, the latency cannot be less than the GOP size. The actual latency depends on the GOP size. For example, if you set RtmpDelay to 4 seconds and the GOP size is 2 seconds, the minimum latency is 2 seconds (4 seconds - 2 seconds) and the maximum latency is 6 seconds (4 seconds + 2 seconds). If the GOP size is greater than the value of RtmpDelay, for example, if the GOP size is 5 seconds and RtmpDelay is 4 seconds, the latency fluctuates between 0 and 9 seconds.

  • Latency settings do not apply to audio-only streams. For these streams, the default latency is near zero.

  • For HTTP Live Streaming (HLS), the segment size is calculated by dividing the delay by 3 and rounding down. The minimum segment size is 1 second. The system then calculates the maximum number of segments. If the segment size is 3 seconds or more, the maximum number of segments is 4. Otherwise, the maximum is 6.

  • The actual HLS segment size cannot be smaller than the GOP size.

  • The HLS latency is calculated as: configured segment size × 3.

  • If you do not call this operation, the default latency applies. The default latency is 2 seconds for Real-Time Messaging Protocol (RTMP) streams and 4 seconds for Flash Video (FLV) streams. For HLS streams, the default segment size is 5 seconds. This results in a latency of 15 seconds and a maximum of 6 segments.

QPS limit

The queries per second (QPS) limit for a single user is 1,000. If you exceed this limit, the system triggers throttling, which can affect your business. Call this operation based on your business needs.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

live:SetLiveStreamDelayConfig

update

*Domain

acs:cdn:*:{#accountId}:domain/{#DomainName}

None None

Request parameters

Parameter

Type

Required

Description

Example

DomainName

string

Yes

example.com

HlsDelay

integer

No

The streaming domain.

4

HlsLevel

string

No

The delay for HTTP Live Streaming (HLS) playback, in seconds.

Note

If this parameter is empty, the delay is set based on the HlsLevel parameter.

short

FlvDelay

integer

No

The HLS latency level. This parameter is ignored if HlsDelay is configured.

Valid values:

  • short (default): A latency of 3 seconds.

  • medium: A latency of 6 seconds.

  • long: A latency of 15 seconds.

Note

If both the HlsDelay and HlsLevel parameters are empty, the default value short is used.

8

FlvLevel

string

No

The delay for FLV playback, in seconds.

Note

If this parameter is empty, the delay is determined by the FlvLevel parameter.

medium

RtmpDelay

integer

No

The latency level for FLV playback. This parameter is ignored if the FlvDelay parameter is set.

Valid values:

  • short (default): A latency of 2 seconds.

  • medium: A latency of 4 seconds.

  • long: A latency greater than 4 seconds.

Note

If both the FlvDelay and FlvLevel parameters are empty, the default value short is used.

4

RtmpLevel

string

No

The RTMP playback delay in seconds.

Note

If this parameter is empty, the delay is determined by RtmpLevel.

short

Response elements

Element

Type

Description

Example

object

RequestId

string

The ID of the request.

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.