summaryrefslogtreecommitdiff
path: root/src/app/ssd1306-bad-apple/convert
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2021-04-13 08:31:21 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2021-04-13 08:31:21 +0200
commit168ea4b5641eb08ef24c70e94e332aaabf7e2e81 (patch)
tree0b24f7340be7e671c61d9d4f3f3c699349e2c235 /src/app/ssd1306-bad-apple/convert
parentb650f2ac498df4ba18d23ad7f02637f40917c28e (diff)
add ssd1306 bad apple skeleton
Diffstat (limited to 'src/app/ssd1306-bad-apple/convert')
-rwxr-xr-xsrc/app/ssd1306-bad-apple/convert16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/app/ssd1306-bad-apple/convert b/src/app/ssd1306-bad-apple/convert
new file mode 100755
index 0000000..f0118dd
--- /dev/null
+++ b/src/app/ssd1306-bad-apple/convert
@@ -0,0 +1,16 @@
+#!/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 128x64 -threshold 50% -- tmp/*.png
+
+echo "const unsigned char frame_rate = $3;" > frames.cc
+./frames-to-cc tmp/*.png >> frames.cc
+
+rm -rf tmp