ApsaraVideo Live provides a live subtitles feature that uses real-time speech recognition to convert audio from a live stream into subtitles. This feature also supports translation between Chinese, English, Spanish, and Russian. This topic describes how to use the live subtitles feature, including its workflow and trigger methods.
Usage notes
For information about the regions that support the live subtitles feature, see Regions.
The live subtitles feature is in public preview. A single user can add up to 300 subtitle templates. A subtitle template can be associated with multiple subtitle rules.
A subtitle template defines subtitle properties, such as content and layout, but not its association with a streaming domain or AppName.
After configuring a subtitle template, you must create a subtitle rule that uses it. In the rule, specify a streaming domain and an AppName. The AppName must match the AppName in the ingest URL. Subtitles appear in the stream only after you restart the stream ingest.
The live subtitles feature is a paid service that is free of charge during the public preview. Standard billing will apply after the public preview ends. You will be notified of the specific date in advance.
Procedure
Step 1: Add a subtitle template
Console
Log on to the ApsaraVideo Live console.
In the navigation pane on the left, choose Feature Management > Real-time Subtitles. On the Real-time Subtitles page, select the Subtitle Templates tab.
Select the region where you want to configure the subtitle template, and then click Add Subtitle Template to configure the subtitle template.

You can view the subtitle effect in the preview area. Adjust settings such as the preview video resolution, subtitle size, and position to preview the effect in real time. The following table describes the parameters for a subtitle template.
Parameter | Description |
Creation method |
|
Subtitle template name | The name of the subtitle template. The name can contain only digits, uppercase or lowercase letters, and hyphens (-). It cannot start with a hyphen. |
Template description | A description of the subtitle template. The description can contain up to 128 characters, including Chinese characters, English letters, digits, and symbols. |
Source language | Supported languages: Chinese, English, and Russian. |
Translation | Valid values: Chinese, English, Spanish, Russian, and No Translation.
|
Maximum lines | The maximum number of lines to display. The value must be an integer from 1 to 300. |
Max characters per line | The maximum number of characters per line. The value must be an integer from 10 to 320. |
Font | The font for the subtitles. Valid values:
|
Font size | The size of the font. |
Subtitle background | If enabled, you can set the background color and opacity. If disabled, the background is hidden. |
Color settings | Set the color and opacity of the subtitles and their background. |
Resolution (width × height) | The resolution of the preview video. Valid values:
|
Click Submit to complete the configuration.
After the subtitle template is added, a dialog box prompts you to add a subtitle rule. You can click Add to add a subtitle rule for this template. If you do not need to add a subtitle rule at this time, you can click Later.
On the Subtitle Templates tab, find the template that you want to manage. In the Actions column, you can click Preview, Modify, or Delete.
Actions
Description
Preview
Preview the actual effect of the subtitles.
Modify
Modify the parameters of the subtitle template.
Delete
On the subtitle template list page, if the value in the Bound Subtitle Rules column is 0, the template is not bound to any subtitle rules. You can click Delete to delete the template.
If a template is bound to one or more subtitle rules (the value in the Bound Subtitle Rules column is not 0), the Delete button is disabled. You must first delete the subtitle rules bound to this template before you can delete the template. You can click the number in the Bound Subtitle Rules column to view the bound subtitle rules.
Add Subtitle Rule
Add a subtitle rule for this template and configure its parameters. For more information, see Step 2: Add a subtitle rule.
NoteChanges to a subtitle template do not affect active live streams. To apply the changes, you must restart the stream ingest.
API
You can use the following API operations to configure subtitle templates.
API | Reference |
AddLiveAISubtitle | |
DeleteLiveAISubtitle | |
UpdateLiveAISubtitle | |
DescribeLiveAISubtitle |
Step 2: Add a subtitle rule
Console
Log on to the ApsaraVideo Live console.
In the navigation pane on the left, choose Feature Management > Real-time Subtitles. On the Real-time Subtitles page, select the Subtitle Rules tab.
Select the region where you want to configure the subtitle rule. After you select a region, you can configure only the domains and subtitle templates within that region. Then, click Add Subtitle Rule.

The following table describes the parameters for a subtitle rule.
Parameter | Description |
Rule description | A description of the subtitle rule, up to 128 characters long. It can contain Chinese characters, English letters, digits, and symbols. |
Streaming domain | Select the primary streaming domain to which you want to apply the rule. |
AppName | The name of the application for the stream. For the subtitle template to take effect, the AppName must be the same as the AppName in the ingest URL. The name can be up to 256 characters long and can contain digits, letters, hyphens (-), and underscores (_). |
Subtitle template | Select a configured subtitle template. If no template is available, add one first. For more information, see Step 1: Add a subtitle template. |
Output settings | For best results, align the output resolution in the subtitle rule with the resolution set in the subtitle template. The following output resolutions are supported for the subtitled stream:
|
Triggered by stream pulling | Defines when the subtitled stream is generated.
|
Click Submit to complete the rule configuration.
NoteAfter a subtitle rule is configured, you must restart the stream ingest for subtitles to appear in the stream.
On the Subtitle Rules tab, find the rule you want to manage. In the Actions column, click Preview, Edit, or Delete.
Preview: Preview the actual effect of the subtitles.
Edit: Modify the parameters of the subtitle rule.
Delete: Delete the subtitle rule.
API
You can use the following API operations to configure subtitle rules.
API | Reference |
AddLiveAIProduceRules | |
UpdateLiveAIProduceRules | |
DescribeLiveAIProduceRules | |
DeleteLiveAIProduceRules |
Step 3: Ingest a live stream
Generate an ingest URL by using the URL generator in the console or by manually constructing it. For more information, see Generate ingest and streaming URLs.
Step 4: Play the subtitled stream
To play the subtitled stream, use its specific URL. Append _{subtitle_template_name} to the StreamName.
RTMP:
rtmp://example.aliyundoc.com/app/stream_{subtitle_template_name}?auth_key={access_token}FLV:
http://example.aliyundoc.com/app/stream_{subtitle_template_name}.flv?auth_key={access_token}M3U8:
http://example.aliyundoc.com/app/stream_{subtitle_template_name}.m3u8?auth_key={access_token}
Subtitled streams cannot be played over the ARTC protocol.