[theora] Add an intro to a theora file without re-encoding?

yorn at gmx.net yorn at gmx.net
Tue Jul 21 09:29:24 PDT 2009


> Thank you very much for this small script. It's a very good workaround.
> This way, I can complete my script without putting too much stress on
> Yorn.

;-) 

Now I remember the thing with vorbis (and the reason, why i think video is easier ;-)). It is some time ago that I worked out the granule position interpreter for oggCat etc.

However, please correct me, when I am telling something wrong: 
The thing is, that vorbis splits audio samples into blocks of equal size (there are two block sizes, which are defined in the header). This means a file could not end "anywhere" but it must fit into these boundaries. When the vorbis encoder encodes the last packet, it sets the granule position to the last sample number, that should be played. Even if there are more samples available within the block, they will not be decoded. 

Here is a problem in my c++ vorbis wrapper, that does not do this correctly, as it worked on block basis. I can solve this very easily ..

But it would not help you in any way because ..

Now the problem with concatenating vorbis files: What oggCat does is that it (in theory) deletes the End-Of-Stream marker and add the next stream as it is. So the information of the correct end position (the last sample) gets lost and the audio stream is "a bit" longer. 

I am not sure, if there is a way to do the vorbis concatenation more clever without any reencoding!?

If you want to concatenate and cut in "high quality" I always recommend using some programs, that do reencoding.  

So as an essence:
You can savely use oggSilence if you like (I solved some minor things this evening - especially the granule position setting) as if you use it with oggCat you'll have the same effect as with the step wave -> vorbis.

Anyway: I have to think about the vorbis wrapper ... 

- Yorn



More information about the theora mailing list