Manage IP Cameras without SecuritySpy?

Posted on
Wed Jul 10, 2013 3:52 pm
EddieJ offline
Posts: 14
Joined: Aug 30, 2012

Manage IP Cameras without SecuritySpy?

I'm currently using SecuritySpy (licensed for 8 cameras) and the Cynical SecuritySpy plug in to manage 8 cameras. I love the Cynical Plugin, but I'd like to add more cameras and that requires an upgraded version of SecuritySpy from BenSoftware, which is rather expensive. I'm curious to know if there is a way to manage IP cameras in Indigo 6 without using the SecuritySpy software... Any suggestions?
Thanks!
Eddie

Posted on
Wed Jul 10, 2013 4:17 pm
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Manage IP Cameras without SecuritySpy?

Nope - we leave the camera controls to the experts!

Seriously, though, you can embed any security camera view into a control page - all it needs to do is expose a static image URL.

As for control, it would probably not be a huge task to write a plugin that sends the pan/tilt/zoom commands to an IP camera (though I don't know if there's a standard API for that or if all camera vendors roll their own) but adding the motion sensing functionality that SS does would be much more difficult. We aren't particularly interested in doing either though so you'd need to look to one of our 3rd party developers.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed Jul 10, 2013 7:16 pm
EddieJ offline
Posts: 14
Joined: Aug 30, 2012

Re: Manage IP Cameras without SecuritySpy?

Ok! Good to know. I agree, leave it to the experts. Great job with indigo, by the way! I really enjoy it and its a great tool! Lots of complements from friends on just the cool factor of having a house with a brain!
Thanks so much!
Eddie

Posted on
Wed Jul 10, 2013 11:25 pm
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: Manage IP Cameras without SecuritySpy?

I use EvoCam with my 5 security cameras. I "rolled my own" integration, though, through a series of triggers with AppleScript actions, both on the EvoCam side and the Indigo side. It works quite well, and EvoCam has fairly extensive AppleScript support along with fairly robust triggers with multiple conditions and multiple actions for a fraction of the price of SecuritySpy. Personally, I like the EvoCam interface better as well. SecuritySpy, based on their price, seems to be targeted more at the small-to-medium business (a.k.a. pro) market, where EvoCam seems to be targeting the more consumer oriented DIY audience.

Posted on
Thu Jul 11, 2013 7:33 am
EddieJ offline
Posts: 14
Joined: Aug 30, 2012

Re: Manage IP Cameras without SecuritySpy?

Thanks! I'll take a look at evocam. I've seen it in the market, but ultimately settled for securityspy, albeit shortsightedly.

Posted on
Fri Aug 16, 2013 11:50 pm
ckeyes888 offline
Posts: 2425
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: Manage IP Cameras without SecuritySpy?

Curious how anyone may be handling retrieving camera images/videos remotely.
Using SS it easy enough to trigger recordings, but then what, as CP's can't
display video.

Any ideas or info appreciated!

Thanks,

Carl

Posted on
Sat Aug 17, 2013 1:22 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Manage IP Cameras without SecuritySpy?

ckeyes888 wrote:
Curious how anyone may be handling retrieving camera images/videos remotely. ...

I have a short shell script I run that captures 60 still images at 1 second intervals. The script is started in a Trigger that starts when our gate opens. Each set of images is stored in a separate folder and the folder name is a timestamp. If you load all the snapshots into Preview, you can go through them like a deck of flip-cards.

You would want to change the options to suite your needs. You will also need to figure out the URL for viewing a still photo on your camera. You can tune the script for fewer or more images and shorten ( sleep times less than 1 sec are supported on OS X only) or lengthen the interval.

CAVEAT: Some camera are slow responding and may not be able to handle requests this frequently. You could modify this script to link one of the photos to a static filename used to display an image in a control page. Though, I haven't tried that yet.

Here is the script. Let me know if you have any questions.

Code: Select all
#!/bin/ksh

# Set a few static options
PIC_FOLDER=/var/Portail_Photos
URL=http://192.168.5.37/IMAGE.JPG
DELAY_TO_START=0
INTERVAL=1
MAX_PIC=60
USERNAME=user
PASSWORD=pass

