CRI Sofdec2  Last Updated: 2022-11-21 16:25 p
Seek Playback

This section explains the seek playback feature.

What Is Seek Playback?

Seek playback allows a movie to be played starting from any frame, not just the first frame. Playback position is specified by frame number.


Preparing for Seek Playback

To perform seek playback, create a player handle and be sure to register a memory allocator for the metadata using the criManaPlayer_SetMetaDataWorkAllocator() before playback. Registering a memory allocator allocates a work buffer for the metadata necessary for seek playback when the header is analyzed.

Attention
Seek playback will not work if a memory allocator for the metadata is not registered. Be aware that even if you specify a starting frame, the movie will play back from the beginning.

Specifying Starting Frame

Playback position is specified by frame number. Use criManaPlayer_SetSeekPosition() to specify playback position.
Specify playback position before playback starts.
The frame number range that can be specified is from 0 to (total number of movie frames minus one).

You cannot specify a seek position and change playback position while a movie is playing.
Stop and replay the movie if you want to change the playback position.

Getting Parameters during Seek Playback

This section explains the information you can get during seek playback.

  • Playback time
    criManaPlayer_GetTime() does not start from 0. It starts from the time of the position that was sought.
    If the seek position is ten seconds, then the time will start from ten seconds.
  • Frame Number
    The frame number of CriManaFrameInfo structure does not start from 0. It starts from the position that was sought.
    If frame number 90 is sought, then the frame number that can be gotten will also start from 90.
  • Subtitles
    The only subtitles that start after the playback position can be displayed.
    Subtitles whose stop times only are after the playback position cannot be displayed.


Reading Files during Seek Playback

This section explains reading files during seek playback.
A file cannot just suddenly be read partway in the data, even when playing a movie back partway through. Actual reading takes place when a little is read from the beginning of the file. The file is then sought within the data and reread.
This is why during seek playback the time from executing the playback function to actually getting the frame is longer than with simple playback.