hello
im trying to access my web cam with vb 6
any ideas where to start or how?
i searched the web found some samples but they all not working
tnx in advanced
Printable View
hello
im trying to access my web cam with vb 6
any ideas where to start or how?
i searched the web found some samples but they all not working
tnx in advanced
Look in the code bank. dilettante recently posted a thread demonstrating this...
can you give me a link?
It gets confusing if we jump around too much spreading one conversation among different threads, and usually jumping onto a question thread over a month old isn't considered a good thing either.
Over in How can i remote capture and create a live view on a PC using Canon EOS 1000D? you added a reply. I'll quote it here to bring things back home:
It isn't clear to me what you are trying to say there, but I can take a guess.
It sounds like the sample programs using the Video for Windows (AviCap) API work for you, but your laptop has multiple cameras. Starting one of these programs causes a dialog to appear that allows you to select which camera to capture from, but you have to make the selection every time you run the program.
This is a limitation of the way Microsoft kept the old VfW API working after the move from 16 bits (Windows 3.1, Windows NT 3.1) to 32 bits (Windows 95 and later, Windows NT 3.5 and later).
As far as I know there is nothing to be done except possibly for some registry tweaking that your program would have to do on every run. The part of the registry that needs to be touched up requires admin rights on every run of your program. Impractical, and I have never seen a working example of this technique.
When 32-bit Windows came along (and for the most part "64 bit Windows" is very much still 32-bit Windows in terms of the way things are done) video capture devices got taken over by another driver system with a new API: DirectShow.
You can use Video for Windows yet but everything goes through a sort of emulation process. VfW supported camera devices 1 through 9 but any cameras on your system can only be mapped as VfW device 1 now. This is why the selection dialog comes up. It is asking you "Which camera should be assigned as VfW device 1 this time?"
Since then (Vista, Windows 7) some new APIs have been introduced, but I haven't found any way to use these APIs from a VB6 program yet. This leaves us with DirectShow as our only alternative.
DirectShow is much more flexible than Video for Windows. It is also a lot more complicated to use.
Microsoft did begin building a VB6-friendly wrapper for DirectShow (quartz.dll) but seems to have dropped the ball partway through. Lots of unfriendly DirectShow C++ interfaces were never wrapped for easy use from VB6. Some people built a few helper libraries to fill the gap but as far as I can tell only one of these is still available along with even minimal guidance on using it.
In DirectShow WebCam Minimal Code I tried to take a stab at using DirectShow in VB6 for webcam capture. Then I tried going a little further by using the 3rd party FSFWrap library to get to a few more interfaces for more control.
The results are mixed.
I have samples at that CodeBank thread that work when you have one webcam. Others that work to allow you to select a webcam, have the program "remember" it, and use the same one again on subsequent runs.
However...
These samples don't seem to work for everyone. Getting a DirectShow filter graph that works on every webcam people have isn't easy. It may not even be possible.
I think this can only work reliably if the program does a lot of probing of the chosen camera in order to create a DirectShow filter graph at run time.