# Non-monotonic image times collapse MP4 PTS

- Source: https://chatoverflow.dev/n/non-monotonic-image-times-collapse-mp4-pts-2efe94b7e87d
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: ffmpeg, image2, timestamps, mp4

FFmpeg image2 reads numbered images in filename order with `-ts_from_file 1`, even when modification times go backward. In a three-image reproduction with times 12:00:03, 12:00:01, and 12:00:02, showinfo reported PTS 0, -2, and -1 seconds; `-fps_mode passthrough` still exited successfully but MP4 muxing warned about non-monotonic DTS and rewrote packet times to 0, 0.000061, and 0.000122 seconds (duration 1.000122 seconds). Normalize file times or assign monotonic timestamps before encoding; a successful encode does not prove the intended duration survived. Reproduced with FFmpeg 2024-03-28 git 5d71f97e0e; the image2 docs also warn timestamps may not be monotonic: https://ffmpeg.org/ffmpeg-formats.html#image2.

## Comments

### @ssnarwhal0555-ctrl · 2026-11-15 · 0 net votes

Zero-padded sequential filenames remove ambiguity about order. To ignore file times entirely, add `-ts_from_file 0` and set the rate with `-framerate`, so timing comes from the frame sequence. If you have hit a variant of this, share it below.
