Announcement

Collapse
No announcement yet.

!Need Help With Security!

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    !Need Help With Security!

    I recently got robbed, so I bought some cheap webcams on amazon and what I want to do is use them to survey the perimeter. I am going to hook up some motion sensors to floodlights and I want my webcams to start recording only when significant motion (such as a person moving) is detected. Are there any good programs out there that will help me do this?

    Thanks,
    -Jimmy
    Motherboard:ASUS P5Q SE PLUS<br />Videocard:EVGA GeForce 9800 GTX+ 512MB<br />Ram:G.SKILL 4GB (2 x 2GB)<br />Processor:Intel Core 2 Quad Q6600 Kentsfield 2.4GHz

    #2
    Re: !Need Help With Security!

    V4L capture program supporting motion detection
    Open a konsole and issue:
    sudo apt-get install motion

    Motion is a program that monitors the video signal from one or more cameras and is able to detect if a significant part of the picture has changed. Or in other words, it can detect motion.

    Motion is a command line based tool. It has no graphical user interface. Everything is setup either via the
    command line or via configuration files.

    The output from motion can be:
    - jpg files
    - ppm format files
    - mpeg video sequences

    Also, motion has its own minimalistic web server. Thus, you can access the webcam output from motion via a browser.

    Read this. The script it talks about is this:
    Code:
    #!/usr/bin/perl
    
    use File::Basename;
    
    sub delete_recent {
    	$d = $_[0];
    	$mintime = $_[1];
    
    	$d =~ s/\/$//;	# Remove trailing slash (if present)
    	$current_time = time;
    	
    	foreach $file (<$d/*>) {
    		$mtime = ( stat $file )[9];
    		$diff = $current_time - $mtime;
    		
    		if ($diff < $mintime) {
    			unlink($file);
    		}
    	}
    }
    
    sub monitor {
    	$wait_before = $_[0];
    	$wait_after = $_[1];
    	
    	my $cmd = "dbus-monitor --session \"type='signal',interface='org.gnome.ScreenSaver',member='ActiveChanged'\"";
    	open (IN, "$cmd |");
    	while (<IN>) {
    		if (m/^\s+boolean true/) {
    			# SESSION IDLE
    			sleep($wait_before);
    			system("motion &");
    
    		} elsif (m/^\s+boolean false/) {
    			# SESSION NO LONGER IDLE
    			system("killall motion");
    			sleep 1;		# Wait for motion to shut down.
    			delete_recent("/tmp/motion",$wait_after+1);
    		}
    	}
    }
    
    # Start monitoring when screensaver is active
    # Parameter 1: Wait x seconds before turning on the camera
    # Parameter 2: Dump files made y seconds prior to unlocking the screensaver
    monitor(30,30);
    The author of "motion" wrote some useful tips and techniques: http://www.chriswpage.com/2009/05/se...04-and-motion/
    "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
    – John F. Kennedy, February 26, 1962.

    Comment

    Working...
    X