ApsaraVideo Live provides real-time captions. This feature uses real-time speech recognition to convert audio from live streams into captions and supports translation. Currently, ApsaraVideo Live supports mutual translation among Chinese, English, Spanish, and Russian. This topic helps you quickly understand how to use real-time captions, including the workflow and trigger methods.
Important Notes
For a list of live centers that support real-time captions, see Service regions.
Real-time captions are currently in invitational preview. Each user can create up to 300 caption templates. One caption template can be associated with multiple caption rules.
Caption templates define only caption-related settings, such as content and layout. They do not include associations with domain names or AppName in live streams. Caption rules define how domain names and AppName associate with caption templates.
After configuring a caption template, add a caption rule that links to this template. In the rule, specify the domain name and AppName. The AppName must match the AppName in your ingest URL. Captions appear in playback only after you restart stream ingest.
Real-time captions are a billable feature. During public preview, you can use it for free. Normal charges will apply after public preview ends. We will announce the exact timing separately.
Workflow
Step 1: Add a Caption Template
Console Instructions
Log on to the ApsaraVideo Live console.
In the navigation pane on the left, choose Feature Management > Real-time Subtitles to go to the Real-time Subtitles page, then select a tab.
Select the region for your caption template configuration. Then click Add Subtitle Template to configure the template. On the Add Caption Template page, in the Basic Information section, select Creation Method (Create New Caption Template or Copy Existing Caption Template), enter a Caption Template Name (only digits, letters, and hyphens allowed), and provide a Caption Template Description (up to 128 characters). In the Caption Settings section, configure Language, Translation, Maximum Lines, Maximum Characters Per Line, and Font. Use the Preview panel on the right to view your changes.
You can preview captions in the preview area. Adjust the preview screen size, caption size, and position to see real-time effects. The following table lists caption template parameters and their descriptions.
Parameter | Description |
Creation Method |
|
Caption Template Name | Name of the caption template. Only digits, uppercase and lowercase letters, and hyphens (-) are allowed. Hyphens cannot appear at the start. |
Caption Description | Description of the caption. Supports Chinese, English, digits, and symbols. Maximum length: 128 characters. |
Source Language | Supports Chinese, English, and Russian. |
Translation | Options: Chinese, English, Spanish, Russian, or No Translation.
|
Maximum Lines | Maximum number of lines to display. Enter an integer from 1 to 300. |
Maximum Characters Per Line | Maximum number of characters per line. Enter an integer from 10 to 320. |
Font | Available fonts:
|
Font Size | Size of the font. |
Caption Background | When disabled, no background appears behind captions. When enabled, you can set background color and transparency. |
Color Settings | Set caption color and transparency, and caption background color and transparency. |
Screen Size (W×H) | Preview screen size. Options:
|
Click Submit to complete the caption template configuration.
After successfully adding a caption template, a prompt appears to add a caption rule. Click Add to create a rule for this template. If you do not need to add a rule now, click Later and configure the rule later.
On the Subtitle Templates tab, find your template in the list. In the Actions column, click Preview, Modify, or Delete to manage the template:
Action
Description
Preview
Preview the actual caption effect.
Modify
Adjust caption template parameters.
Delete
On the caption template list page, if Bound Caption Rules shows 0, the template has no associated rules. Click Delete to remove the template.
If Bound Caption Rules shows a number greater than 0, the template is already bound to rules. The Delete button is grayed out and unavailable. You must first delete all associated caption rules before deleting the template. Click the number under Bound Caption Rules to view the associated rules.
Add Subtitle Rule
Add a caption rule for this template and configure related parameters. For details, see Step 2: Add a Caption Rule.
NoteModifying or deleting a caption template does not affect ongoing live streams. Changes take effect only after you restart stream ingest.
API Instructions
Through API configuration, the following APIs are available for you to use.
Interface | Reference Document |
AddLiveAISubtitle | |
DeleteLiveAISubtitle | |
UpdateLiveAISubtitle | |
DescribeLiveAISubtitle |
Step 2: Add a Caption Rule
Console Instructions
Log on to the ApsaraVideo Live console.
In the navigation pane on the left, choose Feature Management > Real-time Subtitles to go to the Real-time Subtitles page, then select the Subtitle Rules tab.
Select the region for your caption rule configuration. After selecting a region, you can only configure domain names and caption templates within that region. Then click Add Caption Rule. On the configuration page, enter a Rule Description, select a Streaming Domain, enter an AppName (up to 256 characters; supports digits, letters, hyphens, and underscores), select a Caption Template (click Preview to view its effect), choose an Output Setting (output aspect ratio must match the template’s aspect ratio), and turn the Stream Pulling Trigger switch on or off as needed. Then click Submit.
The following table lists caption rule parameters and their descriptions.
Parameter | Description |
Rule Description | Description of the caption rule. Supports Chinese, English, digits, and symbols. Maximum length: 128 characters. |
Streaming Domain | Select the primary streaming domain to configure. |
AppName | Name of the application to which the stream belongs. The AppName must exactly match the AppName in your ingest URL for the caption template to take effect. Supports digits, uppercase and lowercase letters, hyphens (-), and underscores (_). Maximum length: 256 characters. |
Caption Template | Select a configured caption template. If no templates exist, add one first. For details, see Step 1: Add a Caption Template. |
Output Setting | We recommend matching the output setting in the caption rule to the screen size in the caption template for accurate playback. Supported output specifications:
|
Stream Pulling Trigger | How caption streams are triggered.
|
Click Submit to complete the caption rule configuration.
NoteAfter successfully configuring a caption rule, restart stream ingest for captions to appear in playback.
On the Subtitle Rules tab, find your rule in the list. In the Actions column, click Preview, Edit, or Delete:
Preview: Preview the actual caption effect.
Edit: Adjust caption rule parameters.
Delete: Delete the caption rule.
API Instructions
Through API configuration, you can use the following APIs.
Interface | Reference Document |
AddLiveAIProduceRules | |
UpdateLiveAIProduceRules | |
DescribeLiveAIProduceRules | |
DeleteLiveAIProduceRules |
Step 3: Stream Ingest
Use the URL generator in the console or manually construct your ingest URL. For details, see Generate live streaming URLs.
Step 4: Play Caption-Enabled Stream
To play a live stream with captions, use the caption stream playback URL. Append _{caption template name} to the StreamName:
RTMP: rtmp://example.aliyundoc.com/app/stream_{caption template name}?auth_key={access token}
FLV: http://example.aliyundoc.com/app/stream_{caption template name}.flv?auth_key={access token}
M3U8: http://example.aliyundoc.com/app/stream_{caption template name}.m3u8?auth_key={access token}
Real-time captions do not support playback over the ARTC protocol.