Skip to content

Instantly share code, notes, and snippets.

@jashkenas
Created May 7, 2015 19:19
Show Gist options
  • Save jashkenas/1b6862fc85a843340e39 to your computer and use it in GitHub Desktop.
Save jashkenas/1b6862fc85a843340e39 to your computer and use it in GitHub Desktop.
#!/bin/bash
seqs="public/_big_assets/imageseqs"
rm ${seqs}/*/montage*.jpg
for dir in ${seqs}/*
do
dir=${dir%*/}
base=${dir##*/}
if [ -f raw/renders/${base}/${base}mobile.mov ];
then
ffmpeg -i raw/renders/${base}/${base}mobile.mov -r 12 -f image2 -qscale:v 2 ${seqs}/${base}/${base}%05d.jpg
else
ffmpeg -i raw/renders/${base}/${base}.mov -r 12 -f image2 -qscale:v 2 ${seqs}/${base}/${base}%05d.jpg
fi
latest=$(ls -1 ${dir} | tail -n 1)
gm montage -tile 4x4 -geometry 500x500 -borderwidth 0 -background white -quality 65 +adjoin ${dir}/${base}*.jpg ${dir}/montage%01d.jpg
mv ${dir}/${base}00001.jpg ${dir}/first.jpg
mv ${dir}/${latest} ${dir}/last.jpg
rm ${dir}/${base}*.jpg
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment