FFMPEG: Make video with non-constant framerate from image filenames I have a large group (tens of thousands) of images which were captured to an SSD at the max speed possible, which was therefore not a constant frame rate. Because of this, when using FFMPEG to turn these into a constant frame-rate video it seems to speed up and slow down when it shouldn't.

Is there a way to tell FFMPEG to time the images based on the timestamp in the filename rather than a constant framerate?

For example, consider the following (contrived) list of files:

2019-01-28-08-00-28-000-000.tiff
2019-01-28-08-00-28-700-000.tiff
2019-01-28-08-00-28-900-000.tiff


These should be three sequential frames, but should have varying times between them. Then I can use the minterpolate filter to make it a smooth transition.
The below answer was provided as a comment on the question by Gyan. I've reposted it as an answer so this question can be marked as solved.




  The image2 reader in ffmpeg can assign timestamps based on the modification time of the file, with nanosecond precision. Not possible on Win, AFAICT. So, on a linux box, you can parse the filename and generate a timestamp and touch the mtime of the file. The absolute timestamps don't matter, just need to make sure the deltas in the mtimes correspond to the desired deltas. Then rename or symlink the images to form a smooth numbered sequence. Once done, read as follows: ffmpeg -f image2 -ts_from_file 2 -i images%d.jpg -vf minterpolate=... – Gyan




This worked for me! I was able to use the touch -d command to set the timestamp on each file based on the filename, then use ffmpeg -f image2 -ts_from_file 2 -i %d.png out.mp4 to create the video. Interpolation ended up being time-prohibitive, but shouldn't really be necessary in my final video.