[FFmpeg-devel] [PATCH] Fix for ogg timestamps when packets span multiple ogg pages

Michael Niedermayer michaelni
Thu Nov 13 12:43:24 CET 2008


On Wed, Nov 12, 2008 at 11:01:13PM -0500, David Conrad wrote:
> On Nov 11, 2008, at 5:07 AM, Michael Niedermayer wrote:
> 
> > On Tue, Nov 11, 2008 at 04:22:38AM -0500, David Conrad wrote:
> >>
> >> On Nov 9, 2008, at 3:58 AM, Michael Niedermayer wrote:
> >>
> >>> On Sun, Nov 09, 2008 at 09:49:00AM +0100, Michael Niedermayer wrote:
> >>>> On Sun, Nov 09, 2008 at 02:48:01AM -0500, David Conrad wrote:
> >>>>> On Nov 6, 2008, at 5:51 PM, David Conrad wrote:
> >>>>>
> >>>>>> Hi,
> >>>>>>
> >>>>>> The problem with the current code comes from how an ogg page with
> >>>>>> only a
> >>>>>> partial packet uses the special granulepos of -1. The granulepos
> >>>>>> needs to
> >>>>>> be saved from the last page that completed a packet until the
> >>>>>> next page
> >>>>>> that completes a packet, where it is the timestamp of the first
> >>>>>> complete
> >>>>>> packet.
> >>>>>
> >>>>>
> >>>>> After looking at ogg granule_position some more, there's another
> >>>>> problem in
> >>>>> that Dirac and ogm both assume that the timestamp is the beginning
> >>>>> of the
> >>>>> associated packet, wheras Xiph codecs define the granule as the
> >>>>> time after
> >>>>> the associated packet is fully decoded (I'm assuming, I've only
> >>>>> found
> >>>>> Vorbis and Theora to do so explicitly.)
> >>>>
> >>>> older versions of theora also use the ogm variant IIRC
> >>>> also see the (non working AFAIK) hack in theora_gptopts() about  
> >>>> that
> >>
> >> Are you sure r15785 isn't not working? Or were you thinking of
> >> something else?
> >> And you're right, Theora < 3.2.1 does use the granule as frame start.
> >
> > I was thinking of 15785 but i did not test it, so maybe iam wrong,  
> > its a
> > while since ive looked at theora in ogg. But i think the current  
> > code is
> > not guraneed to produce correct timestamps for some ways of  
> > distributing
> > theora packets in ogg pages.
> > Also i suspect the keyframe flags will be wrong, this could be checked
> > easily by printing demuxer and vp3_parser.c found keyframe flags.
> > But again, this is just foggy memory and gut feeling ...
> 
> 
> The only way I can think that the current code could be wrong (or not  
> equivalent to interpreting the granule as frame start time) would be  
> if the dts didn't increase by one each frame. But afaik that's  
> required of theora in ogg.

Thats not what i meant, i thought there was a version of the spec that
had a different definition for granulepos, that is one not equivalent
to "start or end time of the last finished frame"

I cant find that though now, so maybe iam wrong ...

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Concerning the gods, I have no means of knowing whether they exist or not
or of what sort they may be, because of the obscurity of the subject, and
the brevity of human life -- Protagoras
-------------- 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/20081113/d9948644/attachment.pgp>



More information about the ffmpeg-devel mailing list