All Products
Search
Document Center

ApsaraVideo Live:Configure stream delay

Last Updated:Jan 10, 2024

Stream delay is different from latency caused by streaming protocols. Stream delay is a feature that allows you to delay the playback of a live stream that is processed in the cloud. This topic describes how to configure stream delay.

Limits

  • A delayed stream is counted as a source stream. If the upper limit of source streams is exceeded, the excess source streams are disconnected by the server. You can view the usage on the Basic Information tab of the Basic Settings page for a streaming domain. For information about how to increase the quota of source streams, see Quota management.

  • Stream delay is available only in the China (Beijing) and China (Shanghai) regions.

Procedure

  1. Log on to the ApsaraVideo Live console.
  2. In the left-side navigation pane, click Domains to go to the Domain Management page.
  3. Find the streaming domain that you want to configure and click Domain Settings in the Actions column.

    001

  4. Choose Templates > Stream Delay Settings.

  5. Click Add to add a stream delay template.

    The following table describes the parameters of a stream delay template.

    Parameter

    Description

    AppName

    The name of the application. The value must be the same as the application name specified in the ingest URL for the template to take effect. The value is case-sensitive. If you specify an asterisk (*) as the value, all application names are matched.

    StreamName

    The name of the live stream. The value must be the same as the stream name specified in the ingest URL for the template to take effect. The value is case-sensitive. If you specify an asterisk (*) as the value, all stream names are matched.

    Delay

    The duration for which the playback of the live stream is delayed.

    • Valid values: 15 to 310.

    • Unit: seconds.

    Triggered By

    • Ingest Parameters: Stream delay can be triggered only by specifying the alDelayTime parameter in the ingest URL.

    • Configuration: Stream delay can be triggered only by the stream delay configuration. That is, stream delay is triggered if the application name and stream name specified in the ingest URL are the same as those specified in the stream delay template.

    • Ingest Parameters > Configuration: Stream delay can be triggered by the alDelayTime parameter in the ingest URL or the stream delay configuration. The alDelayTime parameter takes precedence over the stream delay configuration.

    Note

    If you set Triggered By to Ingest Parameters or Ingest Parameters > Configuration, you can trigger stream delay by specifying the alDelayTime parameter in the ingest URL. The following rules apply to the ingest URL:

    • Ingest URL with no access token: Ingest domain + AppName + StreamName + alDelayTime=xx, where xx indicates the delay in seconds. Example: rtmp://demo.aliyundoc.com/app/stream?alDelayTime=100

    • Ingest URL with an access token: Ingest domain + AppName + StreamName + Access token + alDelayTime=xx, where xx indicates the delay in seconds. Example: rtmp://demo.aliyundoc.com/app/stream?auth_key=1678354414-0-0-c4789ecbd37a23a20ad2e9973301dae9&alDelayTime=100

    Note
    • The application name or stream name can be up to 255 characters in length and can contain digits, letters, hyphens (-), underscores (_), and equal signs (=).

    • After the configuration is complete, you can use a URL for delayed streaming to play the delayed stream. For more information about how to obtain the URL, see Generate ingest and streaming URLs.

  6. Click OK.

Related API operations

CreateLiveDelayConfig

Adds a stream delay configuration.

UpdateLiveDelayConfig

Updates a stream delay configuration.

DeleteLiveDelayConfig

Deletes a stream delay configuration.