All Products
Search
Document Center

ApsaraVideo Live:Manage applications

Last Updated:Aug 30, 2023

With the interactive streaming feature, you can create an interactive streaming application to implement capabilities such as calling, voice chat, and conferencing. This topic describes how to create an interactive streaming application.

Create an interactive streaming application

  1. Log on to the ApsaraVideo Live console.

  2. In the left-side navigation pane, choose Interactive Streaming > Applications.

  3. Click Create Application.

  4. On the page that appears, specify the Instance Name parameter, tick Terms of Service, and click Buy Now.

    After the application is created, refresh the Applications page to view the application.

    Note

    You are charged for co-streaming based on the pay-as-you-go billing method. No fees are incurred when you create an application.

Configure stream relay

  1. Log on to the ApsaraVideo Live console.

  2. In the left-side navigation pane, choose Interactive Streaming > Applications. On the Applications page, find the application that you want to manage and click Manage in the Actions column.

  3. Click Stream Relay. You can use one of the following methods to configure stream relay:

    1. Method 1: Specify streams to relay

      You can call API operations on the server side to configure stream relay for a specific channel in real time. This way, the streams can be relayed to ApsaraVideo Live or a third-party platform. This requires a small amount of development on the server side.

    2. Method 2: Configure global stream relay to ApsaraVideo Live

      After you enable the stream relay feature, audio and video streams are relayed to the origin server of ApsaraVideo Live. You can configure features such as transcoding, recording, and snapshot based on streaming domains. You can also pull live streams to watch.

      1. Turn on Stream Relay.

      2. Configure the stream relay parameters.

        Parameter

        Configuration

        Description

        Stream Relay

        Select an option.

        After you enable single-stream relay, all audio and video streams are relayed to ApsaraVideo Live by default. You can still update the layout of a mixed stream by using the SDK or server API.

        Streaming Domain

        Example: play.example.com

        The streaming domain that is relayed for standard streaming. You can play live streams, configure transcoding and recording settings, and perform other operations based on the streaming domain.

        Note
        • If you do not have a streaming domain, add one on the Domain Management page.

        • Do not enable RTS 2.0 for the streaming domain. Otherwise, stream relay fails.

        AppName

        The name can be up to 255 characters in length and can contain digits, letters, hyphens (-), underscores (_), and equal signs (=).

        Default value: live. You can specify a custom value.

        The application name in the streaming URL after stream relay. For more information, see Ingest and streaming URLs.

        Note

        If you need to configure templates such as transcoding, recording, and snapshot templates for the relayed stream, you must specify an application name that is the same as the application name specified in the templates for them to take effect.

        SEI Insertion

        • Insert SEI at Regular Intervals: This option lets you insert supplemental enhancement information (SEI) at a specified interval from 1,000 to 5,000 ms.

        • Insert SEI in I-frames: This option lets you insert SEI in I-frames of a video stream.

        SEI: You can use SEI to insert basic user information such as the UID and mixed-stream layout parameters into streams. This way, in co-streaming scenarios, when the layout for stream mixing and relay changes, the application which viewers use to watch streams can parse the layout information from SEI in real time. This helps facilitate the adjustment of interaction styles. For more information, see SEI format.

        Note
        • If no streaming domain exists on the Domain Management page, you need to add a domain name. For more information, see Add a domain name.

        • Do not enable RTS 2.0 for the streaming domain. Otherwise, relayed stream pulling fails.

SEI format

Data type

Parameter

Description

Video stream information

stream

The information about the streamer.

uid: the user ID of the streamer.

The layout information of the area where the streamer is streaming. Take note of the following layout parameters:

  • paneid: the sequence number of the pane. Valid values: [0,8].

  • zorder: the layer of the area. Valid values: [0,99].

  • x: the x coordinate of the area in the canvas. The value is normalized.

  • y: the y coordinate of the area in the canvas. The value is normalized.

  • w: the width of the area. The value is normalized.

  • h: the height of the area. The value is normalized.

  • vol: the volume of the streamer. Unit: dB. Valid values: [0,255].

  • vad: detects human voice. Valid values: [0,150]. 150 indicates that human voice is detected and a value other than 150 indicates the period of time during which the volume of human voice decreases to 0.

Note

If the stream of a user with UID 111 and the stream of a user with UID 222 are mixed, the following sample code provides an example of the SEI message:

{"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}]}