ApsaraVideo Live offers a cloud-based stream mixing service. You can call OpenAPI operations to pull multiple video sources to a stream mixing server in the live center. The service uses powerful cloud processing to combine the sources into a single stream based on your layout. This combined stream is then delivered to viewers with edge acceleration. This topic describes the features and usage of cloud-based stream mixing.
Limits
Cloud-based stream mixing is a paid feature. It is currently in public preview and is free to use. After the public preview ends, standard fees will apply. The specific date will be announced later.
The maximum number of concurrent stream mixing tasks for each UID is 10. To increase this limit, submit a ticket. For more information, see Contact us.
For a list of live centers that support cloud-based stream mixing, see Service regions.
Scenarios
E-sports live streaming: During an e-sports event, you often need to show a close-up of a player in a specific area of the screen. You can push the main game stream and the player's camera feed to the live center to be mixed. Viewers then see the combined stream.
Monitoring scenarios: Surveillance cameras are usually installed in different locations. To display feeds from multiple cameras on a single screen in a control room, you can use cloud-based stream mixing. Push the streams from multiple cameras to the live center to be mixed and displayed.
Features
Feature |
Description |
Details |
Multi-stream mixing |
Push multiple video sources to the live center to be mixed into a single live stream. |
|
Preset layouts |
Provides preset layouts for the combined live stream to suit different scenarios. |
Provides seven preset layouts. For more information, see Preset layout reference. |
Custom layouts |
You can add custom layouts for the combined live stream as needed. |
Supports setting the number, size, and position of panes. |
Stream mixing output |
Outputs the mixed video sources as a single live stream. |
Supports custom output domain names for stream mixing. You can use the domain name to watch the mixed content. |
Query stream mixing tasks |
Query the list of current stream mixing tasks and their configurations. |
Supports real-time queries. |
Merge updates |
Update video sources or layouts during playback with seamless switching. |
Does not support updating the output resolution or other similar settings. |
Automatic deletion |
Automatically delete stream mixing tasks. |
Supports setting an automatic deletion time when you create a task. The task is automatically deleted at the specified time to conserve traffic. The default time is 7 days.
Important
You cannot modify a stream mix once it is created. |
Stream mixing callbacks |
Provides callbacks for the status of stream mixing tasks. |
When you create a stream mixing task, the service can send a message to your webhook address indicating whether the task was created successfully. This lets you promptly receive the result. |
Usage
ApsaraVideo Live lets you use the cloud-based stream mixing service by calling API operations. These operations include creating, updating, querying, and deleting stream mixing tasks. The API call sequence is as follows:
You can run these API operations directly in OpenAPI Explorer, which avoids the need to calculate signatures. After a successful call, OpenAPI Explorer automatically generates sample code for the software development kit (SDK). For SDKs in more languages, see ApsaraVideo Live SDKs.
For specific methods and parameters, see the following API documentation:
Scenario |
Description |
Interface |
Create a stream mixing task (preset layout) |
Create a stream mixing task using a preset layout template. The following figure shows an example that uses the MixStreamLayout-2-1 template: |
|
Create a stream mixing task (custom layout) |
Create a stream mixing task using a custom layout. The following figure shows an example with two input streams: |
|
Updating a stream join |
Update the video sources or layout of a stream mixing task. |
Pass the input source configuration (number, type, address, stacking order, size, position, and fill mode).
Note
The parameters for UpdateMixStream represent a complete configuration. When you call this operation, you must pass the entire updated configuration. For example, if a task is mixing four video sources (A, B, C, and D) and you want to remove sources C and D, you must call UpdateMixStream and pass the configurations for only sources A and B. |
Querying merged streams |
Query the list of active stream mixing tasks and their configurations. |
|
Delete a stream mixing task |
When you no longer need a mixed stream, delete the task. Otherwise, the stream continues to be output. |
Preset layout reference
Cloud-based stream mixing provides seven preset layouts for different live streaming scenarios. To use a preset layout, pass the corresponding layout ID. No extra configuration is required.
FAQ
What is the difference between cloud-based stream mixing and local stream mixing?
In cloud-based stream mixing, clients push multiple streams to the live center to be mixed in the cloud. This process uses multiple input streams to produce one output stream. In local stream mixing, multiple streams are mixed into a single stream on a local device before being pushed to the live center. From the live center's perspective, this process uses one input stream to produce one output stream.
Use cloud-based stream mixing when you need to mix streams from different clients. Use local stream mixing when you need to mix streams from different sources on a single client, such as a screen and a camera. For more information about local stream mixing, see Features of Push SDK for Android.














