[vorbis-dev] Calculating vorbis packet durations...

illiminable ogg at illiminable.com
Tue May 18 05:40:59 PDT 2004



----- Original Message -----
From: "Adriano Almeida" <adriano at continuum.com.br>
To: <vorbis-dev at xiph.org>
Sent: Tuesday, May 18, 2004 8:15 PM
Subject: Re: [vorbis-dev] Calculating vorbis packet durations...

<p>> I had this problem and after a "few"searches I came to this method:
>
> first decode and setup the ogg file until the point u find the modes
> configuration.
>
> If u have the previous page, save the granule postition.

That's what i'm currently doing, but it's a problem after a seek
particularly in multi-stream files, as you need to find a previous page of
all streams which is not practical.

> while( !endOfPackets)
>     {
>     getPacket;
>     check if this is and audio packet;
>     read window configurations;

What is this window configurations... i'm not very familiar with the vorbis
packet structure, as i use a wrapper to libvorbis. Could you perhaps tell me
what the field names (or their byte positions ) in the packet are for this ?

>     thisPacketSize = previousPacketWindowSize/4+ thisPacketWindowSize/4;

So this means that you still can't get an accurate result without the
previous page ?

>     packetsGranule += thisPacketSize;
>     realGranule = lastPageGranule+packetsGranule;
>     }
>
> if u want u can save packets granule inside a realgranule vector. I
haven't
> covered the case where the page is a continued page
>
>
> Hope it helps
>

Thanks for the help.

Zen.
>
> ----- Original Message -----
> From: "illiminable" <ogg at illiminable.com>
> To: <vorbis-dev at xiph.org>
> Sent: Tuesday, May 18, 2004 6:59 AM
> Subject: [vorbis-dev] Calculating vorbis packet durations...
>
>
> > After a few other attempts at hacks to determine start times of pages,
the
> > only other option left is to partially decode the packets in the demuxer
> in
> > order to give correct start time stamps after a seek.
> >
> > Someone mentioned it was relatively easy to do without a full decode.
I've
> > had a bit of a search in the mailing lists and on the web and can't find
> any
> > details about it.
> >
> > What i need is to be able to calculate the duration of all complete
> packets
> > on a page such that i can subtract it from the end granule pos.
> >
> > Can someone point me to some psuedo-code or actual code of how to do
this
> ?
> > I assume the info needed is stored somewhere in the vorbis packet. I'm
> also
> > looking for the same information for speex also.
> >
> > Thanks
> >
> > Zen.
> >
> >
> >
> > --- >8 ----
> > List archives:  http://www.xiph.org/archives/
> > Ogg project homepage: http://www.xiph.org/ogg/
> > To unsubscribe from this list, send a message to
> 'vorbis-dev-request at xiph.org'
> > containing only the word 'unsubscribe' in the body.  No subject is
needed.
> > Unsubscribe messages sent to the list will be ignored/filtered.
>
> --- >8 ----
> List archives:  http://www.xiph.org/archives/
> Ogg project homepage: http://www.xiph.org/ogg/
> To unsubscribe from this list, send a message to
'vorbis-dev-request at xiph.org'
> containing only the word 'unsubscribe' in the body.  No subject is needed.
> Unsubscribe messages sent to the list will be ignored/filtered.
>
>
>

<p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis-dev mailing list