[Vorbis-dev] ogg only encoding

Conrad Parker conrad at metadecks.org
Mon Jun 5 18:47:14 PDT 2006


Hi Stephen,

On Mon, Jun 05, 2006 at 09:34:43PM -0400, Stephen Whiters-Ridley wrote:
> So, I abandoned the hope of using the ogg python bindings to do pure ogg
> container encoding.
> I started looking at the libogg in the hopes of retooling the bindings to
> follow a better object model

> and it actually looks like the problem is down in libogg, not the bindings.
> Am I crazy or does libogg  rely on libvorbis to return ogg_packets,
> and that there are no functions that will build an ogg_packet for you from
> your own data like an array of bytes?

You're not crazy, libogg requires applications using it to construct
ogg_packet structures. Fortunately for libogg (not libogg2), this is
fairly simple, though libogg does not offer any helper functions for it.

The building of libogg does not depend on libvorbis, and using libogg to
do other things with ogg does not require libvorbis.

> It looks like API users are required to fill in all the meta
> fields of the ogg_packet themselves? Is this correct?

yes. The fields of the ogg_packet structure (particularly the
granulepos) are very dependent on the codec.

btw. if you're writing python bindings, perhaps have a look at binding
liboggz: http://www.annodex.net/software/liboggz/index.html
It wraps libogg and provides a somewhat clearer API (IMHO ;-) It can
also work out things like the bos, eos and packetno flags for you
automatically, though you still need to fill in the packet data and
granulepos; and it ensures that you don't insert invalid packets.

cheers,

Conrad.



More information about the Vorbis-dev mailing list