Updates a mixed-stream relay task.
Operation description
Use Before calling this interface, you must have already called StartLiveMPUTask to create a mix stream relay task.
QPS Limitation
The per-user QPS limit for this interface is 500 times/second. Exceeding this limit will result in API calls being throttled, which may impact your business operations. Please use the API reasonably. For more information, see QPS Limitations.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
live:UpdateLiveMPUTask | update | *All Resources * |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
AppId | string | Yes | The application ID. You can specify only one application ID. The ID can be up to 64 characters in length and can contain letters, digits, underscores (_), and hyphens (-). | yourAppId |
ChannelId | string | Yes | The channel ID. You can specify only one channel ID. The ID can be up to 64 characters in length and can contain letters, digits, underscores (_), and hyphens (-). | yourChannelId |
TaskId | string | Yes | The task ID. You can specify only one task ID. The ID can be up to 55 characters in length and can contain letters, digits, underscores (_), and hyphens (-). The ID must be unique. | yourTaskId |
MixMode | string | No | The stream mixing mode. Valid values:
| 0 |
StreamURL | string | No | The ingest URL. You can specify only one ingest URL in the Real-Time Messaging Protocol (RTMP) format. The URL can be up to 2,048 characters in length. For information about the generation rules of ingest URLs, see Ingest and streaming URLs. Note
| rtmp://example.com/live/stream |
MultiStreamURL | array<object> | No | The multiple ingest URLs to relay. This parameter allows you to specify multiple ingest URLs. | |
object | No | |||
URL | string | No | The ingest URL. Only the RTMP format is supported. The URL can be up to 2,048 characters in length. For information about the generation rules of ingest URLs, see Ingest and streaming URLs. | rtmp://example.com/live/stream**** |
SingleSubParams | object | No | The single-stream relay parameters. These parameters are required if you set MixMode to 0. | |
SourceType | string | No | The type of the video source. This parameter is valid only when you set StreamType to 2. Valid values:
| camera |
StreamType | string | No | The type of the stream that you want to relay. Valid values:
| 0 |
UserId | string | Yes | The user ID. In the single-stream relay mode, you can relay only one stream in a request. | yourSubUserId |
TranscodeParams | object | No | The mixed-stream relay parameters. These parameters are required if you set MixMode to 1. | |
Background | object | No | The global background image. | |
RenderMode | string | No | The display mode of the global background image.
| 1 |
URL | string | No | The URL of the global background image. | yourImageUrl |
EncodeParams | object | No | The encoding parameters for the output stream. | |
AudioOnly | string | No | Specifies whether the output stream is an audio-only stream. Valid values:
| false |
AudioBitrate | string | No | The bitrate of the audio. Valid values: [8,500]. Unit: Kbit/s. | 128 |
AudioChannels | string | No | The number of sound 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 codec. Valid values:
| H.264 |
VideoBitrate | string | No | The bitrate of the video. Valid values: [1,10000]. Unit: Kbit/s. | 3500 |
VideoFramerate | string | No | The frame rate of the video. Valid values: [1,60]. Unit: frames per second (FPS). | 25 |
VideoGop | string | No | The group of pictures (GOP) size of the video. Valid values: [1,60]. | 20 |
VideoHeight | string | No | The height of the video. Valid values: [0,1920]. Unit: pixels. | 1000 |
VideoWidth | string | No | The width of the video. Valid values: [0,1920]. Unit: pixels. | 1920 |
EnhancedParam | string | No | The parameter used for encoding enhancement, which is a JSON string. The parameter includes the optional profile and preset fields.
Note
A value of superfast for the preset field is suitable for real-time communication scenarios. We recommend that you not set the field if you are not a professional encoding engineer.
| {"profile": "high", "preset": "veryfast"} |
Layout | object | No | The video layout information. Note
If video transcoding is required, you must specify the video layout information, including the x-coordinate and y-coordinate, the width and height, and the layer. For audio-only transcoding, leave the video layout information empty.
| |
UserPanes | array<object> | No | The information about the panes. | |
object | No | The information about the pane. | ||
UserInfo | object | No | The information about the user whose stream is played in the pane. If you leave this parameter empty, the system automatically sets this parameter based on the order in which streamers join the channel. Note
| |
SourceType | string | No | The type of the video source. This parameter is valid only when you set StreamType to 2. Valid values:
| camera |
ChannelId | string | No | The ID of the channel where the user is. If the user is in the same channel, you can leave this parameter empty. We recommend that you specify this parameter when you perform stream mixing across channels. | yourChannelId |
UserId | string | No | The user ID. | yourSubUserId |
Height | string | No | The height of the pane. The value is normalized. | 0.2632 |
Width | string | No | The width of the pane. The value is normalized. | 0.3564 |
X | string | No | The x-coordinate of the pane. The value is normalized. | 0.2456 |
Y | string | No | The y-coordinate of the pane. The value is normalized. | 0.3789 |
ZOrder | string | No | The layer in which the pane resides. A value of 0 indicates the bottom layer. Each increment of the value by 1 indicates the next upper layer. | 0 |
BackgroundImageUrl | string | No | The URL of the background image of the pane. This image is displayed if the user turns off the camera or is not present in the channel. | yourImageUrl |
RenderMode | string | No | The display mode of the pane. Valid values:
| 1 |
UserInfos | array<object> | No | The information about the user whose stream is subscribed to. If you leave this parameter empty, streams from all users are mixed. | |
object | No | The information about the user. | ||
SourceType | string | No | The type of the video source that is subscribed to. This parameter is valid only when you set StreamType to 2. Valid values:
| camera |
StreamType | string | No | The type of the relayed stream that is subscribed to. Valid values:
| 0 |
ChannelId | string | No | The ID of the channel where the subscribed user is. If the user is in the same channel, you can leave this parameter empty. We recommend that you specify this parameter when you perform stream mixing across channels. | yourChannelId |
UserId | string | Yes | The ID of the subscribed user. | yourSubUserId |
SeiParams | object | No | The supplemental enhancement information (SEI) parameters. | |
LayoutVolume | object | No | The layout and volume SEI. If you leave this parameter empty, the default layout and volume SEI is used. | |
FollowIdr | string | No | Specifies whether to include the SEI in an Instantaneous Decoder Refresh (IDR) frame. Valid values:
| 0 |
Interval | string | No | The interval at which the SEI is sent. Valid values: [1000,5000]. Unit: milliseconds. | 1000 |
PassThrough | object | No | Specifies whether to pass through the SEI. | |
FollowIdr | string | No | Specifies whether to include the SEI in an IDR frame. Valid values:
| 0 |
Interval | string | No | The interval at which the SEI is sent. Valid values: [1000,5000]. Unit: milliseconds. | 1000 |
PayloadContent | string | No | The payload content of the SEI. | yourPayloadContent |
PayloadContentKey | string | No | The key of the payload content of the SEI. If you do not specify this parameter, the default value udd is used. | yourPayloadContentKey |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "0F72851F-5DC1-1979-9B2C-450040316C3E"
}
Error codes
HTTP status code | Error code | Error message |
---|---|---|
400 | InvalidParam | %s |
400 | InvalidAppId | %s |
403 | OperationDenied | Your account has not enabled the Live service |
403 | Forbidden | %s |
404 | MissingParam | %s |
500 | InternalError | InternalError |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-10-30 | The Error code has changed | View Change Details |
2024-08-13 | The Error code has changed | View Change Details |
2024-08-06 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2024-07-04 | The Error code has changed | View Change Details |
2024-06-12 | The Error code has changed | View Change Details |
2024-03-07 | The Error code has changed | View Change Details |
2024-03-01 | The Error code has changed | View Change Details |
2023-12-26 | The Error code has changed | View Change Details |