Versione 3 , tutta colorata. Sfogo del piccolo tamarro che e’ in me.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | #!/bin/bash trap "echo 'eh?'" SIGINT SIGTERM echo -e "\nBigBrother's eye v0.3\n" echo -n -e "\E[32mstarting \E[37m... " sleep 1 echo -e "(pid is $$)\n" cd $HOME/immagini/bigbrother/ img=frame.jpg list=frames.list if [ -f $list ] then n=`tail -n 1 $list` else touch $list n=0 fi sleep 1 webcam /etc/webcam/bigbrother.conf &> cam.log & echo -n "grabbing frames ... (press x to stop) ... " until [ "$input" = "x" ] do read -t1 -s -n1 input if [ -f $img ] then n=$((10#$n)) n=$[n+1] n=`printf %05d $n` mv $img $n.jpg echo $n >> $list fi done pkill webcam echo -e " \E[31mstopped\n" echo -n -e "\E[37mstarting avi creation ... " mencoder mf://*.jpg -mf w=640:h=480:fps=1:type=jpg -ovc copy -o btemp.avi &> menc.log && printf "\n===============================\n\n" >> menc.log && mencoder btemp.avi -forceidx -ovc copy -o bigB.avi >> menc.log 2>&1 && rm btemp.avi sleep 1 echo -e "\E[32mdone\n" tput sgr0 |