Initale Version, funktioniert

This commit is contained in:
starcalc 2017-03-02 21:26:09 +01:00
commit adecbb0e6b
1 changed files with 30 additions and 0 deletions

30
playmovie_ctdo.sh Executable file
View File

@ -0,0 +1,30 @@
#!/bin/bash
TMPMOVIE=/tmp/moviejpg
mkdir -p ${TMPMOVIE}
rm -Rf ${TMPMOVIE}/*
ls -lA ${TMPMOVIE}
avconv -i $1 -r 5 -f image2 ${TMPMOVIE}/%04d.jpg >/dev/null 2<&1 &
AVCONV_PID=$!
while [ ! -f ${TMPMOVIE}/0001.jpg ]
do
# TODO: Abbruch, wenn avconv Fehler gemacht hat
sleep 1
done
for i in $(seq -w 1 9999)
do
if [ -f ${TMPMOVIE}/${i}.jpg ]; then
echo "${i}.jpg found"
mosquitto_pub -h raum.ctdo.de -t 'raum2/flipdot/image/set' -m $(jp2a --size=80x16 --chars="01111" ${TMPMOVIE}/${i}.jpg | tr -d '\n')
sleep 0.2
else
echo "Aborting!"
break
fi
done
echo "Cleaning up"
kill ${AVCONV_PID}
sleep 1
rm -Rf ${TMPMOVIE}/*
# for file in *.jpg; do mosquitto_pub -h raum.ctdo.de -t 'raum2/flipdot/image/set' -m $(jp2a --size=80x16 --chars="01111" ${file} | tr -d '\n'); sleep 0.2; done