Introduction
WebVTT, the Web Video Text Tracks format, is the subtitle and caption format of the
web, specified by the W3C. A web page attaches a .vtt file to a video with
the HTML <track> element, and the browser shows the cues at the right
times. HLS streams also carry their subtitles as WebVTT.
WebVTT grew out of SRT and looks much like it, but it has a proper specification. It is always UTF-8, and it adds cue positioning, speaker names, styling with CSS and comments.
Structure
The file must begin with the word WEBVTT, optionally followed by a space
and a title on the same line. After a blank line come blocks separated by blank lines.
Most blocks are cues: an optional identifier line, a timing line, then the text. Times
are written hours:minutes:seconds.milliseconds with a full stop, and the
hours can be left out. Settings after the times, such as line,
position, size and align, place the cue on
screen.
The text can use the tags <b>, <i>,
<u>, <v Speaker> for the voice speaking, and
<c.class> for CSS styling. Other blocks are NOTE for
comments, STYLE for CSS and REGION for named areas of the
screen.
WEBVTT
NOTE The opening scene
intro-1
00:01.000 --> 00:03.500 line:85%
<v Anna>Where are we going?
00:04.000 --> 00:06.250
<v Ben><i>Somewhere we have never been.</i>
Links
Software
- Firefox – web browser that shows WebVTT through the
<track>element (Windows, macOS, Linux, mobile) - Chrome – web browser that shows WebVTT through the
<track>element (Windows, macOS, Linux, mobile) - Subtitle Edit – free subtitle editor that opens, edits and converts WebVTT (Windows, Linux)
- VLC media player – free media player that loads WebVTT next to the video (Windows, macOS, Linux, mobile)
- mpv – free, minimal media player that reads WebVTT (Windows, macOS, Linux)
- FFmpeg – command-line tools that read, write and convert WebVTT (Windows, macOS, Linux)
Developers
- webvtt-py – reads, writes and converts WebVTT (Python)
Reference
- WebVTT: The Web Video Text Tracks Format – the W3C specification
- WebVTT API – MDN Web Docs’ guide to the format and its use in browsers