diff --git a/acatcher/.gitignore b/acatcher/.gitignore index 4ea318b..9b9f658 100644 --- a/acatcher/.gitignore +++ b/acatcher/.gitignore @@ -1,2 +1,4 @@ acatcher *.o +HOSTS +SERVERIP diff --git a/acatcher/mkhosts b/acatcher/mkhosts new file mode 100755 index 0000000..abd4795 --- /dev/null +++ b/acatcher/mkhosts @@ -0,0 +1,16 @@ +#!/bin/sh +NUM=0 +while read FOO; do + if ! echo $FOO | grep -q ^#; then + HOST="`echo $FOO | cut -d\| -f3`" + IP="`echo $FOO | cut -d\| -f2`" + if ! echo $HOST | egrep -q "(server|spare)"; then + >&2 echo found host $HOST ip $IP num $NUM + echo "$HOST:$IP:$NUM" + NUM=$((NUM+1)) + elif echo $HOST | grep -q server; then + >&2 echo found server at ip $IP + echo $IP > SERVERIP + fi + fi +done < $HOME/Dropbox/CAMS > HOSTS diff --git a/acatcher/stream.sh b/acatcher/stream.sh index 20b42d0..43c7c09 100755 --- a/acatcher/stream.sh +++ b/acatcher/stream.sh @@ -1,11 +1,20 @@ #!/bin/sh -SERVERIP=192.168.24.20 -SESSION_ID="01" +SERVERIP=`cat SERVERIP` +HOSTNAME=`hostname` +NUM=`grep ^$HOSTNAME: HOSTS | cut -d: -f3` +if [ -z "$NUM" ]; then + echo "error: could not find host number for `hostname`!" + exit 1 +fi +ASESSION=$((4000+NUM)) +VSESSION=$((4100+NUM)) +echo "i am $HOSTNAME machine $NUM asession $ASESSION vsession $VSESSION server at $SERVERIP" +exit 1 # different res is ok, MUST be mjpg v4l2-ctl --set-fmt-video=width=640,height=480,pixelformat=MJPG amixer -c 1 sset Mic,0 80%,80% unmute cap -(while true; do arecord -t raw -c 1 -f S16_LE -r 22050 -D hw:1 | nc $SERVERIP 40$SESSION_ID; sleep 1; done) & -while true; do ./v4lcap -o | nc $SERVERIP 41$SESSION_ID; sleep 1; done +(while true; do arecord -t raw -c 1 -f S16_LE -r 22050 -D hw:1 | nc $SERVERIP $ASESSION; sleep 1; done) & +while true; do ./v4lcap -o | nc $SERVERIP $VSESSION; sleep 1; done