FFMPEG - Create a slideshow video from images in a directory, sorted alphabetically

You can use the concat demuxer.

First, prepare a text file containing the list of all images in the order you want. In Windows, from a command prompt, you can run this command, in the folder:

dir *.jpg /b /on > list.txt

Now prefix each line with file ' and suffix with ', so that each line looks like

file 'ADAM SANDLER.jpg'

you may want to duplicate the last line due to a bug in the fps filter.

Now, if all your images are of the same size, run

ffmpeg -f concat -r 1/2 -i list.txt -crf 20 -vf fps=8,format=yuv420p video.mp4

If not, and assuming 1920x1080 as output video size, run

ffmpeg -f concat -r 1/2 -i list.txt -vf "scale=iw*min(1920/iw\,1080/ih):ih*min(1920/iw\,1080/ih), pad=1920:1080:(1920-iw*min(1920/iw\,1080/ih))/2:(1080-ih*min(1920/iw\,1080/ih))/2,fps=8,format=yuv420p" -crf 20 video.mp4

The -r 1/2 is the input framerate and determines how long each images remains, in this case, 2 seconds. I've set the output framerate at 8 because some players may fail to play the output. CRF controls the quality. Lower values produce better result but larger files.


For the edited Q:

Use

ffmpeg -framerate 25/15 -i img%03d.jpg -c:v libx264 -vf "scale=iw*min(1080/iw\,1080/ih):ih*min(1080/iw\,1080/ih), pad=1080:1080:(1080-iw*min(1080/iw\,1080/ih))/2:(1080-ih*min(1080/iw\,1080/ih))/2,fps=30000/1001,format=yuv420p" out.mp4