UpdateLiveMPUTask

Updated at:

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

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

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: Single-stream relay. The original single stream is relayed without stream mixing and transcoding. You do not need to configure stream mixing and transcoding parameters.

  • 1 (default): Stream mixing, transcoding, and relay.

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
  • For domain names that have hotlink protection enabled, the ingest URL must include an access token.

  • The same StreamURL cannot be used in different tasks at the same time.

  • The same StreamURL cannot be used within 10 seconds after a task is stopped.

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:

  • false: The stream is relayed to a CDN other than Alibaba Cloud CDN.

  • true: The stream is relayed to Alibaba Cloud CDN.

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 (default): Camera.

  • shareScreen: Screen sharing.

camera

StreamType

string

No

The type of the stream to be relayed in single-stream relay mode. Valid values:

  • 0 (default): Original stream.

  • 1: Audio stream only.

  • 2: Video stream only.

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:

  • 0: Scale and display with a black background.

  • 1 (default): Crop.

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:

  • true: Audio-only. You only need to configure audio-related parameters.

  • false (default): Not audio-only. All parameters except VideoCodec and EnhancedParam must be specified.

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 (default)

  • H.265

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.

  • profile: The encoding level. If the video encoding format is H.264, valid values for profile are baseline, main, and high. If the video encoding format is H.265, the valid value for profile is main.

  • preset: The balance between encoding speed and quality. Valid values for preset are ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, and placebo. Each value represents a strategy for encoding speed and output video quality, ranging from ultrafast (fastest, prioritizing encoding speed) to placebo (pursuing ultimate quality, slowest encoding speed).

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
  • If you specify the stream mixing user information, the user information must be configured in the TranscodeParams.UserInfos parameter.

  • This parameter is valid only for original streams and video streams.

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 (default): Camera.

  • shareScreen: Screen sharing.

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:

  • 0: Scale and display with a black background.

  • 1 (default): Crop.

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 (default): Camera.

  • shareScreen: Screen sharing.

camera

StreamType

string

No

The type of the stream subscribed to during stream mixing. Valid values:

  • 0 (default): Original stream.

  • 1: Audio stream only.

  • 2: Video stream only.

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: The SEI is not ensured to be carried.

  • 1: The SEI is ensured to be carried.

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: The SEI is not ensured to be carried.

  • 1: The SEI is ensured to be carried.

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.