ffmpeg -framerate 1/3 -pattern_type glob -i "*.jpg" -c:v libx264 -r 30 -pix_fmt yuv420p slideshow.mp4
Parameter | Description |
---|---|
-framerate 1/3 |
Each image displays for 3 seconds (1 frame every 3 seconds) |
-pattern_type glob |
Uses glob pattern matching for finding files |
-i "*.jpg" |
Uses all JPG files in the current directory as input |
-c:v libx264 |
Sets the video codec to H.264 |
-r 30 |
Sets the output frame rate to 30fps (smooth playback) |
-pix_fmt yuv420p |
Sets pixel format for compatibility |
ffmpeg -framerate 1/5 -pattern_type glob -i "*.jpg" -filter_complex "zoompan=d=125:zoom='min(1.3,1+0.002*n)':x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)',fps=25,format=yuv420p" -c:v libx264 -preset medium -crf 23 ken_burns_slideshow.mp4
Creates a Ken Burns effect slideshow where each image shows for 5 seconds with slow zoom and pan effects.
ffmpeg -framerate 1/4 -pattern_type glob -i "*.jpg" -i music.mp3 -c:v libx264 -c:a aac -shortest -pix_fmt yuv420p -r 30 music_slideshow.mp4
Creates a slideshow with 4 seconds per image and adds background music that ends when the slideshow ends.
ffmpeg -framerate 1/3 -pattern_type glob -i "*.jpg" -filter_complex "drawtext=fontfile=/path/to/font.ttf:text='My Vacation Slideshow':fontcolor=white:fontsize=36:box=1:boxcolor=black@0.5:boxborderw=5:x=(w-text_w)/2:y=h-th-20" -c:v libx264 -r 30 -pix_fmt yuv420p captioned_slideshow.mp4
Adds a text caption to the bottom of each slide in the slideshow (customize the text as needed).