[FFmpeg-devel] [PATCH] OGG/Dirac demuxing

Måns Rullgård mans
Mon Jan 26 04:02:55 CET 2009


Peter Ross <pross at xvid.org> writes:

> On Mon, Jan 26, 2009 at 01:32:33AM +0000, M?ns Rullg?rd wrote:
>> Peter Ross <pross at xvid.org> writes:
>> 
>> > Patch enclosed for our favorite file format.
>> >
>> > +static uint64_t
>> > +dirac_gptopts(AVFormatContext *ctx, int idx, uint64_t gp)
>> > +{
>> > +    return gp >> 22;
>> > +}
>> 
>> It's not that simple.  Not by far.
>
> Disagree. The Dirac encapsulation specification removes much of the complexity
> you are hinting at:
>
>  1. the upper 32-bits of the 'granule_position' field indicates the picture
>       number (display-ordered).
>  2. no more than one picture encapsulated per 'ogg packet'
>  3. one 'ogg packet' should be terminated per 'ogg page'
>  4. 'ogg packets' should not continue/span over pages.
>
> Yes, points 3 & 4 are shoulds, not shalls. So it is conceivable that somebody
> may create an OGG/Dirac file with multiple packets per page. IMHO, such an
> edge case is not evening worth thinking about, unless somebody supplies an
> .ogg file demonstrating this behaviour.

We should extract the DTS as well.  It's encoded in there, and it
would be silly to discard it.

I should never have written that demuxer...

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list