[vorbis-dev] Determining stream type

Michael Smith msmith at xn.com.au
Sun Feb 4 15:15:47 PST 2001



"Martin C. Martin" wrote:
> 
> Hey Mike,
> 
> Thanks for the quick response.  How do the headers affect streaming
> currently?  i.e. if you tune in to an icecast boadcast half way through
> a song, does the server send a header packet, then skip the first half
> of the song, then send a middle-of-song packet?  I had pictured the
> decoder just picking up in the middle of a physical bitstream, but it
> seems the header info is needed to initialize the decoder.  Can you
> clarify?

Yes, that's pretty much correct. Vorbis absolutely requires the headers,
otherwise it doesn't even know what it's decoding. Crucial information
like the codebooks, the number of channels, etc. is contained within the
headers (only the first of 3 headers is needed for identifying as
vorbis, the 2nd and 3rd are also required before decode starts (losing
the second would be ok, but the code doesn't currently allow this).

A streaming server like icecast will (does) cache the headers, then send
them to the client on connect, before picking up the main stream. Later
logical streams (i.e different tracks) will have the headers sent
in-line. It's also useful to note that the server (at least in the case
of icecast 2) never sends packets. It doesn't actually know anything at
all about the packets - it just sends ogg pages. The pages to send as
the 'header' is determined from the granulepos given in the page header.

Michael

--- >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