

Now we have a quick look at all image sizes to decide on the final aspect ratio: identify png/* # Hardlink the ones that are already PNG.

There's a bit more to creating slideshows than running a single ffmpeg command, so here goes a more interesting detailed example inspired by this timeline. In particular, the width has to be divisible by 2, otherwise conversion fails with: "width not divisible by 2".įull realistic slideshow case study setup step by step I would also first ensure that all images to be used have the same aspect ratio, possibly by cropping them with imagemagick or nomacs beforehand, so that ffmpeg will not have to make hard decisions. Your images should of course be sorted alphabetically, typically as: 0001-first-thing.jpg c:a copy -shortest -c:v libtheora -r 30 -pix_fmt yuv420p out.ogv c:a copy -shortest -c:v libx264 -r 30 -pix_fmt yuv420p out.mp4īe a hippie and use the Theora patent-unencumbered video format in an OGG container: ffmpeg -framerate 1 -pattern_type glob -i '*.png' -i audio.ogg \ c:v libx264 -r 30 -pix_fmt yuv420p out.mp4Īdd some music to it, cutoff when the presumably longer audio when the images end: ffmpeg -framerate 1 -pattern_type glob -i '*.png' -i audio.ogg \ Slideshow video with one image per second ffmpeg -framerate 1 -pattern_type glob -i '*.png' \ This option was mentioned at: but here are a few concrete examples of its usage, including of adding audio to the output video. pattern_type glob concrete examples with audio (In the Windows shell, replace -i Imgp%04d.jpg with -i "Imgp%%04d.jpg". The -s option rescales the pictures to the desired resolution to manage the size of the resulting video. The -r 3 option sets the framerate of the resulting video to 3 frames per second so that I can see each still for a short period of time. I use the following one-liner to get a slower frame rate and to compress the images and have a smaller resulting video: ffmpeg.exe -f image2 -framerate 25 -pattern_type sequence -start_number 1234 -r 3 -i Imgp%04d.jpg -s 720x480 test.avi There are some other switches you might find useful. If there are gaps and you want all of the stills included, then renumbering may be necessary to fill the gaps. Note, this will work as long as the sequence is unbroken once it starts. Where n is the start of the sequence of stills. There is no need to rename files if using the -start_number switch like so: ffmpeg -start_number n -i test_%d.jpg -vcodec mpeg4 test.avi
