summaryrefslogtreecommitdiff
path: root/src/app/bad-apple-atmega2560-ssd1306/convert
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/bad-apple-atmega2560-ssd1306/convert')
-rwxr-xr-xsrc/app/bad-apple-atmega2560-ssd1306/convert17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/app/bad-apple-atmega2560-ssd1306/convert b/src/app/bad-apple-atmega2560-ssd1306/convert
new file mode 100755
index 0000000..964c7a4
--- /dev/null
+++ b/src/app/bad-apple-atmega2560-ssd1306/convert
@@ -0,0 +1,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