To Seek By Frame Number Using the Synchronous Reader

[The feature associated with this page, Windows Media Format 11 SDK, is a legacy feature. It has been superseded by Source Reader and Sink Writer. Source Reader and Sink Writer have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use Source Reader and Sink Writer instead of Windows Media Format 11 SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

To seek for data by frame number using the synchronous reader, you specify a range for playback. A range is defined by a starting frame number in a specific video stream and a number of frames to play.

To seek data in an ASF file by frame number using the synchronous reader, perform the following steps.

  1. Set the starting frame number and number of frames to read for sample delivery by calling IWMSyncReader::SetRangeByFrame. You must specify the stream number of a frame-indexed video stream. The reader will synchronize the rest of the outputs to the presentation time of the specified frame of the specified stream and begin delivering output samples.
  2. Begin retrieving samples with calls to IWMSyncReader::GetNextSample. Proceed as you normally would with the synchronous reader.

IWMSyncReader Interface

Reading Files with the Synchronous Reader