A folder of numbered photos is basically a video that has not been assembled yet. ffmpeg can read such a sequence directly, so a slideshow or time-lapse is one command.
The image2 demuxer takes a pattern. The docs say the pattern may contain %d or %0Nd, where N is the number of digits. A name like img-001.jpeg matches img-%03d.jpeg. The manual’s own example is:
ffmpeg -framerate 10 -i 'img-%03d.jpeg' out.mkv
Here -framerate 10 means ten pictures per second, so 300 pictures give a 30 second film. Leave it out and the docs say the frame rate defaults to 25. The quotes matter in a shell, so the pattern reaches ffmpeg instead of being expanded.
If your numbering does not begin at the default index, -start_number sets the first file to read. The docs example starts at 100:
ffmpeg -framerate 10 -start_number 100 -i 'img-%03d.jpeg' out.mkv
The default start is 0, and the sequence has to be gapless: this is a pattern, not a list. If one number is missing, the video ends there or skips, so look at the folder first.
-start_number and -framerate are both written before the input in the manual’s examples.
This pairs well with a camera that saves numbered stills, and it is where I would start for any time-lapse. The pictures need the same size. I would also check what the default output encoder gives you for the extension you choose, since an .mkv or .mp4 can come out with different codecs and settings, and a quick ffprobe shows it.
Further reading: ffmpeg formats documentation: image2 demuxer