Desktop Videocam image capture library

Discussion in 'Additional Libraries' started by agraham, May 22, 2008.

  1. agraham

    agraham Expert Licensed User

    By popular demand! This isn't finished but it is usable. This captures bitmaps from your videocam if you have one. Desktop and .NET 2.0 only.

    EDIT : Version 1.1 with demo and help file posted. Can now save an image to a file and show continuous video.

    EDIT : Version 1.2 with updated demo and help can now show two dialogs for the user to adjust camera settings if the capture driver implements this.

    EDIT : :signOops: Version 1.3 now has as a dialog missing unintentionally from version 1.2
     

    Attached Files:

    Last edited: May 25, 2008
  2. colin9876

    colin9876 Active Member Licensed User

    great!

    Very good - so whats the chance of getting that running on the device???
     
  3. agraham

    agraham Expert Licensed User

    None whatsoever. It uses VFW (Video For Windows) which is not implemented on the device You could try this http://www.basic4ppc.com/forum/additional-libraries/1155-ccd-camera-library.html Camera support on devices was almost non-existent until WM5.0.

    I'll add single frame image saving in several formats and proper video in the next release. You could also use this in conjunction with my ImageEdit library http://www.basic4ppc.com/forum/additional-libraries/1640-image-processing-library.html which supports saving images
     
    Last edited: May 22, 2008
  4. colin9876

    colin9876 Active Member Licensed User

    But that brings up the camera dialogue and requires user action!
    I want my program to be able to spy on people without them knowing about it lol!

    Ive been thinking theres a real issue here about the differences between window librarys and compact librarys. I wish pocketpcs could run the same stuff as desktops can.
    Maybe WM7 will try and converge with Vista - Ive heard that miniWindows and gesture recognition using the vidcam will be in that OS - who knows.

    Anyway another great library even if it is just for desktop! I think they should give u another medal!!
    p.s. The wavegenerator demo went down well too!
     
    Last edited: May 22, 2008
  5. agraham

    agraham Expert Licensed User

    Version 1.1 now posted - see first post.
     
  6. agraham

    agraham Expert Licensed User

    Version 1.2 now posted. See first post.
     
  7. agraham

    agraham Expert Licensed User

    :signOops: I missed out a dialog - now in version 1.3 above :sign0013:
     
  8. alfcen

    alfcen Well-Known Member Licensed User

    Hi Andrew,
    Recently, I came across your videocam library and prepared an application
    that captures Moon and planetary images from a webcam mounted to a
    telescope.
    Thumbs up! All works as advertised.
    Microsoft's AmCap or VidCap do the same thing, but the idea is to do it
    yourself. And here your awesome library comes in very handy.
    Are you still planning to add "proper video" (uncompressed AVI would be
    sufficient for hobby astronomers).

    Cheers
    Robert
     
  9. agraham

    agraham Expert Licensed User

    By "proper video" I actually meant the Preview On/Off in the demo. However it looks easy enough to add recording an AVI. I'll look at it soon when I have a few hours to spare to refresh myself on how video works in Windows.
     
  10. alfcen

    alfcen Well-Known Member Licensed User

    Thanks a lot for your prompt reply, Andrew.
    No rush on that. In the meantime, I save an image every second
    and stack them using Registax for further processing.
     
  11. agraham

    agraham Expert Licensed User

    I've had a quick stab at adding recording but I've hit a threading snag which means that I can start a recording going but not stop it! The workaround is messy and I'm not really that interested in doing it. Also the uncompressed AVI files are enormous and I'm even less interested in doing the messy stuff to get them compressed so unless you actually want realtime movies I think you are better off using a timer to grab images.

    Also I note that the framerate referred to in the help for PreviewOn(framerate As int32) is not specified. It is the interval between preview frames in milliSeconds so a setting of 50 would result in a preview rate of 20 frames per second.
     
  12. alfcen

    alfcen Well-Known Member Licensed User

    Thanks a lot for looking into it. That's fair enough.
    Let's not get engaged with messy stuff. I don't like that either.
    Also, thanks for explaining the frame rate setting. I think
    this will be overridden by the individual camera driver provided
    it allows frame rate setting.
     
  13. agraham

    agraham Expert Licensed User

    Other way round I think. If the camera driver allows frame rate setting this is honoured. It works on the built-in camera of my EeePC, I don't know the highest rate it will accept (I would guess 50 or 60 fps) but I can slow it right down to one very second or less.
     
  14. Byak@

    Byak@ Active Member Licensed User

    in my EEEpc camera is 1,3 megapixels but in Format dialog max resolution is 640*480... why?
     
  15. agraham

    agraham Expert Licensed User

    Probably because it is being used as a VideoCam and the resolution is being limited to what is practical to deal with in terms of data rate and storage space. This is a normal practice on cameras used for both stills and video.
     
  16. Byak@

    Byak@ Active Member Licensed User

    Thanks =)
     
  17. pmu5757

    pmu5757 Member Licensed User

    Hox to make a program wait before taking a photo with a webcam

    Hello,
    On a desktop, I want my program to take six different photos with a webcam.
    For that, I use the desktop webcam library.
    My program must wait several seconds between each shot.
    To wait so, if I use a msgbox, it works properly.
    But if I use a sleep or something else it doesn't work : during the three first shots, the screen remains moveless, whatever the time I tell it to wait.
    For the three other shots, it works !
    Thank you for your help.
    Pascal.
     
  18. agraham

    agraham Expert Licensed User

    Try using a Timer instead.
     
  19. mjcoon

    mjcoon Well-Known Member Licensed User

    Now this thread has been quiet for a year, perhaps I can wake it with an air-kiss...

    Have just been playing with this demo as part of getting to grips with a PCI video capture card. And found that although the Help and IDE hints say that the parameters are:
    Code:
    NewCaptureWindow(deviceindex As Int32, parent As Control, top As Int32, left As Int32, width As Int32, height As Int32)
    in fact top and left are the other way round. It is of course not obvious until you alter them to different values!

    Also, as more overtly part of my attempt to understand video presentation, would it be possible to have sight of the *.cs file?

    Regards, Mike.
     
  20. agraham

    agraham Expert Licensed User

    .
     

    Attached Files:

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice