Desktop Videocam image capture library

agraham

Expert
Licensed User
Longtime 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
 

Attachments

  • VideocamDesktop1.3.zip
    11.6 KB · Views: 348
Last edited:

agraham

Expert
Licensed User
Longtime User
Very good - so whats the chance of getting that running on the device???
None whatsoever. It uses VFW (Video For Windows) which is not implemented on the device You could try this http://www.b4x.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.b4x.com/forum/additional-libraries/1640-image-processing-library.html which supports saving images
 
Last edited:

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:

alfcen

Well-Known Member
Licensed User
Longtime 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
 

agraham

Expert
Licensed User
Longtime User
Are you still planning to add "proper video" (uncompressed AVI would be sufficient for hobby astronomers).
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.
 

alfcen

Well-Known Member
Licensed User
Longtime 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.
 

agraham

Expert
Licensed User
Longtime 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.
 

alfcen

Well-Known Member
Licensed User
Longtime 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.
 

agraham

Expert
Licensed User
Longtime User
I think this will be overridden by the individual camera driver provided it allows frame rate setting.
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.
 

Byak@

Active Member
Licensed User
in my EEEpc camera is 1,3 megapixels but in Format dialog max resolution is 640*480... why?
 

agraham

Expert
Licensed User
Longtime User
in Format dialog max resolution is 640*480... why?
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.
 

Byak@

Active Member
Licensed User
Thanks =)
 

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.
 

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:
B4X:
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.
 
Top