[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: webcam graber/uploader



On Sat, Dec 11, 2004 at 11:18:38PM -0500, stan wrote:
> I got a webacm the other day, and now that I've got it working I wanted to
> put the images up on my webserver.
> 
> I looked at : http://www.aboutdebian.com/webcam.htm, and managed to make it
> work with the Debian webcam package, but it just seems to stop working
> after an hour or so. The webcam pprocess is still running, but no new
> images are being ftp'd to the webserver. I even set up a script in
> /etc/rc2.d to satrt this thing on boot.
> 
> Now obviously I could script something, and maybe I should, but I thought
> I'd ask if there was a beteer Debian package to ry, firts?
Hm I'm using vgrabbj, lftp, cron and a few very short shell scripts to
grab the picture and upload it to my ftp server with ftps.

Donno if it helps you ...

crontab line:
-------------
*/5 * * * * /home/sven/camstuff/grabimage.sh


The grabimage.sh script:
------------------------
#!/bin/bash
#get a current img from cam
vgrabbj -i sif -f /home/sven/camstuff/current.jpg -d /dev/video0 -t /home/sven/camstuff/FreeMonoBold.ttf -m 75 -a 3 -n > /dev/null 2>&1

#cp current img into the archiv
cp /home/sven/camstuff/current.jpg /home/sven/camstuff/archiv/img-$(date +%Y%m%d%k%M|sed -e 's/ //g').jpg

#upload current img
lftp -f /home/sven/camstuff/ftpscript > /dev/null 2>&1


The ftpscript for lftp:
-----------------------
open -u user,pass my.server.de
put /home/sven/camstuff/current.jpg -o current-tmp.jpg
mv current-tmp.jpg current.jpg
quit

HTH
Sven
-- 
     COMBO GUANO WEIHNACHTSKONZERT
 Saal Norhausen, Leverkusen-Rheindorf
        23.12.2004 - 19:00Uhr
       http://www.comboguano.de



Reply to: