Cloud-based composition and relay

更新时间:
复制 MD 格式

ApsaraVideo Real-time Communication (ARTC) can compose multiple audio and video streams and relay the composed stream to ApsaraVideo Live or third-party live streaming platforms for audiences to watch.

Use cases

The cloud-based stream composition and relay service mixes ARTC streams from the client side and relays the composed stream to the Global Realtime Transport Network (GRTN) of ApsaraVideo Live for live viewers. This service is used in ARTC scenarios such as the following:

  • Multi-host streaming: The viewers enter the live channel to watch the stream and are promoted to the stage to interact with the host.

  • Chat room: Listeners join an audio room to listen and participate in group voice chat.

  • Record and review audio and video content during multi-host streaming and audio chats.

Enable stream composition and relay

You can enable the composition and relay service in the following ways:

Global stream relay

When global stream relay is enabled, the stream of each host in the live channel is automatically pushed to GRTN. This method is suitable for interactive live streaming, content review, and recording.

image

Procedure:

  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.

        Playback domain name

        Example: play.example.com

        The playback domain name 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 playback domain name, go to the Domain Names console to add one.

        • Playback domain names 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 playback domain name in the Domain Names console, you must first add one. For more information, see Add a domain name.

Server-side API calls for composition and relay

  1. When the host starts streaming, the server calls the StartLiveMPUTask API to start stream relay.

  2. When a guest goes on stage for multi-host streaming, the server calls the UpdateLiveMPUTask API to compose and relay the streams.

image

For more information about guest spot mode of multi-host streaming, see Guest spot mode.

For more information about VS mode of multi-host streaming, see Live battle.