blob: 964c7a4fc46ea4a3d7afc8eeec888d46caafff5f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#!/bin/sh
# [size=WxH] ./convert.sh <file> -r <frame rate> [additional ffmpeg args]
set -eu
mkdir -p tmp
ffmpeg -i "$@" tmp/frame%4d.png
parallel mogrify -resize "${size:-128x32}" -threshold 50% -- tmp/*.png
echo "#include <avr/pgmspace.h>" > frames.cc
echo "const unsigned char frame_rate = $3;" >> frames.cc
./frames-to-cc tmp/*.png >> frames.cc
rm -rf tmp
|