summaryrefslogtreecommitdiff
path: root/src/app/ssd1306-bad-apple/convert
blob: 7d2ca0ea60bcadb73afdec6e2ebac7b4895206ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/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:-128x64}" -threshold 50% -- tmp/*.png

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

rm -rf tmp