On 13 October 2010 18:40, Tim Gustafson <tjg at tgustafson.com> wrote:
> Is there any sample code out there that might give me a sort of "bare
> bones" example of how to create an Ogg streaming server that would
> produce a video/audio stream suitable for consumption by the HTML5
> VIDEO element? ?The video being streamed will be generated dynamically
> using libGL. ?I have the pixel data for each frame of the libGL
> rendered image available to me, so really I am looking for an example
> that will let me take raw RGB pixel data, convert it to an Ogg stream
> and send it to users over HTTP.
Two parts to this. First, Ogg was designed as a streaming container,
so any Ogg stream can be sent over HTTP to a player like the HTML5
video element and work just fine. No special "streaming server"
software is necessary to make this work like it is for some other
containers.
Second, if you have more than one client watching the same 'live'
stream, there's the problem that the vorbis and theora codecs have
decoder setup headers at the beginning of the stream, and each new
client needs a copy of those to configure the decoders before it can
start playback at the current position. Dealing with this generally
does require special software on the server side, which pastes of copy
of the headers cleanly onto the front of the current stream data. The
icecast streaming server (see icecast.org) does this as a standalone
server, optimized for many clients receiving a small number of
streams. The oggz-chop software (see xiph.org/oggz) can work as a cgi
script called by a normal web server to construct custom versions of
existing Ogg resources based on query parameters; that's more useful
for accessing archived material.
Hopefully that gives you plenty to look at. :)
-r