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 server disconnects the excess source streams. You can view the usage data on the Basic Information tab on the details page of a streaming domain. For information about how to increase the quota of source streams, see Quota management.
The stream delay feature is available only in the China (Beijing) and China (Shanghai) regions.
Procedure
- Log on to the ApsaraVideo Live console.
In the left-side navigation pane, click Domain Names. The Domain Management page appears.
Find the streaming domain that you want to configure and click Domain Settings in the Actions column.
In the left-side navigation tree, choose .
On the Stream Delay Settings tab, 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 set this parameter to an asterisk (
*
), the template applies to all applications.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 set this parameter to an asterisk (
*
), the template applies to all streams.Delay
The duration for which the playback of the live stream is delayed.
Valid values: 15 to 3600.
Unit: seconds.
Triggered By
Ingest Parameters: Stream delay is triggered only by specifying the
alDelayTime
parameter in the ingest URL.Configuration: Stream delay is triggered based on the stream delay configuration. If the application name and stream name in the ingest URL are the same as those specified in the stream delay template, stream delay is triggered.
Ingest Parameters > Configuration: Stream delay is triggered by the alDelayTime parameter in the ingest URL or based on the stream delay configuration. The alDelayTime parameter takes precedence over the stream delay configuration.
NoteIf 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 without an access token:
Ingest domain + AppName + StreamName + alDelayTime=xx
, wherexx
indicates the delay duration 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
, wherexx
indicates the delay duration in seconds. Example:rtmp://demo.aliyundoc.com/app/stream?auth_key=1678354414-0-0-c4789ecbd37a23a20ad2e9973301dae9&alDelayTime=100
After the source stream is ingested and reaches the configured delay duration, you can check whether the delayed stream is generated on the Stream Management page in the ApsaraVideo Live console. If the source stream is interrupted and does not reach the configured delay duration, the delayed stream is generated only when the newly ingested stream reaches the configured duration.
NoteThe 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.
Click OK.
Related API operations
Adds a stream delay configuration. | |
Updates a stream delay configuration. | |
Deletes a stream delay configuration. |