[Matroska-devel] Re: [Media-api] Design ideas for the editingsystem - How to handle audio
paul at msn.com
Fri Jan 30 18:51:30 CET 2004
This occured to me as I was considering how to improve the Block2 design for
Matroska. The problem encountered in Matroska is that there are never exactly
precise timestamps that you can use for an audio sample because each sample
takes a length of time that cannot be expressed as a single number. For
instance, a single CD audio sample is 1/44100 seconds long. There is not a good
way to express the samples timecode as a rational number. Its not a huge issue
in Matroska because you can express the timecode with enough accuracy that you
know exactly what sample you are talking about.
However, its also not as elegant as I would like so I was trying to think of a
better way to do this, and one way was to store the sample number in the Block2
and use that to calculate the timecode. This seems simple since audio streams
always have the same samplerate throughout the stream. But then I remembered
something that Steve mentioned.
"What if you want the samplerate to change in the audio stream?"
If you have a variable sample rate stream, then you cannot know the timecode
from the sample number. There are currently no sources like this, or codecs
that support this, but it is possible a chicken/egg problem. There cannot be
any sources like this because there are no systems that support it. I doubt it
is even possible in current hardware. But, with the prevalence of soft DSPs, it
is not unthinkable for this to be common within the next 10 years.
So, given this, how should audio be handled in the new Media-api? By sample
number, by timecode, or some other method?
How should this be handled in the new editing system?
More information about the Matroska-devel