summaryrefslogtreecommitdiff
path: root/src/app/bad-apple-msp430fr-sharp96/convert
blob: f74a7ef474b86063f78a8062460f3154bc756999 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

# ./convert.sh <file> -r <frame rate> [additional ffmpeg args]

set -eu

mkdir -p tmp

ffmpeg -i "$@" tmp/frame%4d.png

parallel mogrify -resize 96x96 -threshold 50% -- tmp/*.png

echo "// $0 $@" > frames.cc
echo "const unsigned char frame_rate = $3;" >> frames.cc
./frames-to-cc tmp/*.png >> frames.cc

rm -rf tmp