You need to enable JavaScript to run this app.
Lake AI Service

Lake AI Service

Copy page
Download PDF
Video Translation
Video Subtitle Translation
Copy page
Download PDF
Video Subtitle Translation

The video subtitle translation operator supports extracting subtitles from videos and translating them into multiple languages. Users can choose to recognize embedded subtitles in the video using OCR, or extract audio subtitles using ASR, then refine and translate the recognized subtitles, and output subtitle files in various formats.

Operator introduction

Operator ID: las_video_subtitle_translate

Applicable scenarios

  • Video globalization: Enables video communication across different countries, covering short dramas, animation, movies, e-commerce videos, and many other fields.
  • Education industry: Translates professional videos and adapts to videos with different accents, expression habits, and complex technical terms.

Core capabilities

  • Dual subtitle sources: Supports two methods—recognizing embedded subtitles in the video using OCR and extracting audio subtitles using ASR.
  • Multiple accuracy levels: Each subtitle source supports both low and high accuracy configurations to meet different scenario requirements.
  • Multilingual translation: Supports subtitle translation in 25 languages, including Chinese, English, Japanese, Korean, French, German, Spanish, and more.
  • Multi-format output: Supports simultaneous output of subtitle files in multiple formats.
  • Bilingual subtitle recognition: The OCR mode supports recognition of translation-type bilingual subtitles and dialogue-type bilingual subtitles.

Demonstration

  • Input video
  • Result example 1:
    • Key parameters: ASR high-precision subtitle recognition, translation into Japanese, Korean, and English

      "caption_source": "asr_high_precision",
              "audio_language": "zh-CN",
              "output_language": ["ko-KR","ja-JP","en-US"],
              "caption_format": [".srt"],
      
    • Output result example

      asr-high.zip
      Unknown size

  • Result example 2:

    • Key parameters: OCR high-precision subtitle recognition, translation into Japanese, Korean, and English
      "caption_source": "ocr_high_precision",
              "audio_language": "zh-CN",
              "output_language": ["ko-KR","ja-JP","en-US"],
              "caption_format": [".srt"],
      
  • Output result example

    ocr-high.zip
    Unknown size

Advantages

  • Comprehensiveness: Provides diversified subtitle generation methods. For scenarios where there are no subtitles in the video, subtitles can also be generated from audio.
  • Accuracy: Offers higher subtitle extraction accuracy, especially in educational scenarios with complex technical terms and strong accent phenomena; provides higher translation accuracy for videos with accents.
  • Cost-effective: Offers multiple modes to choose from, providing the most cost-effective solutions for different scenarios.

Description of subtitle sources

Subtitle source

Description

Applicable scenarios

ocr_low_precision

OCR low accuracy, extracts embedded subtitles from the video frame

Video resolution must be at least 360p, subtitle text occupies more than 5% of the frame, suitable for quick processing

ocr_high_precision

OCR high accuracy, extracts embedded subtitles from the video frame

There is a large amount of non-subtitle text content in the video, and subtitles occupy less than 5% of the frame; high subtitle accuracy is required

asr_low_precision

ASR low accuracy, extracts subtitles from audio

Videos without embedded subtitles or with unclear subtitles, clear pronunciation, and standard speech

asr_high_precision

ASR high accuracy, audio extraction plus refined subtitle editing based on video understanding

Educational scenarios with complex professional terminology and pronounced accent phenomena

Supported languages

The following languages are supported for audio recognition and subtitle translation:

Language code

Language name

zh-CN

Chinese (Simplified)

en-US

English (United States)

ja-JP

Japanese

id-ID

Indonesian

es-MX

Spanish (Mexico)

pt-BR

Portuguese (Brazil)

de-DE

German

fr-FR

French

ko-KR

Korean

fil-PH

Filipino

ms-MY

Malay

th-TH

Thai

ar-SA

Arabic

it-IT

Italian

bn-BD

Bengali

el-GR

Greek

nl-NL

Dutch

ru-RU

Russian

tr-TR

Turkish

vi-VN

Vietnamese

pl-PL

Polish

ro-RO

Romanian

ne-NP

Nepali

uk-UA

Ukrainian

yue-CN

Cantonese

Operator performance

Sub-items
Performance impact description

Maximum RPM

600

