View Full Version : .SUB format?


Sajan
19th August 2004, 07:41
Where I can find description of .SUB format?

smiller667
19th August 2004, 09:08
.sub as in vobsub (.idx/.sub-combination?) That is basically a stripped-down vob file.
.sub is just an extension, not a format - there are also textsubs with a .sub extension. Maybe post a sample if it is text-based?

Steve

Sajan
19th August 2004, 17:28
Originally posted by smiller667
.sub is just an extension, not a format - there are also textsubs with a .sub extension.
I understand this. But if I want to make a program which will work with .sub files I must know all the principles of construction this files. Is there description of such files anywere?

Besides, I've met two formats of .sub:
1.-----------------------------
{1}{1}29.970
{653}{716}PLANNING: Tailor Project
{716}{812}BASED ON A STORY BY:|Yoshioka Hitoshi
{812}{899}Irresponsible Captain TAILOR|Безответственный Капитан Тайлер.
2.-----------------------------
[INFORMATION]
[AUTHOR]
[SOURCE]
[PRG]
[FILEPATH]
[DELAY]
[CD TRACK]
[COMMENT]
[END INFORMATION]
[SUBTITLE]
[COLF]&HFFFFFF,[STYLE]no,[SIZE]18,[FONT]Arial
00:01:31.00,00:01:33.00
String1

00:01:34.32,00:01:36.72
String2

00:01:37.39,00:01:39.76
String3

smiller667
19th August 2004, 22:07
The first one is in MicroDVD format, the second one I don't recognize. If you realize .sub is just an extension and not a filetype, you should probably account for binary (i.e. .idx/.sub-vobsubs) in your application as well.

I don't know of a central repository for subtitle format specs, you might want to look at software like Subtitle workshop to learn about various formats or visit the sites of the respective creators of the format to find out more details.

Steve

McPoodle
8th September 2004, 05:50
The second example is Subviewer 2.0 format.

Somebody really should set up a subtitle format repository. I picked up what I know by an awful lot of Googling, followed by rummaging through source code. The only format I found properly documented was SSA/ASS, and that was included in VobSub, not available on SSA's webpage.

Anyway, here are all of the subtitle formats I know about that commonly use the extension .SUB:

* VobSub (paired with an .IDX file)--binary format.
* DVDSubtitle format:
{HEAD
DISCID=
DVDTITLE=Disney's Dinosaur
CODEPAGE=1250
FORMAT=ASCII
LANG=English
TITLE=1
ORIGINAL=ORIGINAL
AUTHOR=McPoodle
WEB=http://www.geocities.com/mcpoodle43/subs/
INFO=Extended Edition
LICENSE=
}
{T 00:00:50:28 This is the Earth at a time when the dinosaurs roamed...}
{T 00:00:54:08 a lush and fertile planet.}

Notes:
+ not sure of correct values for DISCID (string read from BCA?) and LICENSE
+ times are in HH:MM:SS:HH (hundredths of a second)
+ no formatting allowed

* MicroDVD format:
{1}{1}27.970
{8231}{8300}I already had an IQ test this year.|I don't think I've ever had one of these.
{8302}{8365}Reaction time is a factor in this,|so please, pay attention.

Format:
first line gives framerate (to 3 decimals)--alternate is {0}{0}30 (no decimals)
#'s are frames (so NTSC will be different from PAL)
"|" for newline
a line can be formatted by preceeding with {y:code}, where code can be any combination
of b, i, and u
{8302}{8365}{y:i}Later that night...

* Philips SVCD subtitle format:

# PHILIPS SVCD DESIGNER 1.5 - 2.0 SUBTITLES FILE
#
# GENERATED BY SubRip 1.32 on April 17, 2002
#
[HEADER]
TITLE Aliens
FRAMERATE NTSC # or PAL
DROPFRAME YES # or NO
CONTRAST (0 15 0 15) # background, font, outline1, outline2 from 0-15
COLOR (0 1 2 3)

[PALETTE]
0 (0, 0, 0)
1 (255, 255, 255)
2 (128, 128, 128)
3 (255, 0, 0)

[LIST]
movie.030.bmp 00:00:03:24 00:00:06:29 300 050 100 400
movie.031.bmp 00:00:10:07 00:00:12:21 300 050 100 400

Notes:
+ first parameter is name of graphic file
+ next two parameters are start/end times (in HH:MM:SS:FF format)
+ next two are width and height
+ last two are left and top coordinates
so, example as subtitles from (100, 400) to (400, 450)

* SubViewer 1.0 format:
[TITLE]
Aliens (EN)
[AUTHOR]
Okami111 (Mijo Rebic)
[SOURCE]
R1 DVD (Subtitles captured by SubRip)
[PRG]
SubRip
[FILEPATH]
C:\subs
[DELAY]
50
[CD TRACK]
0
[BEGIN]
******** START SCRIPT ********
[00:04:58]
LEADER:|Bio-readouts are in the green.
[00:05:00]

...
[END]
******** End Script ********

Notes:
| is line break

* SubViewer 2.0 format:
[BEGIN]
[INFORMATION]
[TITLE]Aliens (EN)
[AUTHOR]Okami111 (Mijo Rebic)
[SOURCE]R1 DVD (Subtitles captured by SubRip)
[PRG]SubRip
[FILEPATH]C:\subs
[DELAY]0
[CD TRACK]1
[COMMENT]
[END INFORMATION]
[SUBTITLE]
[COLF]&HFFFFFF,[STYLE]bd,[SIZE]18,[FONT]Arial
00:00:00.00,00:00:00.10


00:04:58.50,00:05:00.00
LEADER:[br]Bio-readouts are in the green.

...
[END]

Notes:
[COLF] style made up of "&H", font color in hex (RRGGBB), ",[STYLE]",
followed by "st" for strikeout, "ud" for underline, "bd" for bold,
or "it" for italics, ",[SIZE]", font size in points, ",[FONT]",
font name
times are HH:MM:SS.HH (hundredths)
[br] is line break
can use <b></b>, <i></i>, and <u></u> formatting (at beginning/end of line)
must have first blank subtitle at beginning

...and the most fun of all...
* TMPlayer format, which comes in five varieties:

time-base 00:00:00:
00:00:50:This is the Earth at a time|when the dinosaurs roamed...
00:00:53:
00:00:54:a lush and fertile planet.
00:00:56:

time-base 0:00:00:
0:00:50:This is the Earth at a time|when the dinosaurs roamed...
0:00:53:
0:00:54:a lush and fertile planet.
0:00:56:

time-base 00:00:00=
00:00:50=This is the Earth at a time|when the dinosaurs roamed...
00:00:53=
00:00:54=a lush and fertile planet.
00:00:56=

time-base 0:00:00=
0:00:50=This is the Earth at a time|when the dinosaurs roamed...
0:00:53=
0:00:54=a lush and fertile planet.
0:00:56=

and multiline time-base 00:00:00,1=
00:00:50,1=This is the Earth at a time
00:00:50,2=when the dinosaurs roamed...
00:00:53,1=
00:00:54,1=a lush and fertile planet.
00:00:56,1=

* Finally, there's one .sub format I've never seen documented: SubSonic.