Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#540 closed defect (invalid)

mpeg1 and 2 seeking bug

Reported by: coder@… Owned by: mans@…
Priority: normal Component: libavcodec
Version: unspecified Severity: normal
Keywords: Cc:
Blocked By: Blocking:
Reproduced by developer: Analyzed by developer:

Description

Seeking in mpeg1 and mpeg2 streams using

av_seek_frame(formatcontext, vstream, time, AV_SEEK_FLAG_BACKWARD);

causes messages like

[mpeg2video @ 0xb4ba61d0]Warning MVs not available
[mpeg2video @ 0xb4ba61d0]releasing zombie picture
[mpeg2video @ 0xb4ba61d0]warning: first frame is no keyframe

Also, the frames returned are clearly not the ones I seeked to and contain
garbled images.

The code works with other codecs - I've tested huffyuv, mjpeg, mpeg4, msmpeg and
xvid. If the stream index is set to -1 and the time calculation changed
appropriately:

av_seek_frame (formatcontext, -1, time, AV_SEEK_FLAG_BACKWARD);

then everything works. The first two warning messages still appear, but the
frames shown are the correct ones and the 'no keyframe' message doesn't appear
anymore.

Attachments (2)

ffplay.diff (784 bytes) - added by coder@… 13 years ago.
Modification to ffplay that causes the bug to appear
mpeg2_160x120_25_10_audio.mpg (214.0 KB) - added by coder@… 13 years ago.
mpeg2 file that causes the bug to appear.

Download all attachments as: .zip

Change History (5)

Changed 13 years ago by coder@…

Modification to ffplay that causes the bug to appear

comment:1 Changed 13 years ago by coder@…

The patch modifies ffplay to seek using the video stream. For xvids, this works
perfectly, for mpeg2s, it produces garbled images and the error messages in the
bug report.

I've got a small (200k, 160x120, 10 seconds) test movie if you need one.

Changed 13 years ago by coder@…

mpeg2 file that causes the bug to appear.

comment:2 Changed 13 years ago by coder@…

File created using
FFMPEG_PARAMS=-i testmovies/tmp/tmp.wav -t 10.04 -i \

testmovies/tmp/160x120_frame%07d.png -y -r 25 -b 9000 \
-vcodec mpeg2video mpeg2_160x120_25_10_audio.mpg

ffmpeg -pass 1 ${FFMPEG_PARAMS}
ffmpeg -pass 2 ${FFMPEG_PARAMS}

comment:3 Changed 13 years ago by mans@…

  • Resolution set to invalid
  • Status changed from new to closed

MPEG PS doesn't indicate keyframes.

Note: See TracTickets for help on using tickets.