[FFmpeg-trac] #9139(avformat:new): FFmpeg drops the first frame of video files trimmed in Quicktime 7.

FFmpeg trac at avcodec.org
Fri Mar 5 08:45:10 EET 2021


#9139: FFmpeg drops the first frame of video files trimmed in Quicktime 7.
-------------------------------------+-------------------------------------
             Reporter:  aymv         |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:  avformat     |                  Version:
             Keywords:  quicktime    |  unspecified
  mov                                |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Summary of the bug:
 FFmpeg drops the first frame of video files trimmed in Quicktime 7.
 QuickTime_Player start input.mov from this frame:
 [https://ibb.co/Hp2HFR6]
 But after ffmpeg conversation it looks like this:
 [https://ibb.co/kMz65Fh]
 Looks like a problem with elst/media_time and how ffmpeg interprets this:
 1. In QuickTime_File_Format_Specification media_time is '''DT''' value.
 {{{
 The edit list atom provides the initial DT value if it is nonempty
 (nonzero).
 }}}
 2. In ISO IEC 14496-12 media_time is '''CT''' value.
 {{{
 The Edit List Box provides the initial CT value if it is non‐empty
 (non‐zero).
 }}}
 From the code we can see that the second variant is used in ffmpeg, but
 then what about the existing media_time (it is set not to a specific PTS
 of frame, but in the middle) in attached file and how to interpret the
 next note (ISO IEC 14496-12):
 {{{
 Edits are not restricted to fall on sample times. This means that when
 entering an edit, it can be necessary to (a) back up to  a  sync point,
 and pre‐roll from there  and then (b) be careful about the duration of the
 first sample — it might have been truncated if the edit enters it during
 its normal duration. If this is audio, that frame might need to be
 decoded, and then the final slicing done. Likewise, the duration of the
 last sample in an edit might need slicing.
 }}}
 How to reproduce:
 {{{
 % ffmpeg -i input.mov output.mp4
 ffmpeg version - any, last tested - 4.3.2
 built on 2021-02-27
 }}}

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


More information about the FFmpeg-trac mailing list