[MPlayer-dev-eng] [PATCH] libass: fix parsing of tracks extracted from containers

Aurelien Jacobs aurel at gnuage.org
Thu Sep 11 00:31:40 CEST 2008


Evgeniy Stepanov wrote:

> On Tuesday 09 September 2008 18:32:22 Aurelien Jacobs wrote:
> > > I completely agree with this. There is no reason to prefer .ass format to
> > > the one used in Matroska containers.
> >
> > Well, let's see.
> > Here we have 2 different formats. One which can contain the subtitle
> > display duration through the mean of start time and end time (aka .ass
> > format) and one which can't store this information (aka matroska's ass
> > format). Matroska is the only container which can store display duration by
> > itself. So matroska's ass format can't be used in any other container. So
> > it just can't be used as a kind of universal format.
> > The only format left is standard .ass format (unless you can show me
> > another more popular format which can store display duration by itself).
> > I don't say that standard .ass is perfect or anything, but that's the least
> > worst format we have which contains display duration, and no one came up
> > with anything better up to now.
> 
> I like this patch in general. If the demuxer is that intelligent, ReadOrder is 
> not needed at all.

Good.
I guess I will just apply it when I switch to lavf matroska demuxer by
default again.

> But why does the contents of demux packets have to contain display duration? 

Well, this was explained numerous time lately, but this was probably
hard to follow, and I think you deserve an explanation.

> This information is already available from other packet fields.

Only in the matroska container. This is very specific to matroska.
Other containers has means to store to duration of subtitle packets.
So this information has to be part of the packet data itself.

> Imagine that 
> you want to apply some transformation to start time and/or duration of a group 
> of packets. For video and audio packets, changing corresponding packet fields 
> is enough, while for subtitle packets you also have to edit packet contents.

You anyway have to edit the packet contents to fix the timestamps/duration
used in the karaoke-like animations...

> What about storing them like they are in matroska, but without a ReadOrder 
> field?

Hum... I have nothing against ReadOrder ! The only problem with ReadOrder
is that it don't fit in spec compliant ASS, so I wasn't able to put it
in. And as it's pretty much useless, that's not really a problem.

> If a container does not support packet durations, it's muxer can rebuild 
> .ass format or whatever.

So virtually every muxer would need to rebuild .ass format (or anything
containing display_duration) except matroska.
On the other hand, when using standard .ass as an interchange format
between muxers/demuxers/decoders, only matroska has to do some specific
handling.

The main point is that we don't want a matroska/libass player. We want
a container agnostic and decoder agnostic multimedia framework.

Aurel



More information about the MPlayer-dev-eng mailing list