All Products
Search
Document Center

ApsaraVideo Live:AddLiveAISubtitle

Last Updated:Jun 23, 2026

Adds a subtitle template by calling AddLiveAISubtitle.

Operation description

Operation description

  • This operation allows you to add a live subtitle template configuration. The template configuration describes subtitle content, layout, and other information.

  • After you add a subtitle template, call the AddLiveAIProduceRules operation to add subtitle rules. The subtitles take effect in the stream only after you re-ingest the stream.

  • Real-time subtitles are supported only in the Beijing, Shanghai, Singapore, Indonesia, and Saudi Arabia regions.

Important The real-time subtitle feature is in public preview. Each user can add up to 300 subtitle templates. The feature is free of charge during the public preview. After the public preview ends, standard billing applies. The specific date will be announced separately.

QPS limit

The single-user QPS limit for this operation is 60 calls per second. If the limit is exceeded, API calls are throttled, which may affect your business. Call this operation as appropriate. For more information, see QPS limit.

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

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

No

The region ID.

cn-shanghai

SubtitleName

string

Yes

The name of the subtitle template. The name can contain only digits, letters, and hyphens (-). The name cannot start with a hyphen.

sub01

SrcLanguage

string

Yes

The source language. Valid values:

  • English: en-US

  • Chinese: zh-CN

  • Russian: ru-RU.

zh-CN

DstLanguage

string

No

The target language for translation. Valid values:

  • English: en-US

  • Chinese: zh-CN

  • Spanish: es-ES

  • Russian: ru-RU.

zh-CN

FontColor

string

No

The font color. Specify the value in RGBA format.

0xFFFFFF

FontName

string

No

The font. Valid values:

  • KaiTi: KaiTi (default)

  • AlibabaPuHuiTi-Regular: Alibaba PuHuiTi Regular

  • AlibabaPuHuiTi-Bold: Alibaba PuHuiTi Bold

  • AlibabaPuHuiTi-Light: Alibaba PuHuiTi Light

  • NotoSansHans-Regular: Noto Sans SC Regular

  • NotoSansHans-Bold: Noto Sans SC Bold

  • NotoSansHans-Light: Noto Sans SC Light.

KaiTi

BgColor

string

No

The background color of the subtitle. Specify the value in RGBA format.

0xFF0000

PositionNormalized

array

Yes

The position of the subtitle. The value is the x,y coordinates with the bottom-left corner of the screen as the origin.

Note

The x and y values must be normalized. The actual values are multiplied by the video height. For example, if the video height is 720p and PositionNormalized is set to [0.1, 0.5], the actual position of the subtitle is x = 72 and y = 360.

[0.32,0.27]

number

No

The coordinate value of the subtitle position.

0.32

ShowSourceLan

boolean

No

Specifies whether to display the source language. Default value: false.

true

MaxLines

integer

No

The number of lines to display.

2

WordPerLine

integer

Yes

The number of characters per line. Valid values: integers in the range of [1, 500].

20

FontSizeNormalized

number

Yes

The font size. Valid values: [0, 1].

0.037

BorderWidthNormalized

number

No

The font weight. Valid values: [0, 1].

0.05

BgWidthNormalized

number

No

The background size of the subtitle. Valid values: [0, 1].

0.09

CopyFrom

string

No

The subtitle template to copy from. Set this parameter to the value of SubtitleName.

sub01

Description

string

No

The custom description of the subtitle. The description can contain Chinese characters, letters, digits, and special characters, and can be up to 128 characters in length.

live AI subtitle template

Width

string

No

The width of the preview screen. Unit: px.

1280

Height

string

No

The height of the preview screen. Unit: px.

The width × height of the preview screen supports only the following specifications:

  • Landscape low definition 360P: 640 × 360

  • Portrait low definition 360P: 360 × 640

  • Landscape standard definition 480P: 854 × 480

  • Portrait standard definition 480P: 480 × 854

  • Landscape high definition 720P: 1280 × 720

  • Portrait high definition 720P: 720 × 1280

  • Landscape ultra-high definition 1080P: 1920 × 1080

  • Portrait ultra-high definition 1080P: 1080 × 1920.

720

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

5c6a2a0df228-4a64-af62-20e91b96****

SubtitleId

string

The subtitle template ID.

445409ec-7eaa-461d-8f29-4bec2eb9****

Examples

Success response

JSON format

{
  "RequestId": "5c6a2a0df228-4a64-af62-20e91b96****",
  "SubtitleId": "445409ec-7eaa-461d-8f29-4bec2eb9****"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParameter %s. Parameter error
400 MissingParameter %s. Missing parameter
400 InvalidParameter.Malformed There are invalid parameters: %s. There are invalid parameters: %s.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.