You are not logged in.

#1 2010-11-16 18:36:13

gazj
Member
From: /home/gazj -> /uk/cambs
Registered: 2007-02-09
Posts: 681
Website

Help with a motion detector camera script please ;)

Hi All

I have installed a couple of cameras at a friends property, all are working fine.  The only supported motion detection system by the cameras is to upload a jpg to an ftp server.  I am trying to write a script that monitors or the presence of such a jpg file, records for a few seconds then delete's the jpg file and waits for the new trigger.  I am having problems with deetecting the file.  Please bash kings (and queens) come to my rescue wink

#!/bin/bash
#Motion recorder script for edimax cameras

#Triggers from camera software
hall="/home/david/hall"
lounge="/home/david/lounge"

#Video output directories
hallout="/home/david/hall"
loungeout="/home/david/lounge"

#Record run time in seconds
halltime=5
loungetime=15

#Stream paths
hallstream=http://admin:pwd@192.168.2.11/mjpg/video.mjpg
loungestream=http://admin:pwd@192.168.2.12/mjpg/video.mjpg

while true 
do

for F in $hall/motion*.jpg
do
    rm $hall/*.jpg & curl -sS -o $hallout/`date +%y-%m-%d %T`.mjpg -m $halltime $hallstream
done

for F in $lounge/motion*.jpg
do
    rm $lounge/*.jpg & curl -sS -o $loungeout/`date +%y-%m-%d %T`.mjpg -m $loungetime $loungestream
done

done

Offline

#2 2010-11-16 20:25:15

keenerd
Package Maintainer (PM)
Registered: 2007-02-22
Posts: 647
Website

Re: Help with a motion detector camera script please ;)

The motion detectors built into cameras almost always are horrid.

Use this instead.  It is packaged in community.

Offline

#3 2010-12-06 22:23:52

gazj
Member
From: /home/gazj -> /uk/cambs
Registered: 2007-02-09
Posts: 681
Website

Re: Help with a motion detector camera script please ;)

Only just got back onto this, this is a fantastic piece of software, exactly what I was looking for.  Thank you

Offline

Board footer

Powered by FluxBB