All Products
Search
Document Center

ApsaraVideo Live:UpdateCustomLiveStreamTranscode

Last Updated:Dec 16, 2025

Updates a custom transcoding configuration.

Operation description

This operation supports the following types of custom transcoding templates:

  • h264: a custom H.264 standard template.

  • h264-nbhd: a custom H.264 Narrowband HD™ template.

  • h265: a custom H.265 standard template.

  • h265-nbhd: a custom H.265 Narrowband HD template.

  • audio: an audio-only template.

QPS limit

The queries per second (QPS) limit for a single user is 6,000 queries per minute.

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:UpdateCustomLiveStreamTranscode

update

*Domain

acs:cdn:*:{#accountId}:domain/{#DomainName}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

No

The region ID.

cn-shanghai

Domain

string

Yes

The streaming domain. This parameter cannot be modified.

example.com

App

string

Yes

The AppName of the live stream. This parameter cannot be modified.

liveApp****

Template

string

Yes

The custom name of the transcoding template. This parameter cannot be modified.

LiveCusTranscode****

TemplateType

string

Yes

The type of the custom transcoding template. This parameter cannot be modified.

h264

Height

integer

No

Output video height in pixels. Requirements:

  • Height ≥ 100

  • max(Height, Width) ≤ 2560

  • min(Height, Width) ≤ 1440

Note

For h265-nbhd templates, it cannot exceed 720.

720

Width

integer

No

Output video width in pixels.

Requirements:

  • Width ≥ 100

  • max(Height, Width) ≤ 2560

  • min(Height, Width) ≤ 1440

Note

For h265-nbhd templates, it cannot exceed 1280.

576

FPS

integer

No

The frame rate of the output video. Unit: frames per second (FPS). Valid values: 1 to 60.

30

VideoBitrate

integer

No

The output video bitrate. Unit: kbps. Valid values: 1 to 6000.

Note

The system tries to transcode the video at the specified bitrate. However, the actual bitrate may not be the same as the specified value, especially when the specified value is too high or too low.

720

AudioBitrate

integer

No

The output audio bitrate. Unit: kbps. Valid values: 1 to 1000.

512

Gop

string

No

The Group of Pictures (GOP) size. The unit can be frame or second. Valid values:

  • By frames: 1 to 3000.

  • By seconds: 1s to 20s.

1

Profile

integer

No

The video codec profile. A larger value indicates better video quality and higher resource consumption for encoding and decoding. Valid values:

  • 1: baseline (for mobile devices).

  • 2: main (for SD devices).

  • 3: high (for HD devices).

2

AudioProfile

string

No

The audio profile. Valid values:

  • aac_low

  • aac_he

  • aac_he_v2

  • aac_ld

aac_low

AudioCodec

string

No

The audio codec. Valid values:

  • aac

  • mp3

aac

AudioRate

integer

No

The audio sample rate. Valid values: 22050, 32000, 44100, 48000, and 96000. Unit: Hz.

Note

If you set AudioProfile to aac_ld, the sample rate cannot exceed 44100.

96000

AudioChannelNum

integer

No

The number of audio channels. Valid values:

  • 1: mono.

  • 2: stereo.

2

Lazy

string

No

Specifies whether to enable on-demand transcoding. Valid values:

  • yes: Transcoding only starts when the first viewer requests this transcoded stream.

  • no: Transcoding starts immediately after the stream is published.

yes

EncryptParameters

string

No

The encryption settings, formatted as a JSON string.

  • EncryptType: The encryption type. Set the value to aliyun.

  • KmsKeyID: The ID of the customer master key (CMK) in Key Management Service (KMS).

  • KmsKeyExpireInterval: The key rotation period. Unit: seconds. Valid values: 60 to 3600.

Note

When you use Digital Rights Management (DRM) encryption, you cannot modify KmsKeyID.

{"EncryptType": "aliyun", "KmsKeyID":"afce5722-81d2-43c3-9930-7601da11****","KmsKeyExpireInterval":"3600"}

ResWithSource

string

No

The adaptive resolution settings. If specified, it overrides the Height and Width parameters. Fieds:

  • Type (string): Required. Valid values:

    • short: sets the shorter edge of the video to the specified value and scales the other edge to maintain the original aspect ratio.

    • long: sets the longer edge of the video to the specified value and scales the other edge to maintain the original aspect ratio.

    • screen: Matches the output to a standard resolution, automatically flipping the dimensions based on the source's orientation.

  • Value (string): Required. Valid values:

    • For short: 360, 480, 540, 720, and 1080.

    • For long: 640, 848, 960, 1280, and 1920.

    • For screen: 640×360, 848×480, 960×540, 1280×720, and 1920×1080.

{"Type":"short","Value":"1080"}

FpsWithSource

string

No

Adapts the output frame rate based on the source's frame rate, while keeping it within a specified range. If specified, it overrides the FPS parameter. Fields:

  • UpLimit (integer): Required. The upper limit of the frame rate. This must be an integer from 1 to 60 and greater than the lower limit.

  • LowerLimit (integer): Required. The lower limit of the frame rate. This must be an integer from 1 to 60 and less than the upper limit.

{"UpLimit":60,"LowerLimit":1}

BitrateWithSource

string

No

The adaptive bitrate settings. If specified, it overrides the VideoBitrate parameter. Fields:

  • UpLimit (integer): Required. The upper limit of the bitrate. This must be an integer from 128 to 10000 and greater than the lower limit.

  • LowerLimit (integer): Required. The lower limit of the bitrate. This must be an integer from 128 to 10000 and less than the upper limit.

  • Factor (float): Required: The factor by which the source bitrate is multiplied to calculate the output bitrate. Valid values: 0.1 to 1. The value can be accurate to one decimal place. A value of 1 indicates that the output bitrate is the same as the source bitrate.

{"UpLimit":2500,"LowerLimit":800,"Factor":1}

ExtWithSource

string

No

Other adaptive settings that align the transcoded stream with the source stream. Fields:

  • KeyFrameOpen: Specifies whether to align keyframes with the source stream. Valid values: yes and no.

  • Copyts (string): Specifies whether to align the presentation timestamp (PTS) with the source stream. Valid values: yes and no.

  • SeiMode: The pass-through mode for Supplemental Enhancement Information (SEI). Valid values: 0 (disabled), 1 (pass through partial parameters), and 2 (pass through all).

{"KeyFrameOpen":"yes","Copyts":"yes","SeiMode":1}

DeInterlaced

boolean

No

Specifies whether to automatically detect and remove interlacing during transcoding. Deinterlacing converts interlaced video into progressive video.

  • true: enables deinterlacing.

  • false: keeps the source format. This is the default value.

Response elements

Element

Type

Description

Example

object

The request ID.

RequestId

string

The request ID.

16A96B9A-F203-4EC5-8E43-CB92E68F4CD8

Examples

Success response

JSON format

{
  "RequestId": "16A96B9A-F203-4EC5-8E43-CB92E68F4CD8"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParameters %s Please check and try again later. Exception parameter exists, please check and try again.
400 ConfigAlreadyExists %s Please check and try again later. Configuration already exists, please check and try again.
400 TemplateLimit %s Please check and try again later. The number of templates reached the upper limit.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.