Joe Gregorio | 1e735c0 | 2017-04-19 14:05:14 -0400 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # Copyright 2017 Google Inc. |
| 3 | # |
| 4 | # Use of this source code is governed by a BSD-style license that can be |
| 5 | # found in the LICENSE file. |
| 6 | |
| 7 | # Create a 3 second long animation from the Raster output of fiddle at 15 fps. |
| 8 | FPS=15 |
| 9 | DURATION=3 |
| 10 | FRAMES=$((DURATION * FPS)) |
| 11 | mkdir -p /tmp/animation |
| 12 | for i in $(seq -f "%05g" 0 $FRAMES) |
| 13 | do |
| 14 | ./out/Release/fiddle --duration $DURATION --frame `bc -l <<< "$i/$FRAMES"` | ./tools/fiddle/parse-fiddle-output |
| 15 | cp /tmp/fiddle_Raster.png /tmp/animation/image-"$i".png |
| 16 | done |
| 17 | cd /tmp/animation; ffmpeg -r $FPS -pattern_type glob -i '*.png' -c:v libvpx-vp9 -lossless 1 output.webm |