Gå til hovedinnhold

WebVTT format (.vtt)

WebVTT (Web Video Text Tracks) is the W3C subtitle and caption format used by HTML5 <track> elements. A .vtt file opens with a WEBVTT header and then lists cues: an optional cue identifier, a timecode line (HH:MM:SS.mmm --> HH:MM:SS.mmm plus optional positioning settings), and one or more lines of cue text.

The reader emits the WEBVTT header as a non-translatable data part, each cue identifier as its own data part, and one translatable block per cue. The timecode (including any cue settings) is preserved on the block's timecode property and written back verbatim, so the timing survives the round-trip. Cues are kept separate, with no merging by sentence, so each cue is translated independently.

IDvtt
SourceBuilt-in
Extensions.vtt
MIME Typestext/vtt
CapabilitiesRead + Write

Parameters

ParameterTypeDefaultDescription
cjkCharsPerLineinteger0Maksimalt antall tegn per linje for CJK-språk. Sett til 0 for å deaktivere.
extractNonTranslatableContentbooleantrueHvis true (standard), vises ikke-oversettbart kontekstuelt innhold, for eksempel innebygd CSS i en STYLE-blokk, som en innholdsblokk (synlig for innhenting/LLM-forbrukere, hoppes over av maskinoversettelse) i stedet for å skjules. Deaktiver for å beholde den eldre ugjennomsiktige virkemåten.
maxCharsPerLineinteger0Maksimalt antall tegn per linje i utdata. Sett til 0 for å deaktivere.
maxLinesPerCaptioninteger0Maksimalt antall linjer per bildetekst i utdata. Sett til 0 for å deaktivere.
splitWordsbooleanfalseDel opp ord slik at de ikke overskrider tegngrensen per linje.

Configure it live

Configuration
Loading form…

Examples

Default extraction

Read each cue as a translatable block with no output line limits.

{}

Processing notes

  • The WEBVTT header is emitted as a data part; cue identifiers become their own data parts.

  • The cue timecode and its settings are preserved on the block timecode property and written back unchanged.

Limitations

  • The output line-wrapping parameters (maxCharsPerLine, maxLinesPerCaption, cjkCharsPerLine, splitWords) are accepted for parity with Okapi but are not yet enforced by the native writer; cue text is written as supplied.

  • Cues are never merged by sentence; each cue is a separate block.

← Back to the Format Reference