This topic describes how to extract subtitles from a video by using the CreateMediaConvertTask operation of Intelligent Media Management (IMM).
Feature description
Video subtitle extraction is the technical capability that separates subtitle information from a video file into a separate text file for access and editing. This capability is essential for multi-language support, barrier-free viewing, and subtitle creation.

Scenarios
Multi-language support: Subtitle extraction supports the production of multi-language subtitles to facilitate the understanding of video content by diverse language audiences.
Translation and localization: By extracting subtitles, translators can quickly obtain text information from a video and translate it to create localized versions that conform to the cultural and linguistic habits of specific regions.
Dubbing and speech recognition: Subtitle extraction provides an important text foundation for voice actors, allowing them to record voice based on the extracted subtitles. Speech recognition can be trained and optimized using subtitle text.
Video editing and production: Video editors can extract and organize subtitles of audio content to edit, proofread, and improve text content. This enhances the quality of the final product.
Limits
Video subtitle extraction supports only text subtitles and graphical subtitles, and does not support burned-in subtitles that are embedded in video frames. If you need assistance, contact us.
Procedure
Prerequisites
An AccessKey pair is created and obtained. For more information, see Create an AccessKey pair.
Object Storage Service (OSS) is activated and a bucket is created. For more information, see Create a bucket.
IMM is activated. For more information, see Activate IMM.
A project is created in the IMM console. For more information, see Create a project.
NoteYou can call the CreateProject operation to create a project. For more information, see CreateProject.
You can call the ListProjects operation to list information of all projects in a region.
Step 1: Upload a file
Use the OSS console to upload a media file to a bucket that resides in the same region as your IMM project.

Step 2: Use IMM to extract subtitles from a video
Call the CreateMediaConvertTask operation to create a video subtitle extraction task.
The extraction process includes the following phases:
Subtitle format identification: Identifies the formats of subtitles embedded in the video file, including the SubRip Subtitle (SRT), Advanced SubStation Alpha (ASS), Web Video Text Tracks (WebVTT), and embedded subtitle stream formats.
Subtitle data extraction: Extracts subtitle text and its timestamps from the video file. This phase ensures that all subtitle content, including the speaker name, timestamps, and time format, are accurately captured.
Text processing: Performs the necessary processing or editing on the extracted subtitle text. During this phase, the system may remove redundant information, adjust formats, translate languages, and perform spelling and grammar proofreading.
Output and saving: Saves the processed subtitle text in a specified format, such as the SRT or ASS format, to facilitate usage, editing, or uploading to video platforms during subsequent operations.
Parameter examples
In the following examples, an IMM project named test-project is used, and subtitles are extracted from a video whose file name is oss://test-bucket/video-demo/test.mp4.
For more information about media processing features and usage methods, see Media transcoding.
You can process the video file by using the media transcoding interface through OpenAPI Explorer and reference the SDK code.
To extract video subtitles, do not configure the Target.URI and Target.Container parameters.
We recommend that you set the subtitle output URI to "oss://test-bucket/objectPrefix-{streamindex}.{autoext}". If you do not specify the streamindex variable, subtitles may overwrite each other.
Extract all subtitles from a video and convert them to the WebVTT format
Subtitle format: WebVTT.
Subtitle file output path:
oss://test-bucket/video-demo/subtitle-%d.vttTranscoding completion notification: a Simple Message Queue (formerly MNS) (SMQ) message, which is sent to an SMQ topic named "test-mns-topic".
For more information about the sample SDK, go to OpenAPI Explorer. The parameters in the example are automatically configured in OpenAPI Explorer. Before you debug the code, modify the parameters as needed.
Request parameters
{
"ProjectName": "test-project",
"Notification": {
"MNS": {
"TopicName": "test-mns-topic"
}
},
"Sources": [
{
"URI": "oss://test-bucket/video-demo/test.mp4"
}
],
"Targets": [
{
"Subtitle": {
"ExtractSubtitle": {
"Format": "webvtt",
"URI": "oss://test-bucket/video-demo/subtitle-{streamindex}.{autoext}"
}
}
}
]
}Extract all subtitles from a video and convert them to the SRT format
Subtitle format: SRT.
Subtitle file output path:
oss://test-bucket/video-demo/subtitle-%d.srtTranscoding completion notification: an SMQ message, which is sent to an SMQ topic named "test-mns-topic".
For more information about the sample SDK, go to OpenAPI Explorer. The parameters in the example are automatically configured in OpenAPI Explorer. Before you debug the code, modify the parameters as needed.
Request parameters
{
"ProjectName": "test-project",
"Notification": {
"MNS": {
"TopicName": "test-mns-topic"
}
},
"Sources": [
{
"URI": "oss://test-bucket/video-demo/test.mp4"
}
],
"Targets": [
{
"Subtitle": {
"ExtractSubtitle": {
"Format": "srt",
"URI": "oss://test-bucket/video-demo/subtitle-{streamindex}.{autoext}"
}
}
}
]
}Billing
During video subtitle extraction, IMM generates the following billable items. For detailed pricing, see IMM billable items. OSS and IMM generate the following billable items:
OSS: For detailed pricing, see OSS Pricing
API
Billable item
Description
GetObject
GET requests
You are charged request fees based on the number of successful requests.
Infrequent Access Data Retrieval Capacity
If IA objects are retrieved, you are charged IA data retrieval fees based on the size of retrieved IA data.
Archive Data Direct Read Retrieval Capacity
If Archive objects in a bucket for which real-time access is enabled are retrieved, You are charged Archive data retrieval fees based on the size of retrieved Archive objects.
Transfer acceleration
If you enable transfer acceleration and use an acceleration endpoint to access your bucket, you are charged transfer acceleration fees based on the data size.
PutObject
PUT requests
You are charged request fees based on the number of successful requests.
Storage fees
You are charged storage fees based on the storage class, size, and storage duration of the object.
HeadObject
GET requests
You are charged request fees based on the number of successful requests.
IMM: For detailed pricing, see IMM billable items.
ImportantStarting from 11:00 UTC+8 on July 28, 2025, the IMM video subtitle extraction service will be upgraded from a free model to a paid model. For more information, see IMM billing adjustment announcement.
API
Billable item
Description
CreateMediaConvertTask
ExtractSubtitleText
You are charged request fees for text subtitle extraction based on the number of successfully extracted subtitle streams.
CreateMediaConvertTask
ExtractSubtitleImage
You are charged request fees for image subtitle extraction based on the total duration of successfully extracted subtitle streams.