Thats what we've got so far:
#!/bin/bash tempdir=/tmp/fswebcam host="167.174.70.42" destdir=~/fsweb tformat=%Y-%m-%d_%H-%M-%S if [ ! -d "$tempdir" ]; then mkdir $tempdir fi cd $tempdir dooropentime=$(date +$tformat) for i in {1..3} do starttime=$(date +%s%N) echo -e "\n==== starting capture at" $(date +%H:%M:%S.%N) "==== (# $i)" fswebcam --device /dev/video0 --input 0 --resolution 1280x720 --timestamp "$tformat" $tformat.jpg # fswebcam --device RAW:/dev/video0 --palette NV12MB --resolution 1280x720 $tformat.jpg endtime=$(date +%s%N) echo -e "==== capture finished at" $(date +%H:%M:%S.%N) "==== (in "$((($endtime - $starttime) / 1000000))"ms)\n" done echo "packing..." tar -cjf $dooropentime.tar.bz2 *.jpg echo "copying..." scp *.tar.bz2 pi@$host:$destdir #cp *.tar.bz2 $destdir rm -r $tempdir/* echo "done!"
It's still pretty raw, but at least it's working. Capturing a frame takes approximately 3300ms on the pi.
--device RAW:/dev/video0 produces a palette incompatibility error, and the NV12MB palette (http://www.firestorm.cx/fswebcam/ "fswebcam-20060604: Added NV12MB palette type (for raw source only)") seems to be missing.
Any ideas?
fswebcamgets its data from somewhere. I've edited your title to hone in on that issue better.