]> git.sesse.net Git - vlc/blob - doc/subtitles/svcd-ogt-subtitles.txt
A start for what little public documentation there is for CVD and OGT
[vlc] / doc / subtitles / svcd-ogt-subtitles.txt
1 $Id: svcd-ogt-subtitles.txt,v 1.1 2004/01/04 16:25:00 rocky Exp $
2 The following information is culled from information from 
3 Julio Sanchez Fernandez (http://subhandler.sourceforge.net)
4 by Rocky Bernstein. 
5
6 SVCD subtitles are transported in private streams with id 0x70 (AC3
7 has 0,x80+, CVD subs 0+)
8
9 All numbers are in big-endian and the image is interlaced with a
10 resolution of 720x480 (ntsc) or 720x576 (pal)
11
12 Data packets start with a 4 byte sequence number (Stream number(1),
13 Packet number(1*), Subtitle number (2)) (*) this starts at 0, the last
14 packet of a subtitle has the 7th bit set (the subtitle can be broken
15 up into several packets when it is multiplexed into the mpeg stream)
16
17 Subtitle Header (size in bytes):
18
19 Packet length (2) (the assembled subtitle, with stripped sequence
20 numbers) Option byte (1) normally set to 0x2e, bit 3 indicates that a
21 field with the display-time of the subtitle is present.  what the
22 other bits does is unknown.
23
24 Time to display the sub (4) in 1/90000'th of a second (only present if
25 bit 3 above is set)
26 Xpos (2)
27 Ypos (2)
28 Width (2*)
29 Height (2*)
30 * should be even
31
32 This only implies HOW LONG the subtitle will be shown, not when. That
33 is given by the PTS in the PES header.
34
35 Uknown Byte(1) 
36
37 4 Palette Entries formated like:
38 Y (1)
39 U (1)
40 V (1)
41 Transparency(1)    (0 = transparent)
42
43 Command (1) 
44 >>6: 1 shift command, (cmd>>4)&3 is the direction (0=top, 1=left, 2 = right, 3 
45 >>= bottom)
46
47 Odd-field data offset (2)
48
49 Then image data follows, and is formatted like this:
50 2 bit codes are used so 01 means 1 pixel of color 1,
51 10 means color 2 etc.
52
53 Lines are padded to complete bytes, field 0 is padded to an even byte
54 length and finally subtitles are padded to a multiple of 4 bytes
55 (always atleast 1 zero byte at the end)
56
57 Philips SVCD tools can create SVCD subtitles, but it only works under
58 NT4, (and not that easy to find anymore.. dvd.da.ru, doom9.net or
59 similar perhaps?), it can create good subtitled svcds and just open
60 them in your favorite hex editor ^_^
61
62 The subs you get from tools like "I-author" are not real SVCD
63 subtitles, they are CVD sub and I don't know anything else about them
64 except for that they look similar to dvd subs but the RLE encoding and
65 command format is different.