[rescue] IndyCam

David Michaud rescue at sunhelp.org
Tue Jun 12 10:56:06 CDT 2001


Jeff Workman wrote:
> 
> Anybody know of any freeware, commandline apps that will grab a still image
> from an IndyCam?  I need something I can run from a cron job, while loop,
> etc. so that I can use it as a web cam.
> 

I used to have a webcam thing going on here a few years ago using an
Indy, and I wrote my own script to do the job, and here it is. You will
have to change it to fit your needs.

#!/bin/sh
# file: capt
# desc: Capture stills from node 0 & 1 of Vino video port, then
# process and save them for web use (keycam.html).
# 11/19/1997, rev. F (05/15/1998)

dir='/usr/people/dmichaud/public_html/capture'
f=`date '+%H%M%S'`
d=`date '+%H'`

cp $dir/f $dir/f.old
playaiff /usr/share/data/sounds/soundscheme/soundfiles/sk_lock.aifc
vidtomem -v 1 -z 1/2 -f $dir/$f-room >/dev/null 2>&1
playaiff /usr/share/data/sounds/soundscheme/soundfiles/sk_lock.aifc
vidtomem -v 0 -z 1/2 -f $dir/$f-any >/dev/null 2>&1

if test $d -ge 16 -o $d -le 6
then
options='+contrast -gamma 1.5'
else
options='-gamma 1.45'
fi

/usr/local/bin/mogrify $options -qual 75 \
 -mattecolor 'light slate blue' -frame 4x4 \
 -format jpg $dir/$f-room-00000.rgb $dir/$f-any-00000.rgb

date "Dave\'s Office: +%a %b %e %H:%M %Z %Y  KTI" > $dir/date.txt
/usr/local/bin/mogrify -display spyder:0 -pen '#FFFFFF' \
 -font '-*-helvetica-medium-r-*-*-12-*-*-*-*-*-iso8859-*' \
 -draw 'text 7,230 "@/dsk2/www/html/capture/date.txt"' \
 $dir/$f-room-00000.jpg $dir/$f-any-00000.jpg

date "+Another View: %a %b %e %H:%M %Z %Y  KTI" > $dir/date.txt
/usr/local/bin/mogrify -display spyder:0 -pen '#FFFFFF' \
 -font '-*-helvetica-medium-r-*-*-12-*-*-*-*-*-iso8859-*' \
 -draw 'text 7,230 "@/dsk2/www/html/capture/date.txt"' \
 $dir/$f-any-00000.jpg

date '+%A, %B %e, %r %Z' > $dir/date.txt
echo $f > $dir/f
rm $dir/$f*.rgb
mv $dir/`cat $dir/archive/f.old`*.jpg

mv $dir/$f-room-00000.jpg $dir/$f-room.jpg
mv $dir/$f-any-00000.jpg $dir/$f-any.jpg


Hope this helps,
Dave




More information about the rescue mailing list