summaryrefslogtreecommitdiff
path: root/src/app/bad-apple-stm32f4-ssd1306-128x64/convert
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-02-12 17:32:48 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2024-02-12 17:32:48 +0100
commit5db1ecd3fc2ab0c7942476bae07e57be66e7689c (patch)
tree30a0a75949c9dd27992f84da481be5d7d35d0fd0 /src/app/bad-apple-stm32f4-ssd1306-128x64/convert
parent3fffef85de0b780eb26beef5625242355053e872 (diff)
Add Bad Apple on STM32F4 (WiP; timer is still missing)
Diffstat (limited to 'src/app/bad-apple-stm32f4-ssd1306-128x64/convert')
-rwxr-xr-xsrc/app/bad-apple-stm32f4-ssd1306-128x64/convert16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/app/bad-apple-stm32f4-ssd1306-128x64/convert b/src/app/bad-apple-stm32f4-ssd1306-128x64/convert
new file mode 100755
index 0000000..7d2ca0e
--- /dev/null
+++ b/src/app/bad-apple-stm32f4-ssd1306-128x64/convert
@@ -0,0 +1,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