[vorbis-dev] Carrying non-audio data in an Ogg/Vorbis I stream

Peter Harris peter.harris at hummingbird.com
Mon Oct 28 12:33:47 PST 2002



> Hello,
>
> I would like to "piggy-back" other data in an Ogg/Vorbis I physical stream
> (i.e. file) in a manner that does not conflict with specifications and
> existing decoders/players/editors etc.
>
> As far as I can see, I have some possible choices:
>
> 1 - Chaining a logical bistream at the end. If this is the way to go, two
> questions arise to begin with:

Probably not the way to go.

> q1a - How to identify this stream in a future-proof way? Just invent a new
> header, beginning with 'm' 'y' 'h' 'e' 'a' 'd' 'e' 'r' ?

'myheader' is a little bit too generic. You probably want to find a more
descriptive name.

> 2 - Inserting non-audio packets in the actual stream. This situation is
> defined to be decoded as 'a non-audio packet when audio is expected
> indicates stream corruption or a non-compliant stream. The decoder must
> ignore the packet and not attempt decoding it to audio.'. The second part
of
> this is ok for my purpose, but I don't like the sound of the first part
> 'indicates stream corruption' etc. An overly ambitiuos decoder might flag
> this as an error for example.

Correct. This is a bad idea.

> 3 - Another choice, which for various reasons feel less satisfying, is to
> encode it as comments. The problem with this is first of all that it may
be
> attepmpted to be shown by decoders/players/editors, and second of all that
> the data in question may be *large* (i.e. significantly larger than the
> actual audio) - and it is unfortunate to have it at the front...

<p>Correct again. This is also a bad idea.

> 4 - Can I possibly just concatenate a completely separate Ogg stream at
the
> end of the first one? This seems to violate the constraints of an
Ogg/Vorbis
> I stream though.

Sure. Multiple Ogg files can be chained by 'cat' (or the weird 'copy /b + '
syntax on DOS/Windows). This is perfectly legal (and gapless).

> In general, is there really no defined way to introduce data into an
> Ogg/Vorbis I stream that is well-defined to be silently ignored by current
> decoders, without this implying an error, non-compliance or whatever?
>
> Ideas, comments - or just pointers to the appropriate specifications are
> appreciated.

You probably want to interleave your stream with audio, right? Take a look
at the ogmtools, oggmux, oggmerge and similar. They mostly seem to be
designed for a single purpose right now (audio+video+subtitles, or
vorbis+midi), but it shouldn't be too dificult to modify one of the above to
recognise your new custom stream.

Peter Harris

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