Skip to content

Instantly share code, notes, and snippets.

@jacoduplessis
Last active May 5, 2022 21:56
Show Gist options
  • Save jacoduplessis/8e2535d2d4d3c01014299c73362a12ac to your computer and use it in GitHub Desktop.
Save jacoduplessis/8e2535d2d4d3c01014299c73362a12ac to your computer and use it in GitHub Desktop.
How to create an image slideshow with images from different devices and of different formats, both image and landscape, using ffmpeg, exiftool and imagemagick
  1. Use exiftool to sort according to exif data (apt-get install exiftool)
exiftool "-FileName<DateTimeOriginal" -d "sorted/%Y%m%d_%H%M%S.%%e" .
  1. Rotate and resize
mogrify * -auto-orient -resize 1920x1080
  1. Pad images
mogrify * -gravity center -background black -extent 1920x1080
  1. Encode
ffmpeg -framerate 1/5 pattern_type glob -i "*.jpg" -pix_fmt yuv420p output.mp4
  1. Add Sound
ffmpeg -i output.mp4 -i track.wav -c:v copy -c:a aac -b:192k video.mp4

Done! I hope this saves someone some time cause I lost some of mine on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment