Results 1 to 15 of 27

Thread: [HOW-TO] webcam

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2008
    Location
    Netherlands
    Posts
    74
    Qbasic *cough* *cough*

    Be careful, or you'll sound like a barbarian
    Tcsh should be much to your liking then. OK back on topic I guess ...

  2. #2
    Join Date
    Dec 2007
    Location
    The Netherlands - Eindhoven
    Posts
    1,767
    Quote Originally Posted by EdP View Post
    Qbasic *cough* *cough*

    Be careful, or you'll sound like a barbarian
    Tcsh should be much to your liking then. OK back on topic I guess ...
    hey don't underestimate the sheer power of qbasic

    anyway, this is the latest version of the script, which gives a harddrive time to spin down by temporary storing the files in /tmp/imag

    I tested it, and it worked great
    here it is:
    Code:
    #!/bin/sh
    #Seconds of sleep before doing another copy
    SLEEP=15
    #Source JPG file that needs to be copied.
    SOURCEJPG=/var/tmp/display.jpg
    #Output folder which will contain all the JPG files
    OUTPUT=/mnt/webcamimages
    #Choose between a counting name or date(not working yet)
    #COUNTING   or    DATE
    MODE=COUNTING
    
    #Optimize for Harddrive spindown? (TRUE or FALSE)
    OPTIMIZE=TRUE
    #Save files up to ... in flash
    #The max size of an jpeg file is about 65KB so 65*150=9,75MB wich leaves enough of the ~14,5MB flash.
    #And if the images are taken every 15sec you will leave the hdd untouched for 37min!
    #Please keep in mind that if you set it too high there won't be memory left in /tmp
    FLASHSAVE=150
    #Flash directory to save in
    FLASHDIR=/tmp/imag
    
    
    
    COUNT=0
    if [ $OPTIMIZE="TRUE" ]; then
    	if ( [ ! -d $FLASHDIR ] ); then
    		/bin/mkdir $FLASHDIR
    		fi
    	/bin/rm $FLASHDIR/*
    	if [ $MODE="COUNTING" ]; then
    			while /bin/true; do
    				for i in $(seq 1 $FLASHSAVE); do
    					/bin/cp $SOURCEJPG $FLASHDIR/$COUNT.jpg
    					COUNT=$(($COUNT + 1))
    					/bin/sleep $SLEEP
    				done
    				/bin/cp $FLASHDIR/* $OUTPUT/
    				/bin/rm $FLASHDIR/*
    			done
    		fi
    	else
    		if [ $MODE="DATE" ]; then
    			while /bin/true; do
    			for i in $(seq 1 $FLASHSAVE); do
    				/bin/cp $SOURCEJPG $FLASHDIR/img\_$(/bin/date '+%Y%m%d_%H%M%S').jpg
    				/bin/sleep $SLEEP
    			done
    			/bin/cp $FLASHDIR/* $OUTPUT/
    			/bin/rm $FLASHDIR/*
    			done
    		fi
    fi
    else
    	if [ $OPTIMIZE="FALSE" ]; then
    		if [ $MODE="COUNTING" ]; then
    			while /bin/true; do
    				/bin/cp $SOURCEJPG $OUTPUT/$COUNT.jpg
    				COUNT=$(($COUNT + 1))
    				/bin/sleep $SLEEP
    			done
    		fi
    		else
    		if [ $MODE="DATE" ]; then
    			while /bin/true; do
    			/bin/cp $SOURCEJPG $OUTPUT/img\_$(/bin/date '+%Y%m%d_%H%M%S').jpg
    			/bin/sleep $SLEEP
    			done
    		fi
    	fi
    another example of the script result:
    http://www.youtube.com/watch?v=5LW9RsETEBk

  3. #3
    Thanks wpte & Edp -

    This is great, I spent some time trying the rcamd commands but with no luck...

    what does the -r setting do?

    Code:
    rcamd -p 7777 -s 4 -z MET-1METDST,M3.5.0/2,M10.5.0/3 -a 0 -t 0 -r 0 -f 640x480 -m 100 -c 100 &
    and why does it record 6 files - record0.jpg - record5.jpg?

    Really appreciate this, as there was no chance of me solving this in such an elegant way

    Velcrow
    Last edited by velcrow; 25-07-2009 at 19:48.

  4. #4
    Join Date
    Dec 2007
    Location
    The Netherlands - Eindhoven
    Posts
    1,767
    Quote Originally Posted by velcrow View Post
    Thanks wpte & Edp -

    This is great, I spent some time trying the rcamd commands but with no luck...

    what does the -r setting do?

    Code:
    rcamd -p 7777 -s 4 -z MET-1METDST,M3.5.0/2,M10.5.0/3 -a 0 -t 0 -r 0 -f 640x480 -m 100 -c 100 &
    and why does it record 6 files - record0.jpg - record5.jpg?

    Really appreciate this, as there was no chance of me solving this in such an elegant way

    Velcrow
    what about using the -h parameter
    Code:
     rcamd -h
    Usage: rcamd [options]
           -d <debug level>
           -m <max difference threshold=0-255> (lower->more updates, default=30)
           -s <seconds between frames> (default==1)
           -f  <WidthxHeight obey supported size> define size of the output image (default:640x480)
           -p <port to listen for connections>
           -b <brightness=1-500> (default=400 available only cameratype=1)
           -g <gain=0-4> corresponding to a gain of 2^<gain> (default=0)
           -t <cameratype=0,1> corresponding to a camera driver (0:pwc or 1:ov511 default=0)
           -r <record interval=0-65535> (default=60 minutes)
           -a <alert=0,1> define if alert is on or off)
           -s <max count for difference threshold=0-999999> (default=100)
           -z <time zone string>
    for me it only records 3 shots

    but I don't understand completely... couldn't you get the bash script working?
    Last edited by wpte; 25-07-2009 at 20:48.

  5. #5
    -h lol

    No script is great - - just trying to see if rcamd has any "native" commands that could be used.

    One question where should the script be created / saved - /opt/sbin/?

    I plan to use cron to gzip the folder at night

    Thanks again for the help...
    Last edited by velcrow; 25-07-2009 at 21:28.

  6. #6
    Join Date
    Dec 2007
    Location
    The Netherlands - Eindhoven
    Posts
    1,767
    Quote Originally Posted by velcrow View Post
    -h lol

    No script is great - - just trying to see if rcamd has any "native" commands that could be used.

    One question where should the script be created / saved - /opt/sbin/?

    I plan to use cron to gzip the folder at night

    Thanks again for the help...
    you can place the script anywhere you want, even on the harddrive
    I tested in on a hdd, and it still spun-down good, so I guess it's a perfect script

    np mate, any time

  7. #7
    Join Date
    Dec 2008
    Location
    Netherlands
    Posts
    74
    Quote Originally Posted by velcrow View Post
    and why does it record 6 files - record0.jpg - record5.jpg?
    it always makes those record*.jpg files and uses them to compare, motion can only be detected by comparing images after all.

  8. #8
    Thanks Edp - Yes, makes sense.

    rcamd - our (my) misunderstood friend.

  9. #9
    Does anyone have a webcam running on WL-500gP v2? I have two different cameras which no go. I checked them with spca, pwc and ovc and they are not recognized. Spent to much time trying make it work. Give me please a webcam name which is working for sure under Oleg or dd-wrt firmware and I will buy it.

  10. #10
    Join Date
    Dec 2008
    Location
    Netherlands
    Posts
    74
    Check out the WL500g Reported Compatible Hardware > Webcams section.

Similar Threads

  1. Replies: 10
    Last Post: 21-12-2012, 08:55
  2. [How to] rtorrent & ntorrent
    By mancub in forum WL-500gP Tutorials
    Replies: 101
    Last Post: 18-12-2008, 07:21
  3. [How To] 2 zusätzliche interne USB Ports am WL500gP nutzbar machen
    By rj.2001 in forum German Discussion - Deutsch (DE)
    Replies: 6
    Last Post: 02-10-2008, 11:32
  4. [HOW TO] Bluetooth in wl500g
    By TIk in forum WL-500g/WL-500gx Tutorials
    Replies: 1
    Last Post: 17-09-2008, 21:38
  5. [HOW TO] Timeouts beim Laden von bestimmten Seiten beheben - MTU Problem
    By modnet25 in forum German Discussion - Deutsch (DE)
    Replies: 3
    Last Post: 03-09-2006, 10:55

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •