[Vorbis-dev] Large Packets and page size...

Monty xiphmont at xiph.org
Wed Sep 22 11:23:01 PDT 2004




On Thu, Sep 23, 2004 at 10:10:57AM -0700, Josh Coalson wrote:
> --- Monty <xiphmont at xiph.org> wrote:
> > On Thu, Sep 23, 2004 at 07:04:24PM +0800, illiminable wrote:
> > > I'm just wondering about some guidelines on page size... For
> > example if you 
> > > have a stream where all packets are consistently of size > 40,000
> > bytes 
> > > (but less than 65000), is it appropriate to just put them 1 per
> > page ie 
> > > have large pages.
> > 
> > Guidelines for page size are 'what makes the most sense'.  The 4kB
> > rule of thumb was for Vorbis, not other codecs.  Generally you want
> > to
> > choose page size with overhead, latency and mux granularity in mind.
> 
> FLAC is one of those codecs where the packets can be large
> (10-30k)... as far as I could tell though, the nominal 4k page
> size is hard-coded into libogg and there was no way to really
> use a larger page size without writing a custom version of
> ogg_stream_pageout(), thus exposing the app to
> ogg_stream_state internals.
> 
> is this the case or is there another way of doing it entirely
> with libogg?

There's no exposed libogg1 API to doing it.  I had intended us to have
transitioned over to libogg2 some time ago, but this was another
example of by eyes being bigger than my code.

It would be easy to add, and probably we should since libogg2
migration is taking time; the easiest way would be to add a call to
turn off the 4kB autoflush and let the application worry about
flushing explicitly. 

Monty


More information about the Vorbis-dev mailing list