blob: cbd62bbcc99cb0a8c4b99a7c8b3895d348775e3f [file] [log] [blame]
Joe Gregorio1e735c02017-04-19 14:05:14 -04001#!/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.
8FPS=15
9DURATION=3
10FRAMES=$((DURATION * FPS))
11mkdir -p /tmp/animation
12for i in $(seq -f "%05g" 0 $FRAMES)
13do
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
16done
17cd /tmp/animation; ffmpeg -r $FPS -pattern_type glob -i '*.png' -c:v libvpx-vp9 -lossless 1 output.webm