Hi all, I am trying to implement a seek function for my video playback system. I'll try to explain the problem by this example: (times in milliseconds)
SEEK DONE (seek to 5000, using AVSEEK_FLAG_BACKWARD) VIDEO PTS FOUND: 4960 (key frame) VIDEO PTS FOUND: 5000 VIDEO PTS FOUND: 5040 VIDEO PTS FOUND: 5040 VIDEO PTS FOUND: 5080 VIDEO PTS FOUND: 5120 VIDEO PTS FOUND: 5160 (key frame) VIDEO PTS FOUND: 5200 VIDEO PTS FOUND: 5240 VIDEO PTS FOUND: 5280 WRITTEN PTS [5280] INTO BUFFER (avcodec_decode_video returned frame) Here's what's happening; I tried seeking to 5000ms, I used the AVSEEK_FLAG_BACKWARD so I would get the first keyframe before the time I need. This seems to work fine, as the first PTS which is found, is a keyframe. The next frame is the valid frame, but avcodec_decode_video does not return a frame. It's only at pts 5280, when there has been another key frame and several B frames, that avcodec_decode_video finally returns a frame. I would like to know if this is expected behaviour, and if it is, how can I make sure I get the frame I need as fast as possible? thanks in advance, - Arjan _______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user
