[Vorbis-dev] Seeking in WebM

Brendan Bolles brendan at fnordware.com
Fri Sep 13 10:23:48 PDT 2013


Hi everyone, I'm working on a WebM plug-in for Premiere.  You probably already know that WebM is a Matroska container that uses Vorbis for audio compression.  I'm pretty new to the world of audio compression and need some help.  You can see my code here:

http://github.com/fnordware/AdobeWebM


First of all, I wonder if it's possible to seek to an exact audio sample in WebM.  Whereas an Ogg page provides you with the granule position, Matroska provides a much less precise timecode, measured in milliseconds.  So the second frame at time 41.6666ms gets rounded to 42ms in Matroska.  If I seek using the Matroska timecode use it to calculate the granule position, I am off by a little.  It's probably fine for playback, but Premiere asks me for audio at random times and they really should line up exactly.


Secondly, it appears to me that I don't have any control during the encoding phase over how many samples are included in an Ogg packet, is that correct?  I just feed libvorbis audio samples and watch as it produces packets, which I save in the Matroska file.  But since I need to fit audio into these Matroska frames of a specific duration, I think I need to have a way to cut it off at a certain time but still connect seamlessly to the packet(s) at the next frame.


Any advice is greatly appreciated.  As are any references for me to learn more about this stuff.


Brendan



More information about the Vorbis-dev mailing list