ApsaraVideo Live provides callbacks for stream ingest status, live stream recording, live stream snapshots, 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 verification is passed, 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 snapshots, 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 in the ApsaraVideo Live console or by 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-in-OSS 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.
    001
  4. Choose Streaming Management > Callbacks. You can configure recording-in-OSS 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-in-OSS 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-in-OSS Callbacks.
      2. Configure callback parameters.
        ParameterDescription
        Callback URLThe callback URL is a URL of your own. When an event related to recordings that are stored in Object Storage Service (OSS) 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.
      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 more information about the callback methods and parameters, see Callbacks for live stream snapshots.
      1. Turn on Snapshot Callbacks.
      2. Configure callback parameters.
        ParameterDescription
        Callback URLThe callback URL is a URL of your own. When an event related to snapshots occurs, ApsaraVideo Live sends an HTTP POST request to this URL. The specific content is delivered by using a JSON body.
        Callback AuthenticationSpecifies 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 automated review. 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 an event related to video moderation 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 event related to audio moderation occurs, ApsaraVideo Live sends an HTTP POST request to this URL. The specific content is delivered by using a JSON body.

      3. Click OK.