Live subtitles (public preview)
ApsaraVideo Live provides live subtitles that use real-time speech recognition to convert live stream audio into subtitles with translation support for Chinese, English, Spanish, and Russian.
Usage notes
-
Supported regions are listed in Regions.
-
Live subtitles is in public preview. Each user can create up to 300 subtitle templates. One template can be associated with multiple subtitle rules.
-
A subtitle template defines subtitle properties such as content and layout, but does not specify a streaming domain or AppName.
-
After you create a subtitle template, create a subtitle rule that references it. In the rule, specify a streaming domain and an AppName that matches the AppName in the ingest URL. Restart stream ingest for subtitles to take effect.
-
Live subtitles is a paid service, free during public preview. Standard billing applies after the preview ends. You will be notified of the billing start 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 for the subtitle template, and then click Add Subtitle Template to configure it.

Preview subtitle effects in the preview area by adjusting the video resolution, subtitle size, and position. The following table describes the subtitle template parameters.
|
Parameter |
Description |
|
Creation method |
|
|
Subtitle template name |
The template name. Can contain digits, letters, and hyphens (-). Cannot start with a hyphen. |
|
Template description |
Up to 128 characters, including Chinese characters, letters, digits, and symbols. |
|
Source language |
Supported languages: Chinese, English, and Russian. |
|
Translation |
Valid values: Chinese, English, Spanish, Russian, and No Translation.
|
|
Maximum lines |
Maximum lines to display. Valid values: 1 to 300. |
|
Max characters per line |
Maximum characters per line. Valid values: 10 to 320. |
|
Font |
Subtitle font. Valid values:
|
|
Font size |
The font size for subtitles. |
|
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) |
Preview resolution. Valid values:
|
-
Click Submit to complete the configuration.
-
After the template is added, a dialog box prompts you to add a subtitle rule. Click Add to add a rule for this template, or click Later to skip.
-
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 subtitle effects.
Modify
Edit the template parameters.
Delete
-
On the subtitle template list, if the Bound Subtitle Rules column shows 0, the template has no bound rules. Click Delete to delete it.
-
If a template is bound to subtitle rules (Bound Subtitle Rules is not 0), the Delete button is disabled. Delete the bound rules first. Click the number in the Bound Subtitle Rules column to view them.
Add Subtitle Rule
Add a subtitle rule for this template. Step 2: Add a subtitle rule.
NoteTemplate changes do not affect active streams. Restart stream ingest to apply changes.
-
API
Use the following API operations to manage 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 for the subtitle rule. Only domains and templates within that region are available. Then, click Add Subtitle Rule.

The following table describes the subtitle rule parameters.
|
Parameter |
Description |
|
Rule description |
Up to 128 characters. Can contain Chinese characters, letters, digits, and symbols. |
|
Streaming domain |
Select the primary streaming domain for this rule. |
|
AppName |
The application name for the stream. Must match the AppName in the ingest URL for the subtitle template to take effect. Up to 256 characters: digits, letters, hyphens (-), and underscores (_). |
|
Subtitle template |
Select a subtitle template. If none exists, create one first. Step 1: Add a subtitle template. |
|
Output settings |
For best results, match the output resolution with the resolution set in the subtitle template. Supported output resolutions:
|
|
Triggered by stream pulling |
Controls when the subtitled stream is generated.
|
-
Click Submit to complete the rule configuration.
NoteRestart stream ingest after configuring a subtitle rule 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 subtitle effects.
-
Edit: Edit the rule parameters.
-
Delete: Delete the subtitle rule.
-
API
Use the following API operations to manage subtitle rules.
|
API |
Reference |
|
AddLiveAIProduceRules |
|
|
UpdateLiveAIProduceRules |
|
|
DescribeLiveAIProduceRules |
|
|
DeleteLiveAIProduceRules |
Step 3: Ingest a live stream
Generate an ingest URL by using the console URL generator or by constructing it manually. Generate ingest and streaming URLs.
Step 4: Play the subtitled stream
To play the subtitled stream, append _{subtitle_template_name} to the StreamName in the playback URL.
-
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 do not support the ARTC protocol.