Creates a stream mixing task.
Operation description
Cloud stream mixing is a paid feature. This feature is in public preview and is currently free of charge. Standard fees will apply after the public preview period. The end date of the public preview will be announced at a later date.
You can call this operation to create a stream mixing task. This operation supports both preset and custom layouts.
QPS limit
A single user can make up to 10 queries per second (QPS). Calls that exceed this limit are throttled. Throttling may affect your business operations. We recommend that you plan your calls accordingly.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
live:CreateMixStream |
create |
*Domain
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
No |
The region ID. |
cn-shanghai |
| DomainName |
string |
Yes |
The primary streaming domain. Important
Currently, only domain names in the China (Shanghai) and China (Beijing) regions are supported. |
example.com |
| LayoutId |
string |
Yes |
The layout ID. Valid values:
Note
For more information, see Preset stream mix layouts. |
MixStreamLayout-1-1 |
| InputStreamList |
string |
Yes |
The list of input streams. This is a JSON array. For more information, see InputStreamConfig below. |
[{"LayoutChildId":1,"ResourceType":"live","ResourceValue":"rtmp://example.net/live/f2139ec2b8d6a191068cd****ea9064d?auth_key=1600947017-0-0-0b5645fe35d21a65ab92b394bd4d****","LayoutConfig":{"FillMode":"fit","PositionRefer":"topLeft","FillPositionNormalized":[0,0],"FillSizeNormalized":[1,1]}}] |
| OutputConfig |
string |
Yes |
The output configuration. This is a JSON string. For more information, see OutputConfig below. |
{"AppName":"liveApp****","StreamName":"9a78fb3f5c508be0122746f677a3****","MixStreamTemplate":"lp_hd_v","ExpireDuration":"86400"} |
| CallbackConfig |
string |
No |
The webhook address. This is a JSON array. When an event occurs, the live service sends an HTTP POST request to this address. The request body contains the event details. |
{"CallbackUrl":"http://aliyundoc.com"} |
InputStreamConfig
Name | Type | Description |
ResourceType | String | The resource type. |
ResourceValue | String | The resource URL. |
LayoutChildId | String | The ID of the layout pane. This ID also determines the stacking order (z-order) of the streams. |
LayoutConfig | LayoutConfig[] | A JSON array that specifies the position, fill mode, and other layout information. |
LayoutConfig
Name | Type | Required | Description |
FillSizeNormalized | JSON array of floating-point numbers | Yes | The size of the area to fill for this layer element. |
FillPositionNormalized | Array of floating-point numbers | Yes | The normalized position of the fill area for this layer element. |
PositionRefer | String | No | The reference point for the element's position coordinates. |
FillMode | String | No | The fill mode for the element. |
OutputConfig
Name | Type | Required | Description |
AppName | String | Yes | The name of the output application. Special characters such as # and ? are not supported. |
StreamName | String | Yes | The name of the output stream. Special characters such as # and ? are not supported. |
MixStreamTemplate | String | Yes | The ID of the output stream mix template. Pass only the template ID, such as lp_ld. |
ExpireDuration | Long | No | The expiration time of the task. Unit: seconds. Valid values: 1 to 31536000 (one year). |
Response parameters
|
Parameter |
Type |
Description |
Example |
|
object |
|||
| MixStreamId |
string |
The ID of the stream mix task. Use this ID to query or delete the task. |
5b2a046e-74d7-385e-253f-8a5b87e4**** |
| RequestId |
string |
The request ID. |
0D715397-2E66-4AE1-694h-C546628AD145 |
Examples
Success response
JSON format
{
"MixStreamId": "5b2a046e-74d7-385e-253f-8a5b87e4****",
"RequestId": "0D715397-2E66-4AE1-694h-C546628AD145"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidUserId.Malformed | %s | |
| 400 | InvalidParameter.Malformed | %s | |
| 400 | MissingParameter | %s | |
| 401 | IllegalOperation | %s | |
| 500 | InternalError | %s | |
| 403 | MixStreamAlreadyExist | %s | |
| 403 | MixStreamNotExist | %s | |
| 403 | UserQuotaExceed | %s | |
| 404 | InvalidDomainName.NotFound | %s |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.