[Vorbis] Re: ogg123 and Vorbis piped to stdin

Andy Baxter andy at earthsong.free-online.co.uk
Sun Jan 2 08:02:27 PST 2005


On Mon, 20 Dec 2004 21:14:16 -0600, Stan Seibert wrote:

> Barry Bouwsma wrote:
> 
>> Second, I've noticed that `ogg123' isn't able to play streams that
>> do not start with an Ogg header or such -- for example, long ago,
>> when I tried to stream an Ogg Vorbis file by the same means I was
>> streaming mp3, it didn't work -- unless I used the software which
>> inserted the header before streaming the data on the proper
>> bondaries.
>> 
>> Now, I see the same thing using stdin, if I'm trying to seek within
>> an Ogg Vorbis file with `dd' piped to my hacked `ogg123'.  Should it
>> in theory be possible for `ogg123' to do the same thing on an Ogg
>> stream that, say, `mpg123' does, which is to seek until a passable
>> frame header is found, and then try to play that, sometimes even
>> getting the frame header right?
> 
> This isn't a limitation of ogg123, but rather a limitation of Vorbis. 
> Vorbis has 3 header packets which are required in order to be able to 
> decode the bitstream.  Unlike MP3, which has frame headers periodically, 
>   Vorbis headers occur only once at the beginning of the stream because 
> they can be rather large (usually ~4kB).
> 
> Streaming tools like icecast have to cache these headers and insert them 
> into the beginning of the stream for new clients when they first connect.
> 
> Vorbis itself has no concept of the "frame header", though the Ogg 
> container it usually lives in is composed of "pages" which have headers. 
>   Once the Vorbis codec has been initialized with the approprate 
> codebook headers, you could jump to a random point in the file and scan 
> ahead until the next Ogg page and resume decoding from there.
> 
> ---
> Stan Seibert

how does this work when encoding live? (i.e. when the whole file isn't
available before you start encoding) I thought the point of the headers
was that they contain a codebook which has been generated from the
specific frequency distribution of the file that's been encoded, but if
you're streaming a live source, this must work differently.




More information about the Vorbis mailing list