Commit 6e1350e5 authored by gijs's avatar gijs
Browse files

Script to make timelapse videos

parent ec149c12
for path in projects/*/snapshots;
do
if [ -d $path ]; then
previous="";
echo "Making timelapse for: ${path}"
convert -delay 50 $path/*.svg $path/timelapse.gif
echo "Timelapse written in: ${path}/timelapse.gif"
if [ ! -d $path/png ]; then
mkdir $path/png;
fi
rm $path/png/*.png;
echo $path;
for svg in $path/*.svg;
do
echo $svg;
if [ ! $previous = "" ]; then
diff=$(cmp $previous $svg);
else
diff="first";
fi
if [ ! "${diff}" = "" ]; then
filename=$(basename $svg)
convert $svg $path/png/${filename%.svg}.png
previous=$svg;
fi
done
ffmpeg -framerate 1 -r 3 -pattern_type glob -i "${path}/png/*.png" -c:v libx264 -pix_fmt yuv420p $path/timelapse.mp4
fi
done;
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment