Created
May 7, 2015 19:19
-
-
Save jashkenas/1b6862fc85a843340e39 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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