All Products
Search
Document Center

ApsaraVideo Live:UpdateLiveMPUTask

Last Updated:Jun 10, 2026

Memperbarui tugas relay aliran campuran.

Deskripsi operasi

Make sure that a mixed-stream relay task is created before you call this operation. You can call the StartLiveMPUTask operation to create a mixed-stream relay task.

QPS limit

You can call this operation up to 500 times per second per account. Requests that exceed this limit are dropped and you will experience service interruptions. We recommend that you take note of this limit when you call this operation.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

live:UpdateLiveMPUTask

update

*全部资源

*

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

AppId

string

Yes

ID aplikasi. Anda hanya dapat menentukan satu ID aplikasi. ID dapat memiliki panjang hingga 64 karakter dan dapat berisi huruf, angka, garis bawah (_), dan tanda hubung (-).

yourAppId

ChannelId

string

Yes

ID saluran. Anda hanya dapat menentukan satu ID saluran. ID dapat memiliki panjang hingga 64 karakter dan dapat berisi huruf, angka, garis bawah (_), dan tanda hubung (-).

yourChannelId

TaskId

string

Yes

ID tugas. Anda hanya dapat menentukan satu ID tugas. ID dapat memiliki panjang hingga 55 karakter dan dapat berisi huruf, angka, garis bawah (_), dan tanda hubung (-). ID harus unik.

yourTaskId

MixMode

string

No

Mode pencampuran aliran. Nilai valid:

  • 0: mode relay aliran tunggal. Dalam mode ini, layanan hanya merelay aliran tunggal asli, tetapi tidak mentranskode aliran campuran. Anda tidak perlu mengatur parameter untuk transkoding aliran campuran.

  • 1 (default): mode relay aliran campuran.

0

StreamURL

string

No

URL ingest. Anda hanya dapat menentukan satu URL ingest dalam format Real-Time Messaging Protocol (RTMP). URL dapat memiliki panjang hingga 2.048 karakter. Untuk informasi tentang aturan pembuatan URL ingest, lihat URL ingest dan aliran.

Catatan
  • Jika URL ingest berada di bawah nama domain yang mengaktifkan perlindungan hotlink, Anda harus menyertakan token akses di URL.

  • Anda tidak dapat menggunakan URL ingest yang sama di tugas yang berbeda.

  • Anda tidak dapat menggunakan URL ingest yang sama dalam 10 detik setelah tugas dihentikan.

rtmp://example.com/live/stream

MultiStreamURL

array<object>

No

Beberapa URL ingest untuk direlay. Parameter ini memungkinkan Anda menentukan beberapa URL ingest.

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****

IsAliCdn

boolean

No

Specifies whether to perform stream relay by using Alibaba Cloud CDN. Valid values:

  • false: performs stream relay by using a CDN service that is not Alibaba Cloud CDN.

  • true: performs stream relay by using Alibaba Cloud CDN.

Catatan

The default value of this parameter is false.

false

SingleSubParams

object

No

Parameter relay aliran tunggal. Parameter ini diperlukan jika Anda mengatur MixMode ke 0.

SourceType

string

No

The type of the video source. This parameter is valid only when you set StreamType to 2. Valid values:

  • camera (default)

  • shareScreen

camera

StreamType

string

No

The type of the stream that you want to relay. Valid values:

  • 0 (default): original stream

  • 1: only the audio track

  • 2: only the video track

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

Parameter relay aliran campuran. Parameter ini diperlukan jika Anda mengatur MixMode ke 1.

Background

object

No

The global background image.

RenderMode

string

No

The display mode of the global background image.

  • 0: scales the background image proportionally to fit the view, with black bars displayed.

  • 1 (default): crops the background image to fit the view.

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:

  • true: The output stream is an audio-only stream. If you set this parameter to true, you need to configure only audio-related parameters under EncodeParams.

  • false (default): The output stream is not an audio-only stream. If you set this parameter to false, you need to configure all parameters under EncodeParams, except the VideoCodec and EnhancedParam parameters.

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

  • H.265

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.

  • profile: the encoding level. If the video codec is H.264, the valid values of this field are baseline, main, and high. If the video codec is H.265, the valid value of this field is main.

  • preset: adjusts the trade-off between encoding speed and video quality. The valid values of this field are ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, and placebo. Each value specifies a level of trade-off between encoding speed and video quality. For example, the ultrafast preset has the fastest encoding speed but the lowest video quality, while the placebo preset sacrifices the encoding speed for the best video quality.

Catatan

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.

Catatan

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.

array<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.

Catatan
  • If you specify the information about a user by using this parameter, the information about the user must also be specified by using the TranscodeParams.UserInfos parameter.

  • This parameter is valid only when you set StreamType to 0 or 2.

SourceType

string

No

The type of the video source. This parameter is valid only when you set StreamType to 2. Valid values:

  • camera (default)

  • shareScreen

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:

  • 0: scales the video proportionally to fit the view, with black bars displayed.

  • 1 (default): crops the video to fit the view.

1

UserInfos

array<object>

No

The information about the users whose streams are 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 (default)

  • shareScreen

camera

StreamType

string

No

The type of the relayed stream that is subscribed to. Valid values:

  • 0 (default): original stream

  • 1: only the audio track

  • 2: only the video track

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

Parameter supplemental enhancement information (SEI).

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: does not include the SEI.

  • 1: includes the SEI.

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: does not include the SEI.

  • 1: includes the SEI.

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

Elemen respons

Element

Type

Description

Example

object

RequestId

string

The request ID.

0F72851F-5DC1-1979-9B2C-450040316C3E

Contoh

Respons sukses

JSONformat

{
  "RequestId": "0F72851F-5DC1-1979-9B2C-450040316C3E"
}

Kode kesalahan

HTTP status code

Error code

Error message

Description

400 InvalidParam %s.
400 InvalidAppId %s, please check and try again later.
400 MissingParam %s, please check and try again later.
500 InternalError InternalError
403 OperationDenied Your account has not enabled the Live service
403 Forbidden %s, please check and try again later.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.