[FFmpeg-devel] Internal handling of subtitles in ffmpeg
Michael Niedermayer
michaelni
Thu Jan 1 22:56:00 CET 2009
On Thu, Jan 01, 2009 at 06:16:07PM +0100, Reimar D?ffinger wrote:
> On Thu, Jan 01, 2009 at 04:19:49PM +0100, Michael Niedermayer wrote:
[...]
> > 2. How should mixed bitmap and text formats be represented?
> > Your suggestion requires a bitstream filter to convert to ASS and then from
> > ASS, but does ASS support bitmaps in every pixel format we would need,
> > besides how to put this in the char * ?
>
> I think ASS does not support bitmaps at all, only the next version with
> some other name IIRC. But I'd expect it would also support rotating
iam not following the subtile scene too closely but i know that
"Sub Station Alpha v4.00+ Script Format"
contains:
Picture: This is a "picture" event, which means SSA will
display the specified .bmp, .jpg, .gif, .ico or .wmf
graphic.
[...]
7. Picture event lines, [Events] section
These contain the same information as Dialogue events, but Field 10
contains the full path and filename of the picture to display, instead of
subtitle text.
The Style specified is ignored. The "scroll up" transition effect can be
used for picture events.
The Left and Vertical Margin Overrides specify the bottom-left corner
position of the picture. A left margin of all zeroes means that the picture
will be horizontally centered. A vertical margin of all zeroes means that
the picture will be vertically centered.
[...]
Appendix B: embedded font/picture encoding
SSA?s font and picture file embeddeding is a form of UUEncoding.
It takes a binary file, three bytes at a time, and converts the 24bits of
those bytes into four 6-bit numbers. 33 is added to each of these four
numbers, and the corresponding ascii character for each number is written
into the script file.
The offset of 33 means that lower-case characters cannot appear in the
encoded output, and this is why the ?filename? lines are always lower case.
Each line of an encoded file is 80 characters long, except the last one,
which may be shorter.
If the length of the file being encoded is not an exact multiple of 3, then
for odd-number filelengths, the last byte is multiplied by hexadecimal 100,
and the most significant 12 bits are converted to two characters as above.
For even-number filelengths, the last two bytes are multiplied by
hexadecimal 10000, and the most significant 18 bits are converted to three
characters as above.
There is no terminating code for the embedded files. If a new [section]
starts in the script, or if another filename line is found, or the end of
the script file is reached then the file is considered complete.
----------------
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090101/74e4587a/attachment.pgp>
More information about the ffmpeg-devel
mailing list