AnsweredAssumed Answered

VPU Decoding after a seek into the video

Question asked by ronssehervé on Oct 25, 2012
Latest reply on Nov 1, 2012 by Lauren Post



I'm developping a video recorder/player application on an Imx53 board. I use VPU's codec mpeg4 to decode the video frames (from a video file). FFmpeg allow to use the AVI container for video storage.

When exclusive playback video, the decoding is correct. The problem occurs when I do a forward (or rewind) in the video :


Playing video, start decoding :

1. Fill vpu buffer with encoded mpeg4 frames

2. Start one frame decoding : vpu_DecStartOneFrame()

3. Wait for completion decoding : while( vpu_IsBusy() !=0) { fill_vpu_buffer(); vpu_WaitForInt(); }

4. Catch up the result : vpu_DecGetOutputInfo() and vpu_DecClrDispFlag()

5. Display the decoded frame and return to step 2.


When seek into the video, begin the seek process after step 5 (playing) :

6. Flush the VPU input buffer : vpu_DecBitBufferFlush()

7. Seek into the video (to a IKeyFrame)

8. Fill vpu buffer with encoded mpeg4 frames : the first one is a IKey frame.

9. return to step 2 (playing).


After the seek process, the first decoded frame is dirty although it is a keyframe. Why these results ?

Thanks, best regards