[vorbis-dev] Vorbis files merging

Ralph Giles giles at xiph.org
Thu Sep 19 06:50:29 PDT 2002



On Thursday, Sep 19, 2002, at 13:05 Europe/London, Vitaly Nechyos wrote:

> I have some questions dealing with merging Ogg Vorbis files.
> Suppose I want merge two Ogg Vorbis files encoded with the same 
> parameters
> into one file that composed of one logical bitstream. In this 
> connection
> some questions:

I suppose you know you can simply concatenate the files? The decoder 
will just parse the new header as it comes along.

> A) Are codebooks in file headers depend only on Vorbis version and
>     encoding parameters and don't depend on the particular source file?

If you're going to do this you should explicitly compare the header 
data.

> B) Are the following steps enough to do merging?:
>     - unset e_o_s flags in the last packet of the first file;
>     - unset b_o_s flags in the first packet of the second file;
>     - write additionally to the first file data data from the second 
> file,
> which
>       located after headers of the second file, at the same time 
> changing
> granuleposes
>       and packetnos for packets from the second file;

You've also have to rewrite the logical stream id. Otherwise this 
should work if the headers are indeed equivalent.

HTH,
  -r

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis-dev mailing list