[Vorbis] Basic Doubt on Packets and Pages

Michael Smith msmith at xiph.org
Mon Sep 5 01:34:58 PDT 2005


On 9/5/05, Ravi Lakkundi <ravilakkundi at yahoo.co.in> wrote:
> Hi All,
> 
> Sorry if this is too much silly. Vorbis encoder gives
> out packets of information.
> 
> 1. Is it that each packet contain information of one
> frame/window either 256 / 2048 or any length set by
> encoder? If yes then the encoded packet will be
> variable in length.

Right.

> 
> 2. Every packet is divided into segments, how does the
> encoder decide on number of segments in each packet?
> It must be dependent upon page length right?

No. In a single packet, all segments except the last are 255 bytes (if
the packet is less than 255 bytes, there's only a single segment). The
final segment is less than 255 bytes. This is mandated by how ogg
works.

> 
> 3. Segments are encoded into pages, (max page length
> is 64k), how does the encoder decide upon the page
> length?
> 

libogg flushes a page, by default, when it's just over 4 kB. 

> In short iam confused about lengths of packets and
> pages? Can somebody please explain me this.
> 

Hopefully my answers above helped a little. You should read through
the ogg documentation, though.

Mike


More information about the Vorbis mailing list