WebVTT
WebVTT is a World Wide Web Consortium standard for displaying timed text in connection with the HTML5
<track> element.The early drafts of its specification were written by the WHATWG in 2010 after discussions about what caption format should be supported by HTML5—the main options being the relatively mature, XML-based Timed Text Markup Language or an entirely new but more lightweight standard based on the widely used SubRip format. The final decision was for the new standard, initially called WebSRT. It shared the
.srt file extension and was broadly based on the SubRip format, though not fully compatible with it.The prospective format was later renamed WebVTT. In the January 13, 2011, version of the HTML5 Draft Report, the
<track> element was introduced and the specification was updated to document WebVTT cue text rendering rules. The WebVTT specification is a W3C Candidate Recommendation, and the basic features are supported by all major browsers.Main differences from SubRip
- WebVTT's first line starts with WEBVTT after the optional UTF-8 byte order mark
- There is space for optional header data between the first line and the first cue
- Timecode fractional values are separated by a full stop instead of a comma
- Timecode hours are optional
- The frame numbering/identification preceding the timecode is optional
- Comments identified by the word NOTE can be added
- Metadata information can be added in a JSON-style format
- Chapter information can be optionally specified
- Only supports extended characters as UTF-8
- CSS in a separate file defined in the companion HTML document for C tags is used instead of the FONT element
- Cue settings allow the customization of cue positioning on the video
Compatibility
Subtitles in a.vtt file show online, but not when stored on a local drive.
Example of WebVTT format
A sample file from the W3C captioning Roger Bingham interviewing Neil deGrasse Tyson :
WEBVTT
00:11.000 --> 00:13.000We are in New York City
00:13.000 --> 00:16.000We're actually at the Lucern Hotel, just down the street
00:16.000 --> 00:18.000from the American Museum of Natural History
00:18.000 --> 00:20.000And with me is Neil deGrasse Tyson
00:20.000 --> 00:22.000Astrophysicist, Director of the Hayden Planetarium
00:22.000 --> 00:24.000at the AMNH.
00:24.000 --> 00:26.000Thank you for walking down here.
00:27.000 --> 00:30.000And I want to do a follow-up on the last conversation we did.
00:30.000 --> 00:31.500 align:right size:50%When we e-mailed—
00:30.500 --> 00:32.500 align:left size:50%Didn't we talk about enough in that conversation?
00:32.000 --> 00:35.500 align:right size:50%No! No no no no; 'cos 'cos obviously 'cos
00:32.500 --> 00:33.500 align:left size:50%Laughs
00:35.500 --> 00:38.000You know I'm so excited my glasses are falling off here.