[FFmpeg-devel] Format of decoded text subtitles

Clément Bœsch ubitux at gmail.com
Wed Aug 1 23:03:54 CEST 2012

On Wed, Aug 01, 2012 at 10:41:16PM +0200, Nicolas George wrote:
> Le quintidi 15 thermidor, an CCXX, Clément Bœsch a écrit :
> > Are you sure it needs to be nested? The current decoders are transforming
> Everything and anything I just wrote is open for discussion, of course.
> > nested markup to "flat" one in ASS; I think it's best to keep that logic.
> > It will be simpler to convert the decoders at least. And we will limit the
> > ASS markup surprises.
> IMHO, one of the objectives is that decode+encode for the same codec is
> lossless or almost so. I believe that flat -> nested -> flat is easier to
> make lossless than nested -> flat -> nested.

I think that markup can be left unchanged to start with: no changes
required in the decoders. And I also think we should follow Michael's
recommendation about just extending the ASS markup to FFmpeg needs (the
only one "important" I see in the pure markup thing is text justification;
I don't think ASS has that). I'd propose to wait for the AS6
specifications (ASS++) to see if we can't just follow it.

If you're willing to store the markup in a nested form, it will mean a lot
of various heavy convert in a not handy structure (strings). At that point
we may consider to also parse and store the whole text markup in another
AST. That looks completely overkill to me, but at less messy than hacking
a string to make various flat/nested acrobatics.

Maybe we could have an alternative form in another field, but that sucks

> > We need to be *very* cautious when messing with the ASS event.  I'd
> > suggest you to have a deep look at libass/ass_{parse.c,types.h} before
> > planing anything. Think of Karaoke events at least.
> I'll have to look at it, clearly.
> > Looks sane.
> Do you think it can reliably represent the exotic codecs you know of?

I guess you'll hit some classic storage issues, such as how to make a sane
key/value system for palettes for example. I can't think of much more


Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120801/e8a7f8bf/attachment.asc>

More information about the ffmpeg-devel mailing list