[Vorbis] [Nico Sabbi] Re: [MPlayer-users] converting .rm video stream to .ogg

xiphmont at xiph.org xiphmont at xiph.org
Fri Mar 23 02:58:32 PDT 2007


On 3/23/07, Charles philip Chan <cpchan at sympatico.ca> wrote:

> OK, aacording to one mplayer developer, this is the problem:
>
> ,----
> | to make a long story short: with ogg files you can't make _anything_
> | unless you know well the inner working of the audio, video and subtitle
> | streams contained therein; this is exactly the opposite approach that
> | should be followed when designing a container because every single codec
> | type requires special handling; if you want to know how nice is handling
> | an ogg file read libmpdemux/demux_ogg.c, but be warned that it drives
> | people insane
> `----
>
> Can someone comment on this?

Sure.

Ogg allows a codec to define (in the codec spec, not runtime) how
timestamps are implemented out of a desire to allow the most efficient
possible implementation of positioning information.  Timestamps eat a
substantial portion of total stream overhead (or you have to use
really few of them, ala an AVI file with a single keyframe), and this
is a mechanism to squeeze more performace out of the bitstream, but
still give very fine grained timestamping.

When you install a codec, you also need to install a 'granpos' shim
into the muxer to interpret that timestamp type.  The magic for a
stream type is associated with the granpos shim type.  We're talking a
half page of code.  It does not require the whole codec, just the
shim.  Or you could just build all the known shims into your muxer
(and release a new muxer when new streamtypes pop up; some projects,
eg liboggz, do this).  New ones don't pop up all that often.

If you don't have that mux shim, you don't have the codec either, so
you'd not be able to do anything with that specific stream anyway.
You can perfectly well handle an Ogg stream with a stream type that's
unknown.  You just won't be able to do forward mux operations on that
specific internal stream without that shim.  You will still be able to
stream, demux, etc.

But... Since this approach doesn't fit into their design, and their
way is bordering on religious revelation at this point ("God said so!
Don't question it!"), they use Ogg as an excuse to do all the swearing
they'd be doing anyway.

Monty


More information about the Vorbis mailing list