WebVTT
/wɛb viː tiː tiː/ · noun · subtitle format · Web Video Text Tracks
WebVTT is the W3C text format for captions and subtitles on the web. Files end in .vtt and work with the HTML5 track element.
In more detail
WebVTT, short for Web Video Text Tracks, stores timed text for video: subtitles, captions, chapter titles and descriptions. Browsers read it through the track element inside a video tag.
It grew out of the SRT format. A file starts with the line WEBVTT, and each cue has a timing line with a dot before the milliseconds, followed by its text.
What WebVTT adds to SRT
Cue settings after the timing line control where text appears, such as line, position, size and align. STYLE blocks and the ::cue CSS selector style captions on a page. NOTE blocks hold comments, and voice tags name the speaker.
Cue numbers are optional in WebVTT, and the hours in a timestamp can be left out. Files must be UTF-8.
Where WebVTT is required
Browsers only load WebVTT in a track element, so captions on a self-hosted HTML5 video must be .vtt. Desktop players, video editors and many upload forms prefer SRT. Converting between the two is simple and keeps the timing and text.
Key points
- WebVTT is the caption format browsers read in the HTML5 track element.
- It adds positioning, styling and comments to the simple SRT layout.
- Serve .vtt files as text/vtt and save them as UTF-8.