aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/fiddle/animate.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/fiddle/animate.sh')
-rwxr-xr-xtools/fiddle/animate.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/fiddle/animate.sh b/tools/fiddle/animate.sh
new file mode 100755
index 0000000000..cbd62bbcc9
--- /dev/null
+++ b/tools/fiddle/animate.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+# Copyright 2017 Google Inc.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Create a 3 second long animation from the Raster output of fiddle at 15 fps.
+FPS=15
+DURATION=3
+FRAMES=$((DURATION * FPS))
+mkdir -p /tmp/animation
+for i in $(seq -f "%05g" 0 $FRAMES)
+do
+ ./out/Release/fiddle --duration $DURATION --frame `bc -l <<< "$i/$FRAMES"` | ./tools/fiddle/parse-fiddle-output
+ cp /tmp/fiddle_Raster.png /tmp/animation/image-"$i".png
+done
+cd /tmp/animation; ffmpeg -r $FPS -pattern_type glob -i '*.png' -c:v libvpx-vp9 -lossless 1 output.webm