[FFmpeg-trac] #5120(undetermined:new): Incorrect start frame when converting mpeg2video to mp4

FFmpeg trac at avcodec.org
Sun Jan 3 18:42:03 CET 2016

#5120: Incorrect start frame when converting mpeg2video to mp4
             Reporter:  sroy8        |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:
  undetermined                       |  unspecified
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
 Summary of the bug:

 When I convert an mpeg2video in a .mov container to mp4, the output
 includes additional frames that are before the start frame in the input.
 This is possible because the start time of the input is non-zero.

 To reproduce:
 % ffmpeg -i incorrect-start-frame.mov incorrect-start-frame.mp4

 You can download incorrect-start-frame.mov at
 http://www.datafilehost.com/d/6edc3c9b, and a -report log from running
 this command with ffmpeg 2.8.4 at http://www.datafilehost.com/d/3575bc05.

 In more detail, ffprobe on the input gives the following duration and

   Duration: 00:00:00.70, start: 0.522533, bitrate: 46718 kb/s

 In contrast, ffprobe on the output gives:

   Duration: 00:00:01.24, start: 0.021313, bitrate: 10801 kb/s

 I would be fine with small discrepancies.  However, the beginning of the
 output includes frames that are before the start of the input, which is a
 problem.  I end up with these input files when I capture video from a
 Canon HV20 camera using iMovie.  iMovie splits the video into scenes, and
 it's common for a file to include a few additional frames from the
 previous scene before the video start time.  The input video suppresses
 these frames by setting the start time.  However, the output video
 incorrectly shows them.  Often, these frames have no relationship to the
 rest of the video.

 My workaround has been to use gawk to extract the start time of the input
 video and then pass this to ffmpeg using -ss.  For example:

 % ffmpeg -ss 0.522533 -i incorrect-start-frame.mov correct-start-frame.mp4

 I've tried many different flags to try to get the right behavior without
 needing -ss, without success.  However, even if there is a correct flag
 setting, it seems like a bug from a user standpoint that the default
 behavior includes the extra frames.

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

More information about the FFmpeg-trac mailing list