Live subtitles (public preview)

Updated at:
Copy as MD

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

image

Step 1: Add a subtitle template

Console

  1. Log on to the ApsaraVideo Live console.

  2. In the navigation pane on the left, choose Feature Management > Real-time Subtitles. On the Real-time Subtitles page, select the Subtitle Templates tab.

  3. Select the region for the subtitle template, and then click Add Subtitle Template to configure it.image

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

  • Create New Subtitle Template: Create a custom subtitle template from scratch.

  • Copy Existing Subtitle Template: Select an existing subtitle template to copy its parameters and quickly create a new template.

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.

  • If you select Chinese, English, Spanish, or Russian as the target language, you can choose whether to display the source language.

  • If you select No Translation, the source language must be displayed.

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:

  • KaiTi

  • Alibaba PuHuiTi-Regular

  • Alibaba PuHuiTi-Bold

  • Alibaba PuHuiTi-Light

  • Source Han Sans-Regular

  • Source Han Sans-Bold

  • Source Han Sans-Light

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:

  • Landscape LD (360p) 640×360

  • Portrait LD (360p) 360×640

  • Landscape SD (480p) 854×480

  • Portrait SD (480p) 480×854

  • Landscape HD (720p) 1280×720

  • Portrait HD (720p) 720×1280

  • Landscape FHD (1080p) 1920×1080

  • Portrait FHD (1080p) 1080×1920

  1. Click Submit to complete the configuration.

  2. 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.

  3. 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.

    Note

    Template 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

Add a live subtitle template

DeleteLiveAISubtitle

Delete a subtitle template

UpdateLiveAISubtitle

Update a subtitle template

DescribeLiveAISubtitle

Query subtitle templates

Step 2: Add a subtitle rule

Console

  1. Log on to the ApsaraVideo Live console.

  2. In the navigation pane on the left, choose Feature Management > Real-time Subtitles. On the Real-time Subtitles page, select the Subtitle Rules tab.

  3. Select the region for the subtitle rule. Only domains and templates within that region are available. Then, click Add Subtitle Rule.image

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:

  • Landscape LD (360p) 640×360

  • Portrait LD (360p) 360×640

  • Landscape SD (480p) 854×480

  • Portrait SD (480p) 480×854

  • Landscape HD (720p) 1280×720

  • Portrait HD (720p) 720×1280

  • Landscape Full HD 1080p 1920x1080

  • Portrait FHD (1080p) 1080×1920

Triggered by stream pulling

Controls when the subtitled stream is generated.

  • Enabled: Subtitles are generated only when viewers are pulling the stream. Generation stops after 5 minutes of no stream pulling and resumes when pulling restarts.

  • Disabled: Subtitles are generated whenever stream ingest is active, regardless of viewer activity.

image
  1. Click Submit to complete the rule configuration.

    Note

    Restart stream ingest after configuring a subtitle rule for subtitles to appear in the stream.

  2. 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

Add a live subtitle rule

UpdateLiveAIProduceRules

Update a live subtitle rule

DescribeLiveAIProduceRules

Query subtitle rules

DeleteLiveAIProduceRules

Delete a subtitle rule

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}

Note

Subtitled streams do not support the ARTC protocol.