[Vorbis] Stream "Saving" and Excerpting...
Jason M. Sullivan
jsullivan at nc.rr.com
Wed Sep 28 06:15:55 PDT 2005
On Tue, Sep 27, 2005 at 09:31:22PM -0700, Ralph Giles wrote:
> On Tue, Sep 27, 2005 at 07:41:12PM -0400, Jason M. Sullivan wrote:
>
> > 1) The "chunk" files I'm saving into have mangled headers.
>
> Mangled as in missing? one has to take special care to prepend
> the bitstream headers before starting a new spool file. vcut
> is a start on how to do this, but doesn't cover all the edge
> cases, so watch out there. That's why it's not enabled in the
> default build. :)
The headers are there, but the serial number is 0, and the granule position
is 0, leaving a big gap between the header, and the first granule (which
has been counting since I started the encoder). The saver doesn't renumber
the granules. Since I don't use the chunks directly, I might not even need
a header, but that might require special fiddling to get working.
> > 2) The "reassembled" files also have mangled headers.
>
> Again, you'll have to be more specific about "mangled how"
> before we can help, unless it's just a consequence of the
> above.
I have pretty much the same problem with the reassembled files as I do the
chunks.
> These are part of the libvorbis API, which has no documentation.
> (As opposed to libvorbisfile and libvorbisenc.) You have to make
> do with the header file "vorbis/codec.h" and the example source.
>
> Documentation patches welcome. :)
Heh.
> > I'm also wondering if I'm going about this all wrong, since there doesn't
> > seem to be any easy way to do what I'm doing. All the API calls seem to be
> > centered on encoding and decoding, rather than simply cutting and splicing
> > encoded packets.
>
> Yes, you should be able to do the break and reassembly without using
> libvorbis at all (although it can be helpful for parsing the headers).
> For most streams, you can just cut and paste at Ogg page boundaries,
> prepend/strip the pages with the header packets as necessary, and
> call it done. There are again edge cases; it depends on your source
> whether you'll have to work harder than that.
>
> You might also look at the icecast code, which does stream assembly
> in a different context. There's also mod_annodex and mod_oggchef,
> which essentially already do what you're talking about, but have
> different code bases (read: utility libraries). They might be worth
> a look as well.
Thanks for the help! I'll take a look at that.
--
//// Jason M. SULLIVAN jsullivan at nc.rr.com
|c-oo http://www.jason0x21.org
\_- "That's not music, that's just sound!" - J. David Fries
More information about the Vorbis
mailing list