ApsaraVideo Real-time Communication Application Management

更新时间:
复制 MD 格式

To use ApsaraVideo Real-time Communication, you must create an application to support features such as calls, chit-chat, and meetings.

Create an ApsaraVideo Real-time Communication application

  1. Log on to the ApsaraVideo Live console.

  2. In the navigation pane on the left, click Live + > ApsaraVideo Real-time Communication > Applications.

  3. Click Create Application.

  4. Select Billing Method as Pay-by-duration or Monthly 95th Percentile.

  5. Enter a custom Instance Name, accept the Terms of Service, and then click Purchase.

  6. After a success message appears, refresh the ApsaraVideo Real-time Communication > Applications page to view the co-streaming application that you created.

    Note

    Creating an application is free of charge. You are charged on a pay-as-you-go basis for your actual cloud usage. For more information, see ApsaraVideo Real-time Communication pricing.

Configure bypass stream ingest

  1. Log on to the ApsaraVideo Live console.

  2. In the navigation pane on the left, click Live + > ApsaraVideo Real-time Communication > Applications. Select the application that you want to configure and click Manage.

  3. Click Stream Relay. You can configure Stream Relay in one of the following ways:

    1. Mode 1: Relay of Specified Streams

      Call the CreateLiveMixJob (New) operation to configure real-time Stream Relay (with stream mixing) for a specific channel to ApsaraVideo Live or a third-party platform. This requires minor server-side development.

    2. Mode 2: Global Stream Relay to ApsaraVideo Live

      After you enable bypass stream ingest, audio and video streams are ingested to the origin server of the Alibaba Cloud live center. You can then use the playback domain name to configure features such as transcoding, recording, and snapshots, or pull the live stream for viewing.

      1. Turn on the Stream Relay switch.

      2. Configure the ingest parameters.

        Parameter

        Configuration options

        Description

        Stream Relay

        On or Off

        After you enable single-stream ingest, all audio and video streams are ingested to ApsaraVideo Live by default. You can still update the stream mixing layout using the software development kit (SDK) or server-side API operations.

        Streaming Domain

        Example: play.example.com

        The streaming domain for streams ingested to ApsaraVideo Live. You can use this domain name to play live streams and configure features such as transcoding and recording.

        Note
        • If you do not have a streaming domain, go to the Domain Names console to add one.

        • Streaming domains do not support Real-Time Streaming (RTS) with a latency of 400 ms to 600 ms. Using RTS will cause the ingest to fail.

        AppName

        Up to 255 characters. Supports digits, uppercase and lowercase letters, hyphens (-), underscores (_), and equal signs (=).

        The default value is "live". You can customize this value.

        The AppName in the streaming URL after ingest. For more information, see Generate streaming URLs.

        Note

        To attach transcoding, recording, or snapshot templates to the ingested stream, you must set this AppName to be the same as the AppName in the template for the template to take effect.

        SEI Insertion

        • Insert SEI at regular intervals: Inserts Supplemental Enhancement Information (SEI) frames at a specified interval. You can set the interval from 1000 ms to 5000 ms.

        • Insert SEI in I-frames: Inserts SEI in the I-frames of the video stream.

        Supplemental Enhancement Information (SEI) inserts basic user information, such as user IDs (UIDs) and stream mixing layout parameters, into the stream through the system SEI. For example, in a co-streaming scenario, when the stream mixing layout changes, the viewer's application can parse the layout information from the SEI in real time to adjust the interactive UI. For more information, see Supplemental Enhancement Information (SEI) format.

        Note

        If you do not have a streaming domain in the Domain Names console, you must first add one. For more information, see .

Supplemental Enhancement Information (SEI) format

Data type

Parameter name

Value

Video stream information

stream

Streamer information:

uid: The user ID of the streamer.

Layout information for the streamer's window area. Note the following parameters:

  • paneid: The ID of the area in the window. Valid values: [0,8].

  • zorder: The stacking level of the area. Valid values: [0,99].

  • x: The x-coordinate of the area on the canvas. A normalized percentage.

  • y: The y-coordinate of the area on the canvas. A normalized percentage.

  • w: The width of the area. A normalized percentage.

  • h: The height of the area. A normalized percentage.

  • vol: The streamer's volume in decibels. Valid values: [0,255].

  • vad: Voice activity detection (VAD). A value of 150 indicates that voice is detected. A value other than 150 indicates the trailing time from when voice is detected to when it is not.

Note

