Skip to content

Instantly share code, notes, and snippets.

@codingisacopingstrategy
Created April 22, 2016 13:37
Show Gist options
  • Save codingisacopingstrategy/e63f3a3afd76d1e7145b2a2e98104556 to your computer and use it in GitHub Desktop.
Save codingisacopingstrategy/e63f3a3afd76d1e7145b2a2e98104556 to your computer and use it in GitHub Desktop.
Make a movie from a graphviz saved to a public etherpad
#!/bin/bash
# cf http://mclear.co.uk/2012/10/16/etherpad-viewing-a-saved-revision/
i=1
echo "get revisions for url: $1"
while [ $? = 0 ]
do
curl "$1/$i/export/txt" > "`printf %04d $i`.dot"
i=$[$i+1]
done
#!/bin/bash
# We saved all of the revisions as dot files
echo "generating png with graphviz"
i=0
for graph in *.dot
do
dot -Gsize=192,108\! -Gdpi=10 -T png -o "`printf %04d $i`.png" "$graph"
if [ $? = 0 ]
then
i=$[$i+1]
fi
done
echo "making stills fit entire frame"
for i in *.png
do
mogrify -gravity center -background white -extent 1920x1080 $i
done
# c=0; for i in *.png; do mv "$i" "`printf %04d $c`.png"; c=$((c+1));
echo "generating movie from stills"
ffmpeg -r 16 -i %04d.png -f mov -vcodec qtrle -pix_fmt rgb24 osp.web.movie.mov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment