diff --git a/tools/janeway.sh b/tools/janeway.sh new file mode 100755 index 0000000..7cbb78a --- /dev/null +++ b/tools/janeway.sh @@ -0,0 +1,6 @@ +#!/bin/bash +while true +do +for i in $(seq 0 9 20); do ./udp8icon.sh stratrek8x8.png ${i} 10; sleep 0.2; done +done + diff --git a/tools/movie.sh b/tools/movie.sh new file mode 100755 index 0000000..a8859a5 --- /dev/null +++ b/tools/movie.sh @@ -0,0 +1,15 @@ +#!/bin/bash +input=$1 +FULLSECONDS="$(ffprobe -i "${input}" -show_entries format=duration -v quiet -of csv="p=0" | sed 's/\..*//')" +echo "Seeking ${FULLSECONDS} seconds" +for i in $(seq 0 ${FULLSECONDS}) +do + # ffmpeg -y -ss ${i} -i "${input}" -r 1 -vframes 1 -vf scale=8:8 -f image2pipe - 2>/dev/null | convert - -rotate 90 -normalize rgb:- >/dev/udp/172.23.23.54/4210 + ffmpeg -y -ss ${i} -i "${input}" -r 1 -vframes 1 -f image2 /tmp/movieimg.jpg 2>/dev/null + clear; jp2a /tmp/movieimg.jpg + ffmpeg -y -ss ${i} -i "${input}" -r 1 -vframes 1 -vf scale=8:8 -f image2 /tmp/movieimg.png 2>/dev/null + # convert /tmp/movieimg.png -rotate 90 -normalize rgb:- >/dev/udp/172.23.23.54/4210 + convert /tmp/movieimg.png -rotate 90 rgb:- >/dev/udp/172.23.23.54/4210 + sleep 1 +done + diff --git a/tools/startrek8x8.png b/tools/startrek8x8.png new file mode 100644 index 0000000..c9c9156 Binary files /dev/null and b/tools/startrek8x8.png differ diff --git a/tools/webcam.sh b/tools/webcam.sh new file mode 100755 index 0000000..443c7b1 --- /dev/null +++ b/tools/webcam.sh @@ -0,0 +1,26 @@ +#!/bin/bash +CURRENTWIFI=$(iwconfig 2>&1 | grep ESSID | grep \" | sed 's/.*:"\(.*\)"/\1/') +if [ ${#CURRENTWIFI} -eq 0 ]; then + echo "You have to be in the CTDO-IoT-WiFi for this to work. You're not connected at all." + exit 0 +fi +if [ ${CURRENTWIFI} != "CTDO-IoT" ]; then + echo "You have to be in the CTDO-IoT-WiFi for this to work" + exit 0 +fi +PIXELBOXIP=$(mosquitto_sub -h raum.ctdo.de -t 'homie/pixelbox/$localip' -C 1) +echo "Pixelbox should be on ${PIXELBOXIP}, presuming WiFi connection." + +ping -c 1 -s 1 -W 1 ${PIXELBOXIP} 1>/dev/null 2>&1 +if [ $? -eq 0 ]; then + echo "Pixelbox replies, starting webcam." +else + echo "The Pixelbox with IP ${PIXELBOXIP} is unreachable." + exit 0 +fi + +while true +do +ffmpeg -y -f video4linux2 -i /dev/video0 -vframes 1 -vf scale=8:8 -f image2 - 2>/dev/null | convert - -rotate 90 -normalize rgb:- >/dev/udp/${PIXELBOXIP}/4210 +sleep 0.1 +done