For example, if a stream mixing layout is applied to two users with UIDs 111 and 222, the SEI message is as follows:

{"stream":[{"uid":"111","paneid":0,"zorder":1,"x":0,"y":0.25,"w":0.5,"h":0.5,"type":0,"ms":0,"vol":1,"vad":119},{"uid":"222","paneid":1,"zorder":1,"x":0.5018382,"y":0.25,"w":0.5,"h":0.5,"type":0,"ms":0,"vol":60,"vad":123}]}

Callback events

ApsaraVideo Real-time Communication provides callback events for channels, users, bypass stream ingest, and stream mixing. You can configure these callback events in the console.

Introduction to callbacks

Callback events allow your business server to receive real-time status changes for channels, users, bypass stream ingest, and stream mixing:

  • Channel callbacks: Events such as a channel being created or dissolved.

  • User callbacks: Events such as a user joining or leaving a channel, switching roles, or starting or stopping stream ingest or pulling.

  • Bypass and stream mixing callbacks: Stream Relay events.

For more information about channel and user callbacks, see Subscribe to channel message callbacks. For more information about bypass and stream mixing callbacks, see Subscribe to stream mixing and ingest events.

Create a callback task

Channel and user callbacks

  1. Log on to the ApsaraVideo Live console.

  2. In the navigation pane on the left, click Live + > ApsaraVideo Real-time Communication > Applications.

  3. Find the application for which you want to create a callback task, click Manage to go to the application management page.

  4. In the navigation pane on the left, choose Callbacks > Channel and User Callbacks, and click Create Task.

  5. Set the callback parameters. The parameters are described in the following table:

    Parameter

    Description

    Callback URL

    The address of your business server that receives callback messages. HTTP and HTTPS are supported. We recommend that you use HTTPS.

    Event Scope

    Callback events include User events and Channel events.

    • User events include the following:

      • Join channel

      • Start screen sharing

      • Leave

      • Stop video ingest

      • Switch role

      • Stop audio ingest

      • Start video ingest

      • Stop screen sharing

      • Start audio ingest

    • Channel events include the following:

      • Channel started

      • Channel ended

    Specified Channel

    Optional. If you do not specify a channel, callbacks are generated for events in all channels by default. If you specify a channel, callbacks are generated only for events in that channel.

    Specified User

    Optional. This parameter applies only to user events. If you specify a user ID, you must also specify a channel ID. You can enter up to 20 user IDs, separated by commas (,).

  6. Click OK to create the task.

Bypass and stream mixing callbacks

  1. Log on to the ApsaraVideo Live console.

  2. In the navigation pane on the left, click Live + > ApsaraVideo Real-time Communication > Applications.

  3. Find the application for which you want to create a callback task and click Manage.

  4. In the navigation pane on the left, choose Callbacks > Mixed-stream Relay Callbacks, and click Configure.

  5. Set the callback parameters. The parameters are described in the following table:

    Parameter

    Description

    Webhook address

    The address of your business server that receives callback messages. HTTP and HTTPS are supported. We recommend that you use HTTPS.

    Channel scope

    Optional. Specify the channels (ChannelIDs) from which you want to receive callbacks. You can specify up to 20 channels. Separate multiple IDs with commas (,). Each channel ID can contain uppercase letters, lowercase letters, digits, underscores (_), and hyphens (-). The maximum length is 64 characters. If you leave this blank, you will receive callbacks from all channels by default.

Edit and delete callback records

Channel and user callbacks

After you create a channel and user callback task, you can update or delete the task.

  1. Go to the Channel and User Callbacks page and find the task that you want to update or delete.

  2. In the Actions column, click Edit to modify the task or Delete to delete the task.

Bypass and stream mixing callbacks

After you configure bypass and stream mixing callbacks, you can modify or delete the configuration.

After the relay and mixing callback task is configured, the status shows Configured. You can manage the callback task through Modify Configuration, Delete, and Callback Example operations. The page also displays the configured callback URL and channel scope (such as All Channels).

View callback records

After a callback task becomes active, you can view the details of callback events in the callback records.

Callback records retain the callback success or failure data of the last 7 days. You can filter records by time range (Today, Last 3 Days, Last 7 Days, Custom) and Callback ID. Records contain the following fields:

  • Callback ID

  • Callback Time

  • Callback Content

  • Callback URL

  • Request Result

Click the Callback Records tab to filter records by time range (Today, Last 3 Days, Last 7 Days, or Custom) and view the Callback Time, Callback Content, Callback URL, and Request Result.