Commit before breaking everything
[matches/honours.git] / research / TCS / movie.sh~
diff --git a/research/TCS/movie.sh~ b/research/TCS/movie.sh~
new file mode 100755 (executable)
index 0000000..ea8df0c
--- /dev/null
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+# Script to create a movie from files
+
+if [ "$#" == "0" ]; then
+       exit 0
+fi
+
+i=1
+plot=/home/sam/Documents/University/honours/research/TCS/plot.sh
+process=/home/sam/Documents/University/honours/research/TCS/process.py
+process2=
+#process="" # Do nothing
+
+mkdir -p images
+
+for arg in $@; do
+       echo "Plotting $arg"
+       if [ "$process" != "" ]; then
+               echo "Process: $process $arg $process2 > $arg.p"
+               $process $arg $process2 > $arg.p
+               $plot $arg.p images/$i.png $1.p
+               
+       else
+               $plot $arg images/$i.png $1
+       fi
+       
+       i=$(( $i + 1 ))
+done
+
+cd images
+
+ffmpeg -r 10 -b 1024k -i %d.png movie.mp4
+
+rm -f *dat.p

UCC git Repository :: git.ucc.asn.au