[FFmpeg-devel] [PATCH] Fix timestamp retrieval for MPEG-2 non-frame picture encoding

Brian Brice bbrice
Sat Aug 15 08:02:48 CEST 2009


I have found a bug with timestamp information being lost with MPEG-2
files that were encoded not as a frame picture.  You'll essentially
have 2 fields encoded one after another, with 2 PICTURE_START_CODE's
occurring in a single frame.  The current implementation of the MPEG
video parser overwrites the PTS/DTS that was stored at the start of
the frame with AV_NOPTS_VALUE when the second PICTURE_START_CODE comes

I've seen this with I-frame only MPEG-2 files along with select
DVD/VOBs.  I have uploaded a sample I-frame only clip for anyone who
would like to test also:

http://heapify.org/dynamic/intra-only-hd.mpg -- Only about 20 frames
(0.667 sec).

The patch is attached.  Thanks!

Brian Brice
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-ff_mpeg1_find_frame_end-fix.patch
Type: application/octet-stream
Size: 421 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090815/9ed07949/attachment.obj>

More information about the ffmpeg-devel mailing list