[FFmpeg-trac] #7750(undetermined:closed): Using -f segment to produce avi files produces 'corrupted' avi files.

FFmpeg trac at avcodec.org
Sat Feb 23 13:14:30 EET 2019

#7750: Using -f segment to produce avi files produces 'corrupted' avi files.
             Reporter:  mhkohne      |                    Owner:
                 Type:  defect       |                   Status:  closed
             Priority:  normal       |                Component:
                                     |  undetermined
              Version:  unspecified  |               Resolution:  invalid
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
Changes (by Gyan):

 * status:  new => closed
 * resolution:   => invalid


 For segmenting to AVIs, you should reset timestamps.

 `ffmpeg -loglevel info -i Cosmos.mp4 -f segment -segment_time 30
 -reset_timestamps 1 test%03d.avi`

 Additionally, one has to ensure that generated keyframes are aligned with
 the start of each segment. The segment muxer, by default, only creates a
 segment when it encounters a KF after the segment time has elapsed. As it
 happens, your test input is 24 fps and default GOP size for the default
 AVI video encoder (mpeg4) is 12 frames (0.5s, in this case), so by
 happenstance, you won't have a problem in that regard. But in general, add
 `-force_key_frames "expr: gte(t,n_forced*30)"` to ensure a KF is present
 every 30 seconds.

Ticket URL: <https://trac.ffmpeg.org/ticket/7750#comment:2>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker

More information about the FFmpeg-trac mailing list