[vlc-devel] issue arising from OggDirac muxing

David Flynn davidf+nntp at woaf.net
Tue Oct 28 23:56:30 CET 2008

On 2008-10-28, Laurent Aimar <fenrir at via.ecp.fr> wrote:
>  That is an error of the ogg muxer, it should not be done independantly
> (unless if ogg does not permit a stream to not start from something != 0).

Agreed; actually ogg can allow it, since if you join a stream (eg
icecast) everything is numbered from an arbitary point (iirc)

>  The proper fix would be to use the lowest DTS over all ES IF ogg allows it.

Correct, however:

>  If the video stream use reordering (1 for normal B, more for hierarchical B 
> like in h264), it will work.
>  The only "weird" thing might be that the lowest PTS value will not be 0 but
> reodering_max * frame_duration for CFR video.

Yes, what you call 'reodering_max * frame_duration' is oft called
pts_delay. which is the ammount added to pts of each stream (or
subtracted from dts in the case of vlc where you don't have an
integrated system).  The only place that this can be correctly done is
inside an encoder -- since it is the only thing that knows what the
reordering depth is.

Ogg unfortunately wasn't designed with video in mind.  We've had some
entertaining fun with over this.  The granulepos is in theory only
allowed to increase.  This is fine for audio (which isn't out of order)
or theora (likewise), so DTS===PTS.  however for anything with
reordering, you need to define what you are calling granulepos, they've
managed to require both aspects of DTS and PTS of it.  As a result there
is a fairly intricate coding of granulepos to encapsulate an aspect of
pts,dts and seek information.

> If not wanted then you have a problem because the initial DTS value would
> then be < 0.

There is no problem with that.  VLC might cry in some instances, but i
think thats something that needs fixing too.

>  I do not thing it is a problem (for example .mp4 specs does work like this).

btw, mp4 screwed up as well (see -ve ctts).

Ok, i'll have a look at normalizing against the lowest dts in the
morning, as long as any operation affects all ES, then it should be

More information about the vlc-devel mailing list