Stream delay is different from latency caused by streaming protocols. Stream delay is a feature that lets you 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 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.
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 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.
Click .
On the Stream Delay Settings tab, click Add to configure a stream delay template.
The following table describes the parameters of a stream delay template.
Parameter
Description
Application Name
The application name. The value must match the AppName in the ingest URL for the template to take effect. The value is case-sensitive. If you specify an asterisk (
*), all application names are matched.Stream Name
The live stream name. The value must match the StreamName in the ingest URL for the template to take effect. The value is case-sensitive. If you specify an asterisk (
*), all stream names are matched.Delay
The duration for which the playback of the live stream is delayed.
Valid values: 16 to 3600.
Unit: seconds.
Triggered By
Ingest Parameters: Stream delay is triggered only when the ingest URL contains the
alDelayTimeparameter.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.
Stream Ingest Parameter Trigger > Configuration Trigger: You can use both the stream ingest parameter trigger and the configuration trigger. The stream ingest parameter trigger has a higher priority than the configuration trigger.
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 with no authentication:
Ingest domain + AppName (application) + StreamName (live stream) + alDelayTime=xx, wherealDelayTimeis the delay parameter, and xx indicates the delay duration in seconds. Example:rtmp://demo.aliyundoc.com/app/stream?alDelayTime=100Ingest URL with authentication:
Ingest domain + AppName + StreamName + Access token + alDelayTime=xx(alDelayTimeis the delay parameter, where xx indicates the delay in seconds), Example:rtmp://demo.aliyundoc.com/app/stream?auth_key=1678354414-0-0-c4789ecbd37a23a20ad2e9973301dae9&alDelayTime=100Generation time of the delayed stream: After the delay period is reached after the source stream is ingested, you can view whether the delayed stream is generated by checking the stream list in the ApsaraVideo Live console. If the source stream is interrupted within the delay period, the generation time of the delayed stream may be reset and recounted from the beginning.
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. |