SubRip text file format

The SubRip text file format (SRT) is used by the (free, Windows-based) SubRip program to save subtitles ripped from video files or DVDs. Unlike some other programs (e.g., VobSub) which rip DVD subtitles in their original graphic-based format, SubRip performs OCR (Optical Character Recognition) to convert the subtitles into plain text, allowing for more flexible use in rendering, searching, indexing, and data analysis.

The WebVTT format, a W3C draft in 2014, has some similarities to this format.

Format
The format is based on plain text with CR+LF as the line separator (though Unix-style LF/newline is sometimes found). Some HTML tags are sometimes used in the captions for such things as indicating bold or italic text.

Each subtitle is represented as a group of lines (separated from other subtitles by a blank line). The first line has a number (assigned sequentially to each title); the second line has a timestamp range within the video being captioned, with times expressed in the format hours:minutes:seconds,milliseconds and the start and end of the range separated by.

The timestamp range can optionally be followed by a specific positioning by pixels, in the form.

Then the following line(s) contain the actual subtitle/caption text, ended by a blank line. The HTML &lt;b&gt;, &lt;i&gt;, &lt;u&gt;, and &lt;font&gt; tags are allowed.

Links

 * SubRip official site
 * Wikipedia: SubRip
 * Forum thread with some file format info
 * Videogrep: Automatic Supercuts with Python