XSUB: Difference between revisions

From MultimediaWiki
Jump to navigation Jump to search
(Correct license)
No edit summary
Line 5: Line 5:
* [http://drdivx.svn.sourceforge.net/viewvc/drdivx/DrDivX/trunk/drffmpeg/libavcodec/xsub.c?view=markup LGPL DivX subtitle encoding for ffmpeg source]
* [http://drdivx.svn.sourceforge.net/viewvc/drdivx/DrDivX/trunk/drffmpeg/libavcodec/xsub.c?view=markup LGPL DivX subtitle encoding for ffmpeg source]


'''XSUB''' is the subtitle format used in DivX 6 files. Little is known about it.
'''XSUB''' is the subtitle format used in DivX 6 files.
 
Each packet consists of a header and after that RLE-encoded data.
The header starts with timing information in the format (27 bytes, no terminating zero):
[HH:MM:ss.mmm-HH:MM:ss.mmm]
Then, encoded as 16 bit little endian except for the colour entries, follow:
width of encoded image
height of encoded image
x coordinate of top left subtitle corner
y coordinate of top left subtitle corner
x coordinate of bottom right subtitle corner
y coordinate of bottom right subtitle corner
length of the RLE data
four colour entries (red, green, blue, eight bits per component, unsigned)


Width, height and coordinates probably all must be a multiple of 2.
It is unclear what the behaviour is if the coordinates are not consistent with width and height, the encoder does not produce such files.


After this follows the RLE-encoded data.
Missing: specification of RLE-encoding used.


[[Category:Subtitle Formats]]
[[Category:Subtitle Formats]]

Revision as of 04:07, 4 August 2007

XSUB is the subtitle format used in DivX 6 files. Each packet consists of a header and after that RLE-encoded data. The header starts with timing information in the format (27 bytes, no terminating zero):

[HH:MM:ss.mmm-HH:MM:ss.mmm]

Then, encoded as 16 bit little endian except for the colour entries, follow:

width of encoded image
height of encoded image
x coordinate of top left subtitle corner
y coordinate of top left subtitle corner
x coordinate of bottom right subtitle corner
y coordinate of bottom right subtitle corner
length of the RLE data
four colour entries (red, green, blue, eight bits per component, unsigned)

Width, height and coordinates probably all must be a multiple of 2. It is unclear what the behaviour is if the coordinates are not consistent with width and height, the encoder does not produce such files.

After this follows the RLE-encoded data. Missing: specification of RLE-encoding used.