Skip to content

Instantly share code, notes, and snippets.

@phivk
Last active August 20, 2022 14:47
Show Gist options
  • Save phivk/18270d1eda92faa0778cf1b6b4a86ef1 to your computer and use it in GitHub Desktop.
Save phivk/18270d1eda92faa0778cf1b6b4a86ef1 to your computer and use it in GitHub Desktop.
# 1. download images from Unsplash
# e.g. using:
# https://addons.mozilla.org/en-US/firefox/addon/save-all-images-webextension/
# https://github.com/splash-cli/splash-cli
# https://github.com/MehediH/Bulksplash
# 2. rename *.jpeg to *.jpg
for f in *.jpeg; do mv "$f" "${f/.jpeg/.jpg}"; done
# 3. resize images into resized folder
# mogrify courtesy of ImageMagick https://imagemagick.org/script/mogrify.php
mogrify -path resized -geometry 1280x960^ -gravity center -crop 1280x960+0+0 *.jpg
# 4. render video from resized images
ffmpeg -framerate 6 -pattern_type glob -i 'resized/*.jpg' -c:v libx264 -c:a copy -shortest -r 30 -pix_fmt yuv420p resized.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment