Simple Webcam Capture

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.

37 thoughts on “Simple Webcam Capture”

  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?

  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.

  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

  4. 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.

  5. 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).

  6. 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

  7. 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.

  8. 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!

  9. Hello, what is the problem?
    Gui interface:

    Command line:

    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

  10. 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.

  11. 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

  12. 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

  13. 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 ?

  14. 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

  15. 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 ?

  16. 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.

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

    Here is a printscreen of that i get….

    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.

  18. 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?

  19. 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

  20. 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.

  21. 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?

Leave a comment