I'm trying to make a slideshow with ffmpeg using a directory of images. On Linux, I can just use -pattern_type=glob but on flutter_ffmpeg (ffmpeg for Flutter apps), glob is not supported. The images are not sequential, they are date formatted like this:

2020-04-09T14:16:52.png 2020-04-09T14:18:53.png 2020-04-09T14:20:54.png 2020-04-09T14:22:55.png 2020-04-09T14:24:56.png 2020-04-09T14:26:57.png 2020-04-09T14:28:58.png 2020-04-09T14:30:59.png 2020-04-09T14:33:00.png 2020-04-09T14:35:01.png 
2020-04-09T14:17:53.png 2020-04-09T14:19:54.png 2020-04-09T14:21:55.png 2020-04-09T14:23:56.png 2020-04-09T14:25:57.png 2020-04-09T14:27:58.png 2020-04-09T14:29:59.png 2020-04-09T14:32:00.png 2020-04-09T14:34:01.png 2020-04-09T14:36:02.png 

If I use each image as an input like this:

ffmpeg -i 2020-04-09T14:30:59.png -i 2020-04-09T14:27:58.png -i 2020-04-09T14:28:58.png output.mp4

output.mp4 is overwritten every time and only contains one image.

How can I use all the files without using glob?


Rename them in sequential order or use the concat demuxer.

  1. Make input.txt:

    file '2020-04-09T14:16:52.png'
    duration 5
    file '2020-04-09T14:18:53.png'
    duration 5
    file '2020-04-09T14:20:54.png'
    duration 5
  2. Run ffmpeg:

    ffmpeg -f concat -i input.txt -vf format=yuv420 -movflags +faststart output.mp4

Also see FFmpeg Wiki: Concatenate.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.