All Products
Search
Document Center

ApsaraVideo Live:Configure callback settings

Last Updated:Dec 12, 2023

ApsaraVideo Live provides callbacks for stream ingest status, live stream recording, live stream snapshot, and automated review. This topic describes how to configure these callbacks in the ApsaraVideo Live console.

Overview

When an event is triggered during live streaming, Alibaba Cloud sends a request to your server and your server then responds to the request. After the request passes verification, a callback message that contains JSON-formatted data is returned to you.

ApsaraVideo Live supports callbacks for events such as stream ingest status, live stream recording (on-demand recording), live stream snapshot, and automated review (video moderation and audio moderation). For information about the callback parameters and examples for different callback events, see Manage callbacks.

Callback methods

ApsaraVideo Live supports event notifications by using HTTP and HTTPS callbacks. You must deploy an HTTP service to receive callback messages and specify a callback URL by using the ApsaraVideo Live console or calling an API operation.

  • When stream ingest is initiated or interrupted, ApsaraVideo Live sends an HTTP GET request to the specified callback URL. The specific event content is included in the URL parameters.

  • When other events are triggered, ApsaraVideo Live sends an HTTP POST request to the specified callback URL. The specific event content is included in the JSON-formatted request body.

Usage notes

  • A callback URL requires no identifier but must be accessible. If no response is returned from the URL within a specific timeout period, ApsaraVideo Live performs retries to access the URL. The current timeout period is 5 seconds. If no response is returned within 5 seconds, ApsaraVideo Live performs retries to access the URL for a maximum of five times at an interval of 1 second.

  • You can configure and modify stream ingest callbacks for only ingest domains. You can configure and modify recording callbacks, snapshot callbacks, video moderation callbacks, and audio moderation callbacks for only streaming domains.

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 Streaming Management > Callbacks. You can configure recording callbacks, snapshot callbacks, video moderation callbacks, and audio moderation callbacks for the streaming domain.

    • Stream ingest callbacks

      If the domain name is a streaming domain, you cannot configure stream ingest callbacks. Stream ingest callbacks are valid for only ingest domains. For more information, see Stream ingest callbacks.

    • Recording callbacks

      Note

      You can also call the AddLiveRecordNotifyConfig operation to configure recording callbacks for a domain name. For more information, see AddLiveRecordNotifyConfig. For information about the callback methods and parameters, see Callbacks for live stream recording.

      1. Turn on Recording Callbacks.

      2. Configure callback parameters.

        Parameter

        Description

        Callback URL

        The callback URL is a URL of your own. When a recording event occurs, ApsaraVideo Live sends an HTTP POST request to this URL. The specific content is delivered by using a JSON body.

        Triggering Event

        • File Generation: A callback is fired when a recording file is generated.

        • File Generation and Recording Status: A callback is fired when a recording file is generated or when recording starts, pauses, or resumes.

        On-demand Callback URL

        If on-demand recording is configured, ApsaraVideo Live sends an HTTP callback to the specified on-demand callback URL when you start to ingest a live stream. The response to the callback determines whether to record the live stream. By default, the value of this parameter is *, which specifies that on-demand recording is disabled.

        Note

        Before you specify an on-demand callback URL, you need to call the AddLiveAppRecordConfig operation to configure a recording rule. In the rule, the OnDemand parameter is set to 1, which indicates that on-demand recording is enabled by using the HTTP callback method.

      3. Click OK.

    • Snapshot callbacks

      Note

      You can also call the AddLiveSnapshotNotifyConfig operation to configure snapshot callbacks for a domain name. For more information, see AddLiveSnapshotNotifyConfig. For information about the callback methods and parameters, see Callbacks for live stream snapshot.

      1. Turn on Snapshot Callbacks.

      2. Configure callback parameters.

        Parameter

        Description

        Callback URL

        The callback URL is a URL of your own. When a snapshot event occurs, ApsaraVideo Live sends an HTTP POST request to this URL. The specific content is delivered by using a JSON body.

        Callback Authentication

        Specifies whether to enable authentication for the callback URL. To enable authentication, turn on the switch and specify Authentication Key.

    • Video moderation callbacks

      Note
      • You can also call the AddLiveDetectNotifyConfig operation to configure video moderation callbacks. For more information, see AddLiveDetectNotifyConfig. For information about the callback methods and parameters, see Callbacks for automated review.

      • Only some live centers support the automated review feature. For more information, see Supported regions.

      • Video moderation callback notifications are returned for only videos that are in question. The notification content includes the moderation information and storage information of relevant video snapshots. You can view the callback information on your callback server. For more information about the format and examples of the callback information, see Callbacks for automated review.

      • Search for the identified violations in OSS. You can search for specific violations in the OSS console based on the moderation callback information.

        • Search for specific violations based on the application name and stream name.

        • Search for specific violations based on the stream ingest date.

      1. Turn on Video Moderation Callbacks.

      2. Specify the callback URL.

        The callback URL is a URL of your own. When a video moderation event occurs, ApsaraVideo Live sends an HTTP POST request to this URL. The specific content is delivered by using a JSON body.

      3. Click OK.

    • Audio moderation callbacks

      Note
      • You can also call the AddLiveAudioAuditNotifyConfig operation to configure audio moderation callbacks. For more information, see AddLiveAudioAuditNotifyConfig. For information about the callback methods and parameters, see Callbacks for automated review.

      • Audio moderation callback notifications are returned for only audio that is in question. The notification content includes the text information of the audio and the context in the last 1 minute. You can view the callback information on your callback server. For more information about the format and examples of the callback information, see Callbacks for automated review.

      • Search for the identified violations in OSS. You can search for specific violations in the OSS console based on the moderation callback information.

        • Search for specific violations based on the application name and stream name.

        • Search for specific violations based on the stream ingest date.

      1. Turn on Audio Moderation Callbacks.

      2. Specify the callback URL.

        The callback URL is a URL of your own. When an audio moderation event occurs, ApsaraVideo Live sends an HTTP POST request to this URL. The specific content is delivered by using a JSON body.

      3. Click OK.