IntelInlet
Studio journal
Private media tools / / 2 min read

Convert SRT, WebVTT and ASS and merge bilingual cues by time

Work through a one-to-many subtitle match, then check timing syntax, line breaks and style loss.

One Chinese cue runs from 1.200 to 3.600 seconds. Its English translation occupies 1.150–2.400 and 2.400–3.650. Joining by row number would attach the second half to the next speaker. Use both subtitle files and the exact cut of the picture as your inputs.

Procedure

  1. Keep the originals. Normalize cue times to integer milliseconds. Both SRT’s 00:00:01,200 and VTT’s 00:00:01.200 become 1200. Save a UTF-8 working copy.

  2. Use the Chinese track as the timeline. Compute overlap as max(0, min(endA,endB) - max(startA,startB)). Both translations overlap the master cue by 1,200 ms. Join them in order. Flag a translation that substantially overlaps two master cues for a listening pass.

  3. For SRT, write a sequence number, time range and two lines of text, followed by a blank line. For VTT, begin with WEBVTT and a blank line and use a decimal point in timestamps. For ASS, define a style and separate languages with \N in the dialogue text.

Inspect one merged cue

Suppose the original says ‘把阀门关上。’ and the two English fragments are ‘Close’ and ‘the valve.’ The following complete WebVTT fixture contains the merged cue. Import it into the target player before applying the conversion across an entire film.

WEBVTT

00:00:01.200 --> 00:00:03.600
把阀门关上。
Close the valve.

For SRT, remove the header, add sequence number 1 and switch the decimal separators to commas. ASS dialogue events commonly use hundredths of a second. Apply a consistent rounding rule to milliseconds that are not multiples of ten, then compare the round trip within one tick.

Choosing an approach

Target Preserves Check
SRT Dialogue and timing Space for two lines
VTT Web cues and settings Layout in the target browser
ASS Font, outline and placement Availability of the specified font

Check the result

Play the opening cue, the merged line and the last exchange. Increasing drift suggests the tracks came from different edits. Re-import the output, check that each end follows its start, and inspect punctuation in names after timestamp conversion.

For an audio-only source, transcribe a reference line locally before aligning the translation.

Frequently asked questions

Where did the ASS outline go in SRT?

SRT cannot carry the full ASS style model. Keep the ASS master and deliver a separate burned-in copy if placement must be fixed.

How should I match a translation with zero overlap?

Queue it for manual alignment and listen to the surrounding lines. Assigning the nearest cue can conceal a missing sentence or a picture edit.

References

Related reading

Private media toolbox ↗