Skip to content

Instantly share code, notes, and snippets.

@zsiciarz
Created February 17, 2018 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zsiciarz/c3a92515da8e39df64594bd2d17fa80b to your computer and use it in GitHub Desktop.
Save zsiciarz/c3a92515da8e39df64594bd2d17fa80b to your computer and use it in GitHub Desktop.
#!/bin/bash
set -euox pipefail
IFS=$'\n\t'
INTERPOLATED_COUNT=25
PHOTOS_DIR=$1
TEMPORARY_FRAMES_DIR=tmp_frames
echo "Making timelapse from photos in $PHOTOS_DIR..."
echo "Blending interpolated frames..."
gifblender -o $TEMPORARY_FRAMES_DIR -s $INTERPOLATED_COUNT $PHOTOS_DIR/*.jpg
echo "Putting frames together..."
ffmpeg -r 25 -pattern_type glob -i "$TEMPORARY_FRAMES_DIR/*.jpg" -s 1333x2000 -b:v 60M -y "$PHOTOS_DIR.avi"
echo "Cleaning up..."
rm $TEMPORARY_FRAMES_DIR/*.jpg
echo "Timelapse complete."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment