HTML and CSS Reference
In-Depth Information
This subset of four subtitles from the file demonstrates about all you need to know about SRT.
The first line for each subtitle is the unique subtitle number. The second line is the time when
the subtitle should appear, and the time when it should disappear. The subtitle is next, and may
be on more than one line. The subtitle is then followed by a blank line.
The time format is hh:mm:ss,ms and a double dash (--) and right angle bracket (>) is used
to separate the beginning and ending time. Note that the separator between the seconds and
milliseconds is a comma (,).
The SRT files can be encoded using ANSI, Unicode Little Endian, UTF-8, and others, but for
use in HTML5 video track elements, you should stick with UTF-8. The MIME type is text/
plain .
Chances are browsers will end up supporting SRT files because of their popularity. And they'll
work, as is. However, one reason why people wanted something different is because web de-
velopers want to have more control over how the subtitles are displayed. That's what led to
the work in WebVTT, discussed next.
WebVTT
At first glance, WebVTT looks very similar to SRT. Each subtitle begins with a number, fol-
lowed by a timeline, and then the subtitle. The file extension is .vtt, rather than .srt. Where
WebVTT differs from SRT is in providing several cue settings that can be used to control the
subtitles display.
A WebVTT has the following as the first line in the file:
WEBVTT
What follows is a set of subtitle entries, each proceeded by a number representing their order.
The following is the first four subtitles for Sintel, converted from SRT to WebVTT:
WEBVTT
1
00:01:47.250 --> 00:01:50.500
This blade has a dark past.
2
00:01:51.800 --> 00:01:55.800
It has shed much innocent blood.
3
00:01:58.000 --> 00:02:01.450
You're a fool for traveling alone,
so completely unprepared.
Search WWH ::




Custom Search