[Matroska-devel] Opus audio codec

Ralph Giles giles at thaumas.net
Thu Dec 15 22:41:47 CET 2011

On 15 December 2011 00:12, Moritz Bunkus <moritz at bunkus.org> wrote:

>> [keep 'OpusHead' string in matroska]
> True enough, so let's just keep it.

Ok, sounds good.

> What I don't like is having a comment header in
> CodecPrivate as it circumvents Matroska's tagging system.

I'm fine with leaving the comment header out of CodecPrivate.

A more detailed question: how does the 'preskip' value in the header
interact with timestamps?

The idea with the pre-skip is that the decoder has exponentially
decaying filters, meaning if you feed a freshly allocated decoder
frames from the middle of a stream, after a seek for example, the
first few hundred milliseconds of output will be different than if the
decoder had been feed the previous audio frames.

The OpusHead 'pre-skip' field lets a muxer prepend extra data to help
the decoder converge before samples are output. For example, when
cropping a stream, a muxer can prepend ~500ms of data from before the
cut point, and then set the pre-skip field to 24000 samples, asking
the playback engine to discard those samples. This also allows
lossless sample-accurate cropping, since the pre-skip can indicate
playback start in the middle of a frame.

My question is, how do we timestamp those initial clusters, if some of
the samples from them are to be discarded? If playback starts with
e.g. sample 24000, what TimeStamp to I put on the first block? It
should really be negative, but the element takes an unsigned value.


More information about the Matroska-devel mailing list