FILE FORMATS
A subtitle file format specifies the format of a file (text or image) containing the subtitle and timing information. Some text-based formats also allow for specifying styling information, such as colours or location of the subtitle.
Some subtitle file formats are:
- Micro DVD (.sub) - a text-based format, with video frame timing, and no text styling
- Sub Rip (.srt) - a text-based format, with video duration timing, and no text styling
- VOB Sub (.sub, .idx) - an image-based format, generally used in DVDs
- Sub Station Alpha / Advanced Sub Station (.ssa, .ass) - a text-based format, with video duration timing, and text styling and metadata information attributes.
- Sub Viewer (.sub) - a text-based format, with video duration timing, text styling and metadata information attributes.
Examples
Lets look at the actual content of some subtitle files. They will all be simply showing "This is my first subtitle!" in the first 10 seconds of video playback. These were all produced by the FOSS subtitling software Jubler.
The first thing to note is that each file is simply a text file, and is editable by any text editor, such as vi on GNU/Linux, or Text Edit on Mac, or Notepad on Windows.
The following is how our example is realised in a Micro DVD subtitle file (presuming 25 frames per second):
{0}{250}This is my first subtitle!
As a Sub Rip subtitle file:
1 00:00:00,000 --> 00:00:10,000 This is my first subtitle!
As a Sub Station Alpha (.ssa) file:
[Script Info] ; Edited with Jubler subtitle editor Title: Original Script: andycat Update Details: ScriptType: v4.00 Collisions: Normal PlayResX: 320 PlayResY: 288 PlayDepth: 0 Timer: 100,0000 [V4 Styles] Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding Style: Default,Arial Unicode MS,31,&HFFFFFF,&H00FFFF,&H000000,&H404040,0,0,1,0,2,2,20,20,20,255,0 [Events] Format: Marked, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text Dialogue: 0,0:00:00.00,0:00:10.00,*Default,,0000,0000,0000,,This is my first subtitle!
As an Advanced Sub Station (.ass):
[Script Info] ; Edited with Jubler subtitle editor Title: Original Script: andycat Update Details: ScriptType: v4.00+ Collisions: Normal PlayResX: 320 PlayResY: 288 PlayDepth: 0 Timer: 100,0000 [V4+ Styles] Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding Style: Default,Arial Unicode MS,31,&H00FFFFFF,&H0000FFFF,&H4B000000,&H4B404040,0,0,0,0,100,100,0,0,1,0,2,2,20,20, 20,0 [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text Dialogue: 0,0:00:00.00,0:00:10.00,*Default,,0000,0000,0000,,This is my first subtitle!
As a Sub Viewer (.sub) file:
[INFORMATION] [TITLE] [AUTHOR]andycat [SOURCE] [FILEPATH] [DELAY]0 [COMMENT]Edited with Jubler subtitle editor [END INFORMATION] [SUBTITLE] [COLF]&HFFFFFF,[STYLE]bd,[SIZE]18,[FONT]Arial 00:00:00.00,00:00:10.00 This is my first subtitle!
There are large numbers of file formats around (see http://diveintomark.org/archives/2009/01/07/give-part-4-captioning - the main ones mentioned by this article not covered here are MPEG4 Timed Text, SMIL and SAMI).
Comparisons of Formats
Tables of comparisons of subtitles file formats are found at the following:
http://www.annodex.net/node/8
http://en.wikipedia.org/wiki/Subtitles
Supported File Formats in FLOSS video players
A list of subtitles supported by the FLOSS video player, VLC, can be found at:
http://wiki.videolan.org/Subtitles