[Vorbis] ogg123 and Vorbis piped to stdin
Stan Seibert
volsung at mailsnare.net
Mon Dec 20 19:14:16 PST 2004
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
More information about the Vorbis
mailing list