[FFmpeg-trac] #5318(undetermined:new): ffmpeg segment format options are only applied to first segment

FFmpeg trac at avcodec.org
Wed Mar 9 16:18:02 CET 2016

#5318: ffmpeg segment format options are only applied to first segment
             Reporter:  jeroendnx    |                     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:

 In the second example at
 there is segment output format option set, but this option is only applied
 to the first segment.

 Tested ffmpeg 2.8 and 3.0

 How to reproduce:

 make segments:
 ffmpeg -i /tmp/file.mp4 -f segment -segment_time 2 -segment_format_options
 movflags=faststart bout%03d.mp4

 first segment:
 qt-faststart bout000.mp4 bout000.mp4_2
 ftyp          0 28
 moov         28 1073
 free       1101 8
 mdat       1109 166746
 last atom in file was not a moov atom
 -> was already faststart, good

 second segment:
 qt-faststart bout001.mp4 bout000.mp4_2
 ftyp          0 28
 free         28 8
 mdat         36 97857
 moov      97893 1073
 patching stco atom...
 writing ftyp atom...
 writing moov atom...
 copying rest of file...
 -> was not faststart yet, bad

 Here is a log of ffmpeg only applying the option once:

 ffmpeg -loglevel 100 -i big_buck_bunny_480p_surround-fix.avi -an -f
 segment -segment_time 2 -segment_format_options movflags=faststart
 out%03d.mp4 2>&1 | grep -e 'count' -e 'moov'

 [mp4 @ 0x32e7200] Starting second pass: moving the moov atom to the
 beginning of the file
 [segment @ 0x2502c00] segment:'out000.mp4' count:0 ended
 [segment @ 0x2502c00] segment:'out001.mp4' count:1 ended
 [segment @ 0x2502c00] segment:'out002.mp4' count:2 ended
 [segment @ 0x2502c00] segment:'out003.mp4' count:3 ended
 [segment @ 0x2502c00] segment:'out004.mp4' count:4 ended
 [segment @ 0x2502c00] segment:'out005.mp4' count:5 ended
 [segment @ 0x2502c00] segment:'out006.mp4' count:6 ended
 [segment @ 0x2502c00] segment:'out007.mp4' count:7 ended

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

More information about the FFmpeg-trac mailing list