Maximum concurrency

10

Duration

  • Total processing time is mainly affected by video duration, subtitle source type, number of output languages, and number of subtitle formats.
  • Processing time for OCR mode is proportional to video duration and mode accuracy.
  • ASR high-accuracy mode requires longer processing time due to refined subtitle editing based on video understanding.
  • Translation time is proportional to the number of subtitle lines and the number of output languages.

Input and output requirements

Input requirements

Breakdown

Detailed requirements

Supported input data modality

  • Video

Input format: video

  • Format: mp4, mov, avi, mkv, flv, webm.
  • Size: Minimum 10 seconds, maximum 4 hours.

Input path requirements

Provide input data to the operator through the request parameter video_url. Currently, two methods are supported: public URL and TOS path.

  • Public URL: A video URL accessible over the public internet, in the format http/https.
    • Public URLs that require login status or additional header authentication are not supported; temporary URLs must be valid during task execution.
  • TOS path: After uploading the data to be processed to a TOS bucket under the same primary account and region as the current LAS service, you can provide the TOS path in the format tos://bucket_name/demo/.
    • The TOS object must exist and have read permissions.

Output requirements

Breakdown

Detailed requirements

Output data modality

  • Text (subtitle file)

Output format: subtitle file

  • Formats: .txt, .srt, .xml, .vtt.

Output path: TOS

Specify the storage path for the operator output results using the request parameter caption_output_path. Currently, setting a TOS path is supported.

  • TOS path: A writable TOS Bucket directory under the same primary account and region as the LAS service. Format: tos://bucket/output/.

Billing information
  • Billing standards

    Breakdown

    Description of billing standards

    Billing item

    Billing is based on the input video duration, and includes two billing items: subtitle recognition fee and subtitle translation fee. The total amount payable is the sum of all billing items.

    Billing type

    Pay-as-you-go, unit: CNY/minute, billed hourly based on actual usage.

    Unit price

    The unit price for each billing item is tiered based on the input length when calling the model. The unit price varies depending on the input length tier.

    • Video subtitle recognition: The cost for intelligently recognizing subtitles from the input video. The unit price depends on the subtitle source method used.
    • Video subtitle translation: The unit price is fixed, but the total cost also depends on the number of target languages. When using the operator for subtitle translation, if translation into multiple languages is required, a subtitle translation fee will be incurred for each language.
  • Billing details
    Billing formula:

    Total Cost = Subtitle Recognition Cost + Subtitle Translate Cost
               = (Subtitle Recognition Unit Price × Input Video Duration)
                     + 
                 (Subtitle Translate Unit Price × Input Video Duration × Number of languages to be translated)
    
    Billing item
    Unit price

    Subtitle recognition

    Video subtitle source method - OCR low accuracy: 0.15 CNY/minute

    Video subtitle source method - OCR high accuracy: 0.25 CNY/minute

    Video subtitle source method - ASR low accuracy: 0.015 CNY/minute

    Video subtitle source method - ASR high accuracy: 1.5 CNY/minute

    Subtitle translation

    Fixed unit price: 0.1 CNY/minute/item

  • Billing example

    • Example scenario: Input a 5-minute Chinese video, select OCR high accuracy as the subtitle source method, and translate the video subtitles into English and Japanese.
    • Cost details:
      Total cost = 0.25 CNY/minute * 5 minutes + 0.1 CNY/minute/item * 5 minutes * 2 items = 2.25 CNY

Caution and prerequisites

Details

Caution and prerequisites

Costs

Before calling an operator, you need to understand the model invocation costs associated with using the operator. For details, see Large model invocation billing.

Authentication (API Key)

Before calling an operator, you need to generate an API Key for operator invocation. It is recommended to configure the API Key as an environment variable to ensure safer operator calls. For details, see Obtain and configure API Key.

BaseURL

Before calling an operator, you need to determine the BaseURL for operator invocation based on the region where your current LAS service is deployed. This is used to configure the path parameter values for operator calls.
For details, see Obtain the Base URL. The Examples below are for reference only; when making actual calls, replace the path values with those corresponding to your region.

Rest API invocation

API usage instructions

  • This operator's API is an asynchronous task interface. Submit a task through the Submit interface to obtain the task's task_id. Then use the Poll interface to check the running status of the corresponding task (task_id) and obtain the operator processing result.
  • Caution: After the task is submitted, the task's task_id is valid for 3 days. After 3 days, the operator processing result cannot be obtained using this task_id.

Submit

Interface description

Invoke the video subtitle translation operator to submit asynchronous tasks, supporting subtitle extraction, translation, and multi-format output.

Request parameters

Parameter
Type
Required
Example value
Description
operator_id
string
Yes
las_video_subtitle_translate
Operator ID
operator_version
string
Yes
v1
Operator version
data
VideoCaptioningInfo
Yes
Video Subtitle Translation request parameters
video_url
string
Yes
tos://example.com/video.mp4
The input video address must be accessible by the service. Supported http/https, tos://bucket/key. Supported formats: mp4, mov, avi, mkv, flv, webm. Duration limit: 10 seconds to 4 hours. Non-compliant inputs will return an error code during the Poll phase.
caption_source
string
Yes
ocr_high_precision
Subtitle source type.
- ocr_low_precision: OCR low precision, extracts embedded subtitles from the video frame. Suitable for scenarios where resolution is ≥360p and subtitles occupy > 5% of the frame, with shorter processing time.
- ocr_high_precision: OCR high precision, extracts embedded subtitles from the video frame. Suitable for scenarios where subtitles occupy < 5% and high accuracy is required.
- asr_low_precision: ASR low precision, extracts subtitles from audio. Suitable for standard videos with clear articulation.
- asr_high_precision: ASR high precision, audio extraction plus video understanding refinement. Suitable for scenarios with many technical terms or heavy accents, with longer processing time.
output_language
list of string
Yes
[en-US]
Output language list; at least one must be provided. Processing time and cost increase with the number of languages. For supported language codes, refer to the Supported languages section above.
audio_language
string
Conditionally required
zh-CN
Audio language of the input video. Required when caption_source is asr_low_precision or asr_high_precision. Input in OCR mode will be ignored. For supported language codes, refer to the Supported languages section above.
caption_output_path
string
Yes
tos://bucket/output/
Subtitle output directory. Currently, only TOS Bucket directories with write permissions under the same primary account and region are supported.
caption_format
list of string
No
[.srt]
Subtitle format; options are .txt, .srt, .xml, .vtt. Empty arrays are not supported. Duplicates will be automatically removed. The default is .srt. The format in the returned result includes a leading dot (for example, .srt).

Response parameters

const properties = ({defaultExpandAllRows: true,
  "columns": [
{ "title": "Parameter", "dataIndex": "column_0", "key": "column_0", "width": 300 },
{ "title": "Type", "dataIndex": "column_1", "key": "column_1", "width": 150 },
{ "title": "Example value", "dataIndex": "column_2", "key": "column_2", "width": 150 },
{ "title": "Description", "dataIndex": "column_3", "key": "column_3" }
  ],
  "data": [
    {
      "key": "1",
      "column_0": "metadata",
      "column_1": "metadata",
      "column_2": "",
"column_3": "Request metadata.",
      "children": [
        {
          "key": "1-1",
          "column_0": "task_id",
          "column_1": "string",
          "column_2": "task-xxx",
"column_3": "Task ID in asynchronous mode, used for job status queries."
        },
        {
          "key": "1-2",
          "column_0": "task_status",
          "column_1": "string",
"column_3": < div> Task status in asynchronous mode. < br/>< ul>< li> PENDING, request received</ li>< li> RUNNING, running</ li>< li> COMPLETED, completed</ li>< li> FAILED, failed</ li>< li> TIMEOUT, timed out</ li></ ul></div>
"column_3": < div> Task status in asynchronous mode. < br/>< ul>< li> PENDING, request received</ li>< li> RUNNING, running</ li>< li> COMPLETED, completed</ li>< li> FAILED, failed</ li>< li> TIMEOUT, timed out</ li></ ul> div>
        },
        {
          "key": "1-3",
          "column_0": "business_code",
          "column_1": "string",
          "column_2": "0",
"column_3": "Business code."
        },
        {
          "key": "1-4",
          "column_0": "error_msg",
          "column_1": "string",
          "column_2": "",
"column_3": "If there is an exception, detailed error information will be returned."
        }
      ]
    }
  ]
}); 
return <Table border={{ cell: true, wrapper: true }} pagination={false} {...properties} />;

Examples

Request example

curl --location "https://operator.las.ap-southeast-1.volces.com/api/v1/submit" --header "Content-Type: application/json" --header "Authorization: Bearer $LAS_API_KEY" --data '{
    "operator_id": "las_video_subtitle_translate",
    "operator_version": "v1",
    "data": {
        "video_url": "https://example.com/sample_video.mp4",
        "caption_source": "ocr_high_precision",
        "output_language": ["en-US"],
        "caption_format": [".srt"],
        "caption_output_path": "tos://bucket/output/"
    }
}'

Response example

{
    "metadata": {
        "task_id": "task-20260323153012-abc123",
        "task_status": "PENDING",
        "business_code": "0",
        "error_msg": ""
    }
}

Error code

HttpCode

Error code

Error message

Description

400

Parameter.Invalid

The parameter is invalid..

Invalid parameter

401

Authorization.Missing

Missing Authorization

Returned when authentication information is missing.

401

ApiKey.InValid

The api key is invalid

Returned when the API Key is invalid.

Poll

Interface description

Query the execution status and results of video subtitle translation tasks.

Request parameters

Parameter

Type

Required

Example value

Description

operator_id

string

Yes

las_video_subtitle_translate

Operator ID

operator_version

string

Yes

v1

Operator version

task_id

string

Yes

task-xxx

Task ID

Response parameters

Parameter
Type
Example value
Description
metadata
metadata
Request metadata
data
VideoCaptioningResponse
Returned data

Examples

Request example

curl --location "https://operator.las.ap-southeast-1.volces.com/api/v1/poll" --header "Content-Type: application/json" --header "Authorization: Bearer $LAS_API_KEY" --data '{
    "operator_id": "las_video_subtitle_translate",
    "operator_version": "v1",
    "task_id": "task-20260323153012-abc123"
}'

Response example

{
    "metadata": {
        "task_id": "task-20260323153012-abc123",
        "task_status": "COMPLETED",
        "submit_time": "2026-07-21T16:04:06+08:00",
        "end_time": "2026-07-21T16:04:06+08:00",
        "business_code": "0",
        "error_msg": ""
    },
    "data": {
        "video_url": "https://example.com/sample_video.mp4",
        "video_duration": 98.4,
        "final_captions": [
            {
                "tos_path": "tos://bucket/captions/20260323/account/trace/en-US_caption_xxx.srt",
                "presigned_url": "https://...",
                "language": "en-US",
                "format": ".srt"
            }
        ]
    }
}

Error code

HttpCode

Error code

Error message

Description

400

Video.Invalid

Video file is invalid or format not supported

Returned when the video file cannot be parsed or the format is not supported.

400

Video.DownloadFailed

Video download failed

Returned when video download fails.

400

Video.DurationTooShort

Video duration is less than 10 seconds

Returned when video duration is less than 10 seconds.

400

Video.DurationTooLong

Video duration exceeds 4-hour limit

Returned when video duration exceeds 4 hours.

400

Video.FrameExtractionFailed

Frame extraction failed

Returned when frame extraction fails in ASR high precision mode.

400

Video.OcrFailed

OCR processing failed

Returned when OCR recognition processing fails.

400

Video.AsrFailed

ASR processing failed

Returned when ASR speech recognition processing fails.

400

Video.RefineFailed

Subtitle refinement failed

Returned when subtitle refinement fails in ASR high-precision mode.

400

Video.TranslateFailed

Subtitle translation failed

Returned when subtitle translation fails.

400

Video.CaptionUploadFailed

Subtitle file upload failed

Returned when subtitle file upload fails.

400

Parameter.Invalid

Unsupported video format/invalid language code, and so on

Returned when parameter values are invalid, such as unsupported video format, invalid language code, and so on.

400

Parameter.Missing

Missing required parameter

Returned when a required parameter is missing, such as not providing audio_language when using ASR mode.

401

Authorization.Missing

Missing Authorization

Returned when authentication information is missing.

401

ApiKey.InValid

The api key is invalid

Returned when the API Key is invalid.

500

Internal.ServerError

Internal server error

Returned when an internal server error occurs.

Last updated: 2026.08.18 15:00:37