Skip to content

Instantly share code, notes, and snippets.

@thobbs
Last active April 30, 2020 02:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thobbs/55cd143fae3d6d1d5f3f5695c92b5739 to your computer and use it in GitHub Desktop.
Save thobbs/55cd143fae3d6d1d5f3f5695c92b5739 to your computer and use it in GitHub Desktop.
Script to generate animations from progress images of work
#!/bin/bash
mkdir ./animation
# make square 1200x1200 images
for fname in $@; do
echo "Converting $fname";
newfname=$(printf "animation/%04d.jpg" "$a");
convert $fname -thumbnail '1200x1200>' -background black -gravity center -extent 1200x1200 $newfname;
let a=a+1;
done
echo "Generating movie"
# create movie
avconv -framerate 4 -i animation/%04d.jpg -pix_fmt yuv420p -vcodec libx264 -vb 2500k -minrate 2500k -maxrate 2500k -bufsize 2500k -strict -2 -acodec aac -s 1200x1200 output.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment