Created
February 13, 2019 10:38
-
-
Save vool/7842d1282384f7bee0f6b38d14baede2 to your computer and use it in GitHub Desktop.
Script to animate images from cams into annual movie
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 | |
i=0 | |
tmp_dir="temp/" | |
if [ ! -d $tmp_dir ]; then | |
mkdir -p $tmp_dir; | |
fi | |
for d in $(printf '%2d\n' {0..364}); do | |
#echo "$d" | |
for f in $d/*.jpg ; do | |
echo "$f" | |
if [[ $(find $f -type f -size +1k 2>/dev/null) ]]; then | |
printf -v n "%06d" $i; | |
echo "Coping to $n.jpg"; | |
cp "$f" "$tmp_dir$n.jpg" | |
i=$((i + 1)) | |
else | |
echo "bad $n" | |
#exit; | |
fi | |
done | |
done | |
echo "done" | |
ffmpeg -framerate 60 -i "$tmp_dir%06d.jpg" video.mp4 | |
while true; do | |
read -p "Do you want to delete the temp dir ? " yn | |
case $yn in | |
[Yy]* ) rm -rf $tmp_dir ; break;; | |
[Nn]* ) exit;; | |
* ) echo "Please answer yes or no.";; | |
esac | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment