VPU Decoding after a seek into the video

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

VPU Decoding after a seek into the video

ソリューションへジャンプ
1,110件の閲覧回数
ronssehervé
Contributor I

Hi,

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

ラベル(2)
1 解決策
620件の閲覧回数
LaurenPost
NXP Employee
NXP Employee

What you are seeing after you seek are delta frames referencing frames before the key frame that were never given to the VPU.

There are a few options, wait for an IDR frame which is not guaranteed in many content.

After the seek point, do not display b until a 2nd I or P frame is displayed.

Close and reopen VPU as this clears out reference of delta frames not given

In my experience closing and opening the VPU seems to solve almost all the problems for these type seek situations.  Memory does not have to be freed or cleared on this reset case.

元の投稿で解決策を見る

0 件の賞賛
1 返信
621件の閲覧回数
LaurenPost
NXP Employee
NXP Employee

What you are seeing after you seek are delta frames referencing frames before the key frame that were never given to the VPU.

There are a few options, wait for an IDR frame which is not guaranteed in many content.

After the seek point, do not display b until a 2nd I or P frame is displayed.

Close and reopen VPU as this clears out reference of delta frames not given

In my experience closing and opening the VPU seems to solve almost all the problems for these type seek situations.  Memory does not have to be freed or cleared on this reset case.

0 件の賞賛