Endpoint

Projects and software by Matt Collinge @ www.mattcollinge.co.uk

Simple Webcam Capture

with 30 comments

Introduction

At home I wanted to keep an eye on some builders who were carrying out some work on the house. I found a few freeware/shareware apps for webcam captures that worked pretty well, but then I realised how much CPU they were using. My server is only a 600Mhz box; it’s a fileserver and therefore doesn’t need to be beefy! It averaged out at about 80-90% utilisation which seemed excessive.

Despite taking snapshots from the camera every few seconds, it’s actually on all the time.. this is what’s causing the CPU usage to be so high. There didn’t seem to be any workarounds so I decided to code something up myself.

NOTE: I’m not actively maintaining this program and won’t answer emails about it not working for a particular webcam, or glitches in it’s capture. The code to read data from the webcams is generic stuff & if it doesn’t work I can’t do anything about it I’m afraid.

Features

It’s a simple app with some simple features:

  • Lowers CPU usage by switching off the webcam between snapshots
  • Use any standard windows capture device
  • Capture to a file as a BMP or JPEG image
  • Specify a flexible filename
  • Give the image a caption
  • Specify the frequency of snapshots
  • Can be used via the command line
  • Captures can be triggered via hotkey
  • Execute a file after each snapshot is taken (optional of course)

This last feature is great for those of you who love scripting & macros. You can pass through the name of the snapshot that’s just been taken (by specifying %1) and do whatever you like.. FTP the file, SMS it to your phone, run a batch conversion so that a bunch of JPEG images are compiled into an AVI… it’s up to you. File Mover also has this feature with an example .VBS script.

Downloads (for Windows 9x/200x/XP)

Simple Capture Install Kit v1.3 (177k)
Zipped .exe
(100k) – for those people who don’t like install kits ;-)
VB6 Runtimes for anyone who doesn’t already have them installed
comdlg32.ocx for anyone who doesn’t have it

Changelog

Version 1.3 – Added hotkey and command line support
Version 1.2 – Fixed further filename suffix bugs and added validation
Version 1.1 – Fixed filename suffix bug
Version 1.0 – Initial release

Command Line Arguments

/filename “<full path and filename, e.g. c:\temp\cam.jpg>”
/suffix dd-mm-yyyy
/jpgquality 40
/imgperfect 500
/imgcaption Command line test

Another (free) Alernative

If Simple Webcam Capture isn’t any good for your needs (or plain and simple doesn’t work), then I can recommend Yawcam which I have running when I don’t need the camera to power down after each snapshot.

It’s a free piece of software (always makes a product more likeable!) and has a raft of features including FTP uploads etc etc etc.

License

Simple Webcam Capture is free for non-commercial use, but if you find it useful, a small donation via PayPal (no matter how small) would really make my day! Businesses must contact me if they want to use the application.

Make payments with PayPal - it's fast, free and secure!

DISCLAIMER: A user of this software acknowledges that he or she is receiving this software on an “as is” basis and the user is not relying on the accuracy or functionality of the software for any purpose. The user further acknowledges that any use of this software will be at the user’s own risk and the copyright owner – Matt Collinge – accepts no responsibility whatsoever arising from the use or application of the software.

Written by Matt

May 4, 2006 at 2:02 pm

30 Responses

Subscribe to comments with RSS.

  1. Matt
    I’m looking for a webcam app which allows simple command line capture. Your “Simplecapture” looks like it is designed to do the job. However, I’ve installed it and get the following errors when I try to run it.

    here is my command line test:

    >\Program Files\Simple Webcam Capture\simplecapture.exe /filename “c:\mush.jpg”

    these are the errors that result:

    Error processing command line options (this comes up 4 times before the next error)

    Type mismatch

    Run-time error ’13′: Type mismatch

    Suggestions?

    harrystottle

    July 13, 2007 at 11:13 am

  2. You’ll need the other command line arguments for it to work… from what I remember they’re all required. Let me know if you still have problems. Matt.

    Matt Collinge

    July 16, 2007 at 8:52 pm

  3. Hi Matt,
    I have tested the Simple Webcam Capture program, it was exactly what i wanted., cos it can activate thru command. But i have an issue here, if i do capturing thru the program timer, it took the pictures exactly, but if i use the dos command capturing, like this : “Run c:\scap\simplecapture.exe /filename c:\scap\arc\test.jpg /suffix dd-mm-yyyy hh:nn:ss /jpgquality 80 /imgperfect 500 /imgcaption hh:nn:ss” , the picture capture only 25% of the whole image. What do you think is the problem? please advice.

    Thanks
    Vincent Khoo

    vincentkhoosh

    August 19, 2007 at 6:52 am

  4. Weird; I’ll try to test this out myself and see whether I can work out where the problem lies.. thanks for letting me know! :-)

    Matt Collinge

    August 19, 2007 at 7:03 pm

  5. Any chance of making the source code available? I’m looking to capture images, move them to a server, delete them locally, and create a database entry linking the picture with some user input. I have everything working from the point that the image gets created on the local drive.

    jpryor

    September 17, 2007 at 1:28 pm

  6. Hi! Thanks for your comment. I won’t be releasing the source, but you should be able to do everything you ask with the current version of the app. The feature you should explore is, ‘Execute file’ which you can use to run a script (batch, VBscript, PowerShell or whatever you like). That script can do everything you’re asking for & should be easy to implement. Let me know how you get on (email me directly if you like).

    Matt Collinge

    September 17, 2007 at 7:56 pm

  7. Hi Matt,

    I have tried using another model of webcam and it works, it does not take 25% of the the picture any more. Now, there is another question i would like to ask. Some of the shots i taken are totally black screen, some are fine, could it be that the webcam needs some times to warm up? If so, how could we do about it? Please advice. Thanks

    Vincent Khoo

    vincentkhoosh

    September 22, 2007 at 3:43 pm

  8. Weird problem. The code I use isn’t fantastic and I’m thinking of a re-write in .NET at some point in the future…. that might be a long way off so don’t hold your breath :-)

    For a warm-up time, try increasing the ‘image perfect’ time, e.g. set it to 1000 for a second delay.

    Matt Collinge

    September 24, 2007 at 10:42 am

  9. The application can not run in command line mode if some keys in the registry are not set. The keys must look something like this:

    Windows Registry Editor Version 5.00

    [HKEY_CURRENT_USER\Software\VB and VBA Program Settings\SimpleCapture]

    [HKEY_CURRENT_USER\Software\VB and VBA Program Settings\SimpleCapture\Options]
    “ImageCaptureDevice”=”Microsoft WDM Image Capture (Win32)”
    “Perfect”=”500″
    “ImageCaption”=”ttt”
    “FileEnabled”=”1″
    “FileName”=”d:\tmp\sc\capture.jpg”
    “FileSuffix”=”dd-mm-yy hh-nn-ss”
    “FileFrequency”=”1″
    “FileJPEGQuality”=”80″
    “Execute”=””
    “AutoStartTimer”=”0″
    “HotKey”=”H”
    “HotKeyModifier”=”Shift + Ctrl”
    “AutoStartHotKey”=”0″

    The keys are set automaticaly when you run the application in window mode for the first time.
    Also it will be usefull to have the command line application resident and not to exit after capturing one image.

    Thanks!

    nostraxxx

    November 29, 2007 at 10:27 am

  10. Why even bother with .net ?
    .net is good only to write very fast a code that runs slow :)

    nostraxxx

    November 29, 2007 at 10:28 am

  11. lol

    Matt Collinge

    November 29, 2007 at 10:58 am

  12. Hello, what is the problem?
    Gui interface:
    http://img88.imageshack.us/my.php?image=error1guito9.jpg
    Command line:
    http://img69.imageshack.us/my.php?image=error2commandlinesy2.jpg

    My coomand line is:*** simplecapture.exe /filename c:\scap\arc\test.jpg /suffix dd-mm-yyyy hh:nn:ss /jpgquality 80 /imgperfect 500 /imgcaption hh:nn:ss” ***

    my e-mail is: tailerteilor@gmail.com
    Thanks

    tailerteilor

    December 15, 2007 at 3:48 am

  13. The problem in the command line above is that the suffix, which includes the time, has characters that are invalid for a filename in Windows. Once he’d removed the colon separators (painfull! ;-)) from the time it worked fine.

    Matt Collinge

    December 24, 2007 at 8:55 pm

  14. I like the command line feature, but SimpleCapture doesn’t seem to capture images larger then about 320 x 240. If I use VIDCAP32 and set the resolution of my camera to 640×480 SimpleCapture command line subsequently captures only the top left quarter (like vincentkhoosh’s problem, above).

    Is there a way of getting larger images?

    Pete

    peteshew

    June 19, 2008 at 11:55 am

  15. I’m afraid not. Give Yawcam a try; it’ll probably suit your needs a bit better.

    Matt Collinge

    June 19, 2008 at 8:10 pm

  16. No, YawCam doesn’t do the job, it is the command line feature I need. Oh, well, I’ll start looking at the API’s

    thanks

    peteshew

    June 19, 2008 at 9:27 pm

  17. I want to use the command line mode, but always report me one error :”Error processing comman line options”
    before get the photo. ( I have to press the accept buttom to continue)

    The command capture like this : simplecapture /filename e:\imagesConvert\images\prueba.bmp /suffix hh:nn:ss /jpquality /imgperfect /imgcaption hh:nn:ss

    or

    simplecapture /filename e:\imagesConvert\images\prueba.bmp /suffix hh:nn:ss /jpquality 0 /imgperfect 500 /imgcaption hh:nn:ss

    My registry register is : ( Version 5.1 )
    [HKEY_CURRENT_USER\Software\VB and VBA Program Settings\SimpleCapture\Options]
    Predeterminado (Valor no establecido)
    AutoStartHotKey 0
    AutoStartTimer 0
    Execute
    FileEnabled 1
    FileFrequency 1
    FileJPEGQuality 0
    FileName E:\ImagesConvert\images\prueba.bmp
    FileSuffix hh-nn-ss
    HotKey H
    HotKeyModifier Shift + Ctrl
    ImageCaption ttt
    ImageCaptureDevice Microsoft WDM Image Capture (Win32)
    Perfect 500

    Can you tell me what is the error ?

    jjswc

    November 7, 2008 at 6:15 pm

  18. I have managed to get everything working in simple webcam from the command line and it stores an image with the correct filenam in the correct folder on my system. The bad news is that the image is just totally blacked out, what’s more the image size is 287 x 231 pixels. My command line is
    c:\Program Files\Simple Webcam Capture\simplecapture.exe /filename c:\capture\test.jpg /suffix dd-mm-yyyy hh.nn.ss /jpgquality 80 /imgperfect 2000 /imgcaption hh.nn.ss”). Any suggestions?
    Thanks

    dennisjones

    December 4, 2008 at 8:10 pm

  19. I get the same problem as dennisjones :/

    C:\Program Files\Simple Webcam Capture\simplecapture.exe /filename “d:\cam.jpg”
    /suffix dd-mm-yyyy hh.nn.ss /jpgquality 80 /imgperfect 2000 /imgcaption test

    I’m running vista and have the same problem in both the gui and with the commandline.

    Any ideas ?

    smurfalizer

    November 21, 2009 at 9:20 pm

  20. I think it’s because the suffix parameter you’re using has a space in it. Try putting the suffix in speech marks, e.g. /suffix “dd-mm-yyyy hh.nn.ss” Failing that, try replacing the space with a dot.

    Let me know if that works for you.

    Matt.

    Matt

    November 22, 2009 at 1:51 pm

  21. Nope, didn’t do anything.. :/

    Here is a printscreen of that i get….
    http://www.senil.se/bilder/swc-error.jpg

    From left to right we have:
    1. /suffix dd-mm-yyyy hh.nn.ss
    2. /suffix “dd-mm-yyyy hh.nn.ss”
    3. /suffix hh.nn.ss
    4. /suffix “test”

    Note the strange size in the pictures.. 287x231pixles

    I also tried speech marks on imgcaption, but that wasn’t liked at all.

    smurfalizer

    November 23, 2009 at 6:36 pm

  22. [...] schau mal hier: Simple Webcam Capture Endpoint Scheint zwar nicht mehr 100% aktuell zu sein, aber vielleicht passt es ja. Sag bescheid wenns [...]

  23. Although it didn’t detect my camera I appreciate the blog post, thanks for being so detailed

    elvalentino

    January 17, 2011 at 5:57 am

  24. [...] Webcam Capture este compatibil cu Windows. captura poze prin webcam gratuit Views: 0 Tags: IT Comments RSS [...]

  25. Has anyone used this on Windows 7? I don’t get an image when pressing “Start Preview”, I just get a gray box. I also tried running it as administrator. Thanks.

    Brendon Baumgartner

    August 23, 2011 at 7:04 pm

  26. Yeah, I’ve literally just installed it and it worked first time. Windows 7 64-bit, built-in webcam in an IBM ThinkPad T510. I guess it’s just not compatible with your camera.. you’ve selected an Image Capture device in the top left, correct?

    Matt

    August 23, 2011 at 7:22 pm

  27. Know you won’t work on glitches, but just in case you’re inspired, this utility is exactly what I was looking for (command-line webcam capture with the bonus of power-off between shots). But…

    It appears to be writing only a small part of the top of the clipboard to the file. The preview shows the entire picture. When the timer expires, I briefly see the entire picture, then the small portion of the top of the picture. Only the small portion of the top of the picture is being saved in the file.

    If I go into paint and paste, I get the entire picture. So it appears the capture to the clipboard is working, but only a portion of the clipboard is being written to the file.

    Dual core Atom processor running XP SP3, Logitech C260 camera. 80% and 500ms perfect. Used your install kit.

    If this problem happens to grab your interest, I’m willing to help.

    Roger

    rogeroakey

    November 15, 2011 at 1:55 pm

  28. Since the recent comments, I have tried this again. If I register the ocx and run it, great — it works. Once I reboot, simplecapture no longer works (no errors). I tried this on two computers and experienced the same results. Strange.

    Brendon Baumgartner

    November 18, 2011 at 1:18 am

  29. when i use timed capture whenever the timer reaches 0 and its supposed to take a picture it first opens a device selection screen where i have to click ok, then it takes the picture, it does it everytime so its not automated, i have to click for every picture. how do i change this?

    Gregor Heuer

    June 30, 2012 at 7:04 pm

  30. webcam SWC 1000S is not working on win 7 and my webcam is not detected

    buntyu19

    August 2, 2012 at 10:40 am


Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: