UpdateLiveMPUTask
Updates a stream mixing and relay task.
Operation description
Before you call this operation, you must call StartLiveMPUTask to create a stream mixing and relay task.
QPS limit
The QPS limit per user is 500 calls per second. If the limit is exceeded, API calls are throttled, which may affect your business. Make API calls at a reasonable rate.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
live:UpdateLiveMPUTask |
update |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| AppId |
string |
Yes |
The application ID. You can specify only one ID. The ID can contain letters, digits, underscores (_), and hyphens (-), and can be up to 64 characters in length. |
yourAppId |
| ChannelId |
string |
Yes |
The channel ID. You can specify only one ID. The ID can contain letters, digits, underscores (_), and hyphens (-), and can be up to 64 characters in length. |
yourChannelId |
| TaskId |
string |
Yes |
The task ID. You can specify only one ID. The ID can contain letters, digits, underscores (_), and hyphens (-), and can be up to 55 characters in length. This ID is the identifier for the bypass relay and must be unique. |
yourTaskId |
| MixMode |
string |
No |
The stream mixing mode. Valid values:
|
0 |
| StreamURL |
string |
No |
The live stream ingest URL. Only the RTMP protocol is supported. You can specify only one URL, and the maximum length is 2,048 characters. For information about the generation rules, see Ingest and streaming URLs. Note
|
rtmp://example.com/live/stream |
| MultiStreamURL |
array<object> |
No |
The multi-URL relay parameters. You can specify multiple live stream ingest URLs. |
|
|
object |
No |
|||
| URL |
string |
No |
The live stream ingest URL. Only the RTMP protocol is supported, and the maximum length is 2,048 characters. For information about the generation rules, see Ingest and streaming URLs. |
rtmp://example.com/live/stream**** |
| IsAliCdn |
boolean |
No |
Specifies whether to relay the stream to Alibaba Cloud CDN. Valid values:
Note
The default value of this parameter is false. |
false |
| SingleSubParams |
object |
No |
The single-stream relay parameters. This parameter is required when MixMode is set to 0. |
|
| SourceType |
string |
No |
The type of the video input stream in single-stream relay mode. This parameter is valid only for video streams (StreamType=2). Valid values:
|
camera |
| StreamType |
string |
No |
The type of the stream to be relayed in single-stream relay mode. Valid values:
|
0 |
| UserId |
string |
Yes |
The ID of the user whose stream is relayed. Only one stream can be relayed at a time. |
yourSubUserId |
| TranscodeParams |
object |
No |
The stream mixing, transcoding, and relay parameters. This parameter is required when MixMode is set to 1. |
|
| Background |
object |
No |
The global background image for stream mixing. |
|
| RenderMode |
string |
No |
The display mode for the sub-picture output. Valid values:
|
1 |
| URL |
string |
No |
The URL of the global background image. |
yourImageUrl |
| EncodeParams |
object |
No |
The encoding parameters for the relay output. |
|
| AudioOnly |
string |
No |
Specifies whether the stream is audio-only. Valid values:
|
false |
| AudioBitrate |
string |
No |
The audio bitrate. Valid values: [8, 500]. Unit: kbps. |
128 |
| AudioChannels |
string |
No |
The number of audio channels. Valid values: 1 and 2. |
2 |
| AudioSampleRate |
string |
No |
The audio sampling rate. Valid values: 8000, 16000, 32000, 44100, and 48000. Unit: Hz. |
44100 |
| VideoCodec |
string |
No |
The video encoding format. Valid values:
|
H.264 |
| VideoBitrate |
string |
No |
The video bitrate. Valid values: [1, 10000]. Unit: kbps. |
3500 |
| VideoFramerate |
string |
No |
The video frame rate. Valid values: [1, 60]. Unit: FPS. |
25 |
| VideoGop |
string |
No |
The video GOP. Valid values: [1, 60]. |
20 |
| VideoHeight |
string |
No |
The video height. Valid values: [0, 1920]. Unit: pixels. |
1000 |
| VideoWidth |
string |
No |
The video width. Valid values: [0, 1920]. Unit: pixels. |
1920 |
| EnhancedParam |
string |
No |
The enhanced encoding parameters. The value is a JSON string. The supported optional configurations include profile and preset.
Note
For example, superfast is mainly used in real-time communication. Do not configure this option unless you are a professional encoder technician. |
{"profile": "high", "preset": "veryfast"} |
| Layout |
object |
No |
The video layout information. Note
Video transcoding a video, you must specify the video layout information, including the layout coordinates (X and Y), layout pane (Width and Height), and stacking order (ZOrder). Video transcoding audio only, do not specify the video layout information. |
|
| UserPanes |
array<object> |
No |
The user pane information for stream mixing. |
|
|
array<object> |
No |
The user pane information for stream mixing. |
||
| UserInfo |
object |
No |
The stream mixing user information corresponding to this pane. If this parameter is not specified, the backend automatically fills it based on the order in which upstream streamers join the channel. Note
|
|
| SourceType |
string |
No |
The type of the video input stream in stream mixing and transcoding mode. This parameter is valid only for video streams (StreamType=2). Valid values:
|
camera |
| ChannelId |
string |
No |
The ID of the channel to which the stream mixing user belongs. This parameter is optional for users mixing streams within the same channel, but is recommended for cross-channel stream mixing. |
yourChannelId |
| UserId |
string |
No |
The ID of the stream mixing user. |
yourSubUserId |
| Height |
string |
No |
The height of the pane. The value is a normalized percentage. |
0.2632 |
| Width |
string |
No |
The width of the pane. The value is a normalized percentage. |
0.3564 |
| X |
string |
No |
The X coordinate. The value is a normalized percentage. |
0.2456 |
| Y |
string |
No |
The Y coordinate. The value is a normalized percentage. |
0.3789 |
| ZOrder |
string |
No |
The stacking order. 0 indicates the bottom layer, 1 indicates the layer above 0, and so on. |
0 |
| BackgroundImageUrl |
string |
No |
The URL of the background image for the sub-picture. When a user turns off the camera or has not joined the channel, this image is displayed in the layout position. |
yourImageUrl |
| RenderMode |
string |
No |
The display mode for the sub-picture output. Valid values:
|
1 |
| UserInfos |
array<object> |
No |
The information about the users subscribed to during stream mixing. If no user is specified, streams from all users are mixed. |
|
|
object |
No |
The stream mixing user information. |
||
| SourceType |
string |
No |
The type of the video input stream subscribed to during stream mixing. This parameter is valid only for video streams (StreamType=2). Valid values:
|
camera |
| StreamType |
string |
No |
The type of the stream subscribed to during stream mixing. Valid values:
|
0 |
| ChannelId |
string |
No |
The ID of the channel to which the subscribed user belongs during stream mixing. This parameter is optional for users mixing streams within the same channel, but is recommended for cross-channel stream mixing. |
yourChannelId |
| UserId |
string |
Yes |
The ID of the user subscribed to during stream mixing. |
yourSubUserId |
| SeiParams |
object |
No |
The SEI configuration parameters. |
|
| LayoutVolume |
object |
No |
The layout and volume SEI. This parameter can be left empty, which indicates that the default layout and volume SEI is included. |
|
| FollowIdr |
string |
No |
Specifies whether to ensure that the SEI is carried when an IDR keyframe is sent. Valid values:
|
0 |
| Interval |
string |
No |
The SEI send interval. Valid values: [1000, 5000]. Unit: milliseconds. |
1000 |
| PassThrough |
object |
No |
The pass-through SEI. |
|
| FollowIdr |
string |
No |
Specifies whether to ensure that the SEI is carried when an IDR keyframe is sent. Valid values:
|
0 |
| Interval |
string |
No |
The SEI send interval. Valid values: [1000, 5000]. Unit: milliseconds. |
1000 |
| PayloadContent |
string |
No |
The payload content of the pass-through SEI. |
yourPayloadContent |
| PayloadContentKey |
string |
No |
The key corresponding to the payload content of the pass-through SEI. If this parameter is not specified, the default key udd is used. |
yourPayloadContentKey |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response result. |
||
| RequestId |
string |
The request ID. |
0F72851F-5DC1-1979-9B2C-450040316C3E |
Examples
Success response
JSON format
{
"RequestId": "0F72851F-5DC1-1979-9B2C-450040316C3E"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParam | %s. | Parameter verification failed |
| 400 | InvalidAppId | %s, please check and try again later. | AppId is invalid, please check and try again. |
| 400 | MissingParam | %s, please check and try again later. | Parameter is missing, please check and try again. |
| 500 | InternalError | InternalError | |
| 403 | OperationDenied | Your account has not enabled the Live service | |
| 403 | Forbidden | %s, please check and try again later. | No permission, please check and try again. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.