[Vorbis] Re: New Media Codec: Audio, Video & Atmosphere Lighting help

Ian Malone ibmalone at gmail.com
Sun Mar 9 08:55:01 PDT 2008


paul griffiths wrote:
> MIDI and DMX(Disco lighting control) is not the same thing, does anyone have
> a simple example ogg stream so i can adapt it to accept dmx data?
> 
> pulling apart theora or vorbis to create a new codec is not a clean way, i
> need some simple code to start off from. surely there is an example on the
> net of how to create a new ogg codec?
> 

Not as such, as far as Ogg is concerned all you're doing is putting
in packets from your codec.  For that you may want to look at
liboggz <http://www.annodex.net/software/liboggz/html/> or libogg
<http://xiph.org/ogg/doc/libogg/> (liboggz is a higher level interface
and probably better if you want to create a new codec).  liboggz also
has example source code demonstrating how to read and write packets.

Essentially you need:
1. An ident header to identify the stream type and provide essential
   information (e.g. version number, Vorbis provides frequency and number
   of channels.
2. A granulepos <> time scheme and metrics to go in skeleton.
   <http://wiki.xiph.org/index.php/Ogg_Skeleton>
(3. End of stream packet, required but doesn't require any thought.)

You may have:
1. Additional setup headers, things like channel mappings go here.
2. Data packets.

For simpler examples of codecs used in Ogg you may want to look at
OggPCM <http://wiki.xiph.org/index.php/OggPCM_Draft2> and
<http://wiki.xiph.org/index.php/CMML>.  You may also want to look at
OggKate <http://wiki.xiph.org/index.php/OggKate>, currently being
developed as a subtitle codec.

My knowledge of DMX is limited to five minutes on the wikipedia
article, but it looks like your problem will be working out channel
mappings (is this a laser or a smoke machine type questions).
Actually, you might be better off with designing a more flexible
control protocol to put in Ogg and have a decoder that generates
DMX instructions from it.  It may be possible to do that in CMML.

-- 
imalone


More information about the Vorbis mailing list