The AVCodecContext.frame_number field seems to not be reset after a
flush or seek.

 

Attached code generates the problem and produces the output below:

 

[mpeg4 @ 0xca1ea0]warning: first frame is no keyframe
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'falco.mp4':
  Duration: 00:02:34.35, start: 0.000000, bitrate: 2512 kb/s
    Stream #0.0(eng): Video: mpeg4, yuv420p, 720x576 [PAR 1:1 DAR 5:4],
25.00 tb(r)

First call...
[mpeg4 @ 0xca1ea0]warning: first frame is no keyframe
!!!pre Decoded packet pts 0, dts 0, frame 1, key 0
!!!pre Decoded packet pts 40, dts 40, frame 2, key 0
!!!pre Decoded packet pts 81, dts 81, frame 3, key 0
!!!pre Decoded packet pts 121, dts 121, frame 4, key 0
!!!pre Decoded packet pts 168, dts 168, frame 5, key 0
!!!pre Decoded packet pts 208, dts 208, frame 6, key 0
!!!pre Decoded packet pts 248, dts 248, frame 7, key 0
!!!pre Decoded packet pts 270, dts 270, frame 8, key 0
!!!pre Decoded packet pts 320, dts 320, frame 9, key 1
!!!pre Decoded packet pts 360, dts 360, frame 10, key 0
blah blah
blah blah
!!!pre Decoded packet pts 2282, dts 2282, frame 58, key 0
!!!pre Decoded packet pts 2332, dts 2332, frame 59, key 1
!!!pre Decoded packet pts 2374, dts 2374, frame 60, key 0

Second call after seek...
[mpeg4 @ 0xca1ea0]warning: first frame is no keyframe
!!!post Decoded packet pts 0, dts 0, frame 61, key 0
!!!post Decoded packet pts 40, dts 40, frame 62, key 0
!!!post Decoded packet pts 81, dts 81, frame 63, key 0
!!!post Decoded packet pts 121, dts 121, frame 64, key 0
!!!post Decoded packet pts 168, dts 168, frame 65, key 0
!!!post Decoded packet pts 208, dts 208, frame 66, key 0
!!!post Decoded packet pts 248, dts 248, frame 67, key 0
!!!post Decoded packet pts 270, dts 270, frame 68, key 0
!!!post Decoded packet pts 320, dts 320, frame 69, key 1
!!!post Decoded packet pts 360, dts 360, frame 70, key 0
blah blah
blah blah
!!!post Decoded packet pts 2282, dts 2282, frame 118, key 0
!!!post Decoded packet pts 2332, dts 2332, frame 119, key 1
!!!post Decoded packet pts 2374, dts 2374, frame 120, key 0
 

Note that the frame number does not get reset on the second call (even
though the pts/dts do).

Note also that the frames recovered are evidently the same ones since
the pts, dts and key frames are identical.

 

Has anyone seen this before?  Is it a bug or am I forgetting to reset
something?

 

Gary

 

Attachment: seekTest.c++
Description: seekTest.c++

_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to