Initale Version, funktioniert
This commit is contained in:
commit
adecbb0e6b
|
@ -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
|
||||
|
Loading…
Reference in New Issue