[FFmpeg-trac] #6306(undetermined:new): Wrong first frame using new decode API

FFmpeg trac at avcodec.org
Tue Apr 11 16:08:35 EEST 2017

#6306: Wrong first frame using new decode API
             Reporter:  s0m3         |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:
  undetermined                       |  unspecified
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  1
Analyzed by developer:  0            |
 I'm developping a multimedia player based on ffmpeg.

 To do frame stepping, I need to associate frame numbers and frame times
 If AVStream::nb_index_entries is != 0, I use AVIndexEntry structure,
 otherwise, I build an "index" manually.

 Building the "index" is as simple as decoding frames until we reach the
 end of the file. When decoding frames, I can retrieve frame times (pts)
 and store them.

 My issue is that the first frame I get is not the first one, its pts is
 not 0, its the (correct) pts of the third frame so I miss 2 frames.

 I suspect frames content are correct (what is displayed) but their pts is
 not. It's hard to tell because first frames of the sample file are

 I use the new decoding API so it may be a bug there or I may not use it

 Anyway, a test case is provided.
 The sample is "simpsons_movie_1080p_trailer.zip" from
 http://www.h264info.com/clips.html. MD5 is

 I tested it on windows with ffmpeg v3.2.4 and git version
 20170404-1229007-win32 (win32 build)

Ticket URL: <https://trac.ffmpeg.org/ticket/6306>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker

More information about the FFmpeg-trac mailing list