[FFmpeg-trac] #6699(avformat:open): MP4 with HEVC keyint=2 not decoded properly due to edit list (first frames are missing)

FFmpeg trac at avcodec.org
Tue Oct 31 22:25:38 EET 2017


#6699: MP4 with HEVC keyint=2 not decoded properly due to edit list (first frames
are missing)
-------------------------------------+-------------------------------------
             Reporter:  tospi        |                    Owner:  isasi
                 Type:  defect       |                   Status:  open
             Priority:  normal       |                Component:  avformat
              Version:  git-master   |               Resolution:
             Keywords:  mov hevc     |               Blocked By:
  edts                               |  Reproduced by developer:  0
             Blocking:               |
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
Changes (by isasi):

 * owner:   => isasi
 * status:  new => open


Comment:

 The latest version contains the edit list parsing code
 http://git.videolan.org/?p=ffmpeg.git;a=commit;h=ca6cae73db207f17a0d5507609de12842d8f0ca3
 which will modify the index based on the edit lists.

 The mov_fix_index function tries to seek to the nearest keyframe with the
 timestamp that is less than or equal to the edit list start timestamp.

 The issue here is that the index timestamps are decoding timestamps, while
 the edit list start refers to the presentation timestamp.

 Usually this is not a problem, since whenever DTS != PTS i.e. that the
 video has B-frames. And  the found key-frame is before the B-frame that
 corresponds to edit list start.

 However in this case we have two I-frames right-after each other in
 decoding order. The key-frame that is found is the 2nd key-frame, however
 the edit list start is referring to the 1st B-frame.
 packet|pts_time=0.000000|dts_time=-0.080000|flags=K_  (edit list start)
 packet|pts_time=0.080000|dts_time=-0.040000|flags=K_  (What the code seeks
 to )
 packet|pts_time=0.040000|dts_time=0.000000|flags=__ (B frame)

 Hence the demuxer doesn't output the first I frame.

 I have a patch, which will refine the edit list start search based on PTS
 computed by adding CTTS values. It should fix this problem.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/6699#comment:4>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list