A live center of ApsaraVideo Live supports automatic mixing of two live streams. This feature prioritizes the playback of the content of the primary stream. If the primary stream encounters an issue, ApsaraVideo Live automatically plays the content of the secondary stream. This topic describes how to configure the primary/secondary stream mixing feature to ensure the stability of live streaming.

Limits

Primary/secondary stream mixing templates and regular stream pulling templates share the quota of source streams that can be concurrently ingested. For more information, see Limits. If the quota is reached, you cannot add any more templates. For information about how to increase the quota, see Quota management.

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 Templates > Primary/Secondary Stream Mixing Settings.
  5. Click Add to configure a primary/secondary stream mixing template.

    The following table describes the parameters of a primary/secondary stream mixing template.

    ItemParameterDescription
    Input Stream 1 (primary stream)AppNameThe name of the application that generates the primary stream. The value of this parameter must be the same as the application name that is specified in the ingest URL of the primary stream. Otherwise, the configuration does not take effect.
    StreamNameThe name of the primary stream. The value of this parameter must be the same as the stream name that is specified in the ingest URL of the primary stream. Otherwise, the configuration does not take effect.
    Input Stream 2 (secondary stream)AppNameThe name of the application that generates the secondary stream. The value of this parameter must be the same as the application name that is specified in the ingest URL of the secondary stream. Otherwise, the configuration does not take effect.
    StreamNameThe name of the secondary stream. The value of this parameter must be the same as the stream name that is specified in the ingest URL of the secondary stream. Otherwise, the configuration does not take effect.
    Output StreamAppNameThe name of the application that generates the output stream. This parameter is used to generate a streaming URL for playback.
    StreamNameThe name of the output stream. This parameter is used to generate a streaming URL for playback.
    Start Time/End TimeThe period of time during which the primary/secondary stream mixing template is valid. The interval between the start time and the end time must be within 7 days. The end time must be later than the current time.
    Note
    • The value of the AppName or StreamName parameter can be up to 255 characters in length and can contain digits, letters, hyphens (-), underscores (_), and equal signs (=). You cannot specify an asterisk (*) as the value.
    • Any two of Input Stream 1, Input Stream 2, and Output Stream cannot have the same application names and the same stream names.
  6. Click OK.

Related API operations

AddLiveStreamMergeAdds a configuration of primary/secondary stream mixing.
DeleteLiveStreamMergeDeletes a configuration of primary/secondary stream mixing.
DescribeLiveStreamMergeQueries the configurations of primary/secondary stream mixing.