FFmpeg Video from one image
To convert a still image to a video is easy and can be used to create slideshows, where short videos from images (with added text) are joined together, joining videos is described in the chapter 23. For example to create a 10-second video from the photo.jpg file, we include a -loop boolean option with a value true or 1 like in the command:
ffmpeg -loop 1 -i photo.jpg -t 10 photo.mp4
FFmpeg Video from many images
To create a video from multiple images, their filenames must end with a number, where these numbers correspond with the sequence in which the images will be encoded to the video file. In this case the media format is specified before the input and it is an image2 format. For example, from 100 images named img1.jpg, img2.jpg, …, img100.jpg can be created a 4-second video with 25 fps frame rate using the command
ffmpeg -f image2 -i img%d.jpg -r 25 video.mp4
If the image numbers start with zeros, for example img001.jpg, img002.jpg, etc. to provide the same filename length, then the command is
ffmpeg -f image2 -i img%3d.jpg -r 25 video.mp4