protected int seekToKeyFrame ( int frame ) throws IOException { if ( videoInputTrack instanceof SeekableDemuxerTrack ) { SeekableDemuxerTrack seekable = ( SeekableDemuxerTrack ) videoInputTrack ; seekable . gotoSyncFrame ( frame ) ; return ( int ) seekable . getCurFrame ( ) ; } else { Logger . warn ( "Can not seek in " + videoInputTrack + " container." ) ; return - 1 ; } }
Seeks to a previous key frame prior or on the given frame if the track is not seekable returns 0 .