# ----- Do not change anything below this line -----
DATE=`date +"%y-%m-%d-%H_%M_%S"`
TARGET_DIR=${PIC_FOLDER}/$DATE
mkdir  $TARGET_DIR

sleep $DELAY_TO_START

for i in {1..$MAX_PIC}
do
        FNAME=${TARGET_DIR}/PIC-${i}.jpg
        curl -s -u ${USERNAME}:${PASSWORD} $URL >$FNAME
        sleep $INTERVAL
done

Posted on
Sat Aug 17, 2013 5:19 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Manage IP Cameras without SecuritySpy?

berkinet wrote:
... You could modify this script to link one of the photos to a static filename used to display an image in a control page.


Actually, that is probably a bit more complicated than I first thought, you have to convert the jpg to a png. However, OS-X contains sips for image manipulation from the command line and that can handle the format, and size conversions as needed.

Posted on
Sat Aug 17, 2013 9:04 am
ckeyes888 offline
Posts: 2425
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: Manage IP Cameras without SecuritySpy?

Thanks a bunch. Looks like it may be just what I was looking for.

Carl

Posted on
Sat Aug 17, 2013 10:15 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Manage IP Cameras without SecuritySpy?

Ignore my comments about changing from jpg to png format. Matt did a nice job covering posting jpgs on control pages in this topic.

Posted on
Sun Dec 01, 2013 7:57 am
hamw offline
Posts: 1212
Joined: Mar 31, 2008

Re: Manage IP Cameras without SecuritySpy?

nsheldon wrote:
I use EvoCam with my 5 security cameras. I "rolled my own" integration, though, through a series of triggers with AppleScript actions, both on the EvoCam side and the Indigo side. It works quite well, and EvoCam has fairly extensive AppleScript support along with fairly robust triggers with multiple conditions and multiple actions for a fraction of the price of SecuritySpy. Personally, I like the EvoCam interface better as well. SecuritySpy, based on their price, seems to be targeted more at the small-to-medium business (a.k.a. pro) market, where EvoCam seems to be targeting the more consumer oriented DIY audience.


nsheldon,

Could you post your triggers and scripts for managing your Evocam setup? I am trying to decide between SecuritySpy and EvoCam -- info on your setup would be very valuable.

Thanks!

Posted on
Sun Dec 01, 2013 10:37 pm
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: Manage IP Cameras without SecuritySpy?

hamw wrote:
nsheldon,

Could you post your triggers and scripts for managing your Evocam setup? I am trying to decide between SecuritySpy and EvoCam -- info on your setup would be very valuable.

Thanks!

I can post some of it. Sharing all of it would take hours to organize and describe properly because there are a lot of inter-connected triggers. There are 3 main parts to the system.

  1. Indigo-centric background AppleScript-based camera pan/tilt integration (does not require EvoCam or SecuritySpy, only that you have at least one Wansview NCB541x or Foscam FI8910W IP camera on the same local network as your computer).
  2. Indigo-triggered EvoCam-centric video recording and automated emailing of videos using Apple's Mail app.
  3. EvoCam-centric daily video file purging of surveillance videos over 1 week old.

Each function involves a lot of triggers and actions, so I don't have time to share all of them at once. Which would be most useful to you?

Posted on
Mon Dec 02, 2013 5:33 am
hamw offline
Posts: 1212
Joined: Mar 31, 2008

Re: Manage IP Cameras without SecuritySpy?

Well, I hate to put you thru any trouble, but if you had time, 2 and 3 would be ideal. I am mostly using fixed cameras

Posted on
Tue Dec 03, 2013 2:07 am
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: Manage IP Cameras without SecuritySpy?

So, for 2), I have the following setup using Indigo, EvoCam and Mail.

When there is motion in areas visible by one of my 5 cameras, or if a door or gate is opened in an area visible by one of the cameras, I have a trigger for each of those events in Indigo. The trigger tells the EvoCam "Canvas" associated with the camera for that area to begin recording. When EvoCam receives the remote AppleEvent trigger from Indigo, it begins recording the video and saving it to the hard drive, while simultaneously executing another AppleScript from within it's own triggering system. That AppleScript waits for the video to finish encoding and being saved to the hard drive and then opens Mail and sends an email to me and my wife with the video as an attachment. Here's the setup.

In Indigo
Example Trigger
Trigger tab
  • Type: Device State Changed
  • Device: Example Front Porch Motion Sensor
  • … On/Off State
  • … Becomes On
Condition tab
  • If conditions match rules: "All" "of the following rules are true,
    If variable isSecurityCamerasEnabled is true,
    If variable RegisteredUsersAtHomeCount is equal to value 0 (zero)
Actions tab
  • Type: Execute Script (Script and File Actions)
  • Embedded AppleScript
    Code: Select all
    tell application "EvoCam"
       tell document "Example Front Porch Canvas" to trigger actions
    end tell

In EvoCam
Example Front Porch Canvas
Actions tab
  • From "Options" menu, make sure "Show Multiple Action Sets" is checked.
  • Set: Motion Activated Recording (I gave the set this name).
  • During these time periods: When document is "online".
  • When any of these conditions occurs:
    … When triggered from a script
    … When any sensor detects motion (a "sensor" is a motion sensitive region on the EvoCam canvas).
  • Perform these actions:
    … Record movie for "10" seconds.
    … … Folder: (where ever you like)
    … … (no Advanced options selected).
  • Set: Email Notification (again, I assigned this name).
  • During these time periods: When document is "online".
  • When any of these conditions occurs:
    … When triggered from a script
  • Perform these actions:
    … Run script:
    Code: Select all
    -- Pause for 2 seconds.
    delay 2
    -- Wait until the file is done being written.
    tell application "Finder"
       set folderPath to folder "Macintosh HD:Library:Security Camera Files:Front Porch:" -- (made up path)
       set theFile to the (last file in folderPath whose name ends with ".mov") as alias
       set fileName to name of theFile
       set fileDone to false
       repeat while fileDone is false
          try
             open for access theFile with write permission
             close access result
             set fileDone to true
          on error
             -- Do nothing.
          end try
          delay 0.5
       end repeat
    end tell

    -- Send the file as an attachment via email.
    set theSubject to "Front Porch Activity Detected"
    set theBody to "Activity was just now detected on the front porch. Attached is a copy of the video recorded from the front porch camera when that activity took place."
    set theFirstAddress to "Your Name <youruser@youremailhost.com>"
    set theSecondAddress to "Another Person <theiruser@theirmailhost.com>"
    set theAttachment to theFile
    set theSender to "Front Porch Camera <frontporchcamera@adummydomain.com>"

    tell application "Mail"
       activate
       delay 1
       set theNewMessage to make new outgoing message with properties {subject:theSubject, content:theBody & return & return, visible:true}
       tell theNewMessage
          set visibile to true
          
          tell application "System Events" to set visible of process "Mail" to false
          
          set sender to theSender
          make new to recipient at end of to recipients with properties {address:theFirstAddress}
          make new to recipient at end of to recipients with properties {address:theSecondAddress}
          try
             make new attachment with properties {file name:theAttachment} at after the last word of the last paragraph
             set message_attachment to 0
          on error errmess -- oops
             log errmess -- log the error in the system log (not Indigo).
             set message_attachment to 1
          end try
          log "message_attachment = " & message_attachment
       end tell
       send theNewMessage
       repeat while background activity count > 0
          delay 0.5
       end repeat
       try
          quit
       on error number -128
          close every window
          quit
       end try
    end tell


For 3), Within the same canvas above, I added an additional action Set.
  • Set: Delete Old Videos (I have it this name too).
  • During these time periods: Every day.
  • When any of these conditions occurs:
    … Every day at 12:00:00 AM
  • Perform these actions:
    … Run script:
  • Code: Select all
    -- Deletes videos created more than 7 days ago.
    do shell script "find /Library/Security\\ Camera\\ Files/Front\\ Porch/ -type f -name \"*.mov\" -ctime +7 -delete"

You do have to keep EvoCam open all the time, but I assume that was the plan all along. I hope that's helpful.

Posted on
Fri Dec 06, 2013 2:20 pm
tadg offline
Posts: 29
Joined: Feb 13, 2008
Location: San Diego, CA

Re: Manage IP Cameras without SecuritySpy?

So I have a simple system going without any extra camera software that just grabs some stills and emails them in response to a trigger. I don't get video recordings of past events, but I do get a picture of the UPS man.

Basically a sensor (motion or driveway) triggers an embedded applescript to run a shell script:
Code: Select all
do shell script "/Users/tadg/Documents/senddrivephotos"


and the senddrivephotos script grabs 2 photos 3 seconds apart and emails them out:

Code: Select all
#!/bin/sh
DATE=`date`
(
cat <<!
From: house@gallistel.net
Subject: Driveway Sensor tripped
To: tadg@gallistel.net
!

cat <<!
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="DMW.Boundary.605592468"

This is a Mime message, which your mail program may not understand. Parts
of the message will appear as text. If the remainder appears as random
characters in the message body, instead of as attachments, then you'll
have to extract these parts and decode them manually.

--DMW.Boundary.605592468
Content-Type: text/plain; name="message.txt"; charset=US-ASCII
Content-Disposition: inline; filename="message.txt"
Content-Transfer-Encoding: 7bit

!

echo "This is the driveway camera at $DATE"
echo
       echo --DMW.Boundary.605592468
       echo Content-Type: application/octet-stream\; name=\"Photo1.jpg\"
       echo Content-Disposition: attachment\; filename=\"Photo1.jpg\"
       echo Content-Transfer-Encoding: base64
       echo

curl -s http://192.168.253.99/usr/yoics1.jpg | perl -e 'use MIME::Base64 qw(encode_base64);local($/) = undef;print encode_base64(<STDIN>);'

sleep 3

echo
       echo --DMW.Boundary.605592468
       echo Content-Type: application/octet-stream\; name=\"Photo2.jpg\"
       echo Content-Disposition: attachment\; filename=\"Photo2.jpg\"
       echo Content-Transfer-Encoding: base64
       echo

curl -s http://192.168.253.99/usr/yoics1.jpg | perl -e 'use MIME::Base64 qw(encode_base64);local($/) = undef;print encode_base64(<STDIN>);'

echo --DMW.Boundary.605592468--

) | /usr/sbin/sendmail -t


So you will want to change the email addresses as well as the URLs that curl uses to grab the stills from the cameras. This also requires that OS X can send email from the command line, all the parts are there, you probably need to configure your mail host and username and password in Postfix. This post explains how to set up postfix to relay mail through gmail:http://www.anujgakhar.com/2011/12/09/using-macosx-lion-command-line-mail-with-gmail-as-smtp/ Here is an additional step for yosemite support: http://stackoverflow.com/questions/26447316/mac-os-x-10-10-yosemite-postfix-sasl-authentication-failed If you are using a different email host, you'll need to change some stuff, but those posts would be a good start.

My driveway camera is an analog camera connected to a yoics box, which was really cheap about 10 years ago, and has passed its prime, but it does make it easy to grab a jpeg snapshot. I'm about to replace this with the Grandstream analog video to IP box, the 3504, that is reasonably priced.

I have a Grandstream indoor IP camera (GXV3615WP-HD) that I am pretty happy with for $75, it does POE and wireless, so it is pretty versatile, but it does suck in dim light. The url to grab a still from it is: http://192.168.253.187/snapshot/view0.jpg . It looks like the Grandstream cameras could do the motion detection and emailing all internally as well, but I haven't tested that.

I also have a Panasonic pan-tilt outdoor camera that I am very happy with, but it was $700 so it had better be good. The url to grab a snapshot from it is: http://192.168.253.98/SnapshotJPEG

Tad

Edited to add some comments on email.
Last edited by tadg on Sat Jan 03, 2015 3:24 pm, edited 1 time in total.

Who is online

Users browsing this forum: No registered users and 24 guests