Subtitle extraction
Subtitle extraction recovers a selected subtitle track or service into another representation while preserving the timing and configuration needed to interpret it.
Subtitle extraction takes a selected subtitle track or service out of its current packaging. It can produce a standalone subtitle file or feed another processing stage.
The first decision is which component to extract. Two tracks can share a language while containing different dialogue, sound descriptions or selected foreign passages. A numeric track index alone is not a durable identity if another file's tracks were reordered.
Reconstructing a standalone text cue
Suppose an embedded Matroska UTF-8 subtitle block has this information:
| Container information | Value |
|---|---|
| Presentation position | 12,500 units |
| Duration | 2,500 units |
| Time scale in this example | 1,000 units per second |
| Payload | The platform is empty. |
A standalone SRT representation reconstructs the interval:
1
00:00:12,500 --> 00:00:15,000
The platform is empty.
The cue number is created for the output file. Its start and end come from the recovered presentation time and duration. Global track offsets or applicable edit mappings must be included before writing the final programme positions.
The output file bytes differ from the container block, but the timed sentence can remain equivalent. Container timing and standalone timestamp text are different ways to describe the same interval.
Global configuration must come with the packets
| Extracted representation | Context needed for a useful result |
|---|---|
| ASS script | Global script/style section and event fields |
| VobSub pair | Binary subpictures plus indexing/palette/display configuration |
| PGS stream | Graphics segments and their applicable timed state |
| In-band caption service | Selected service and its recovered presentation commands |
| Text relying on a named face | Font resources available at the eventual renderer |
Dumping isolated packet bytes can omit the information that made them meaningful. A small graphics update can refer to an object or palette transmitted earlier. An ASS event can refer to a style defined in track configuration.
Font attachments are supporting resources, not ordinary timed subtitle packets. They may need their own selection when preparing a reusable styled subtitle.
Extraction and recognition recover different things
Extracting PGS retains graphics. Getting SRT words from those graphics requires OCR or transcription. Extracting ASS can retain styled events; writing only its visible wording into SRT is a conversion with a narrower presentation model.
Likewise, rendering subtitles into video is not extraction. The result stores their appearance in the new picture sequence rather than a separate subtitle resource.
For an Emby library, an external subtitle produced from an embedded track should be checked against the same selected content and movie timeline. Compare a few known cues, their language/role and any styling resources.