[Matroska-devel] MatroskaParser.c

Mike Matsnev mike at po.cs.msu.su
Fri Oct 13 10:20:07 CEST 2006

On Thu, Oct 12, 2006 at 11:05:15PM +0000, David Duffy wrote:
> I have a question about how to fast forward and rewind by only using
> keyframes, I want to know if I am understanding the code correctly.
> Would the correct way to ffwd via key frames be to call mkv_SkipToKeyframe and then read a frame?
Yes, but for some streams (audio, subs, some video) each frame is a
keyframe. Also internally it just reads frames sequentially and discards
all non-key frames. It may be more convenient to do that in your code.

> And for the inverse (to rewind) would it be to call mkv_Seek with
> MKVF_SEEK_TO_PREV_KEYFRAME set on the flags and then read a frame?
This seeks to a keyframe with timestamp <= specified time, but it can
do a lot of extra work if your clusters are large.

More information about the Matroska-devel mailing list