Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
1.00/5 (5 votes)
See more:
How to connect webcam in c++ with the light off.
Help me instruction!
Posted
Updated 11-Jun-12 20:15pm
v2
Comments
stib_markc 12-Jun-12 1:52am    
Do you want to use webcam for recording/capturing video? or Do you mean you want your program to detect an available webcam?

 
Share this answer
 
Comments
thuyphuongid 12-Jun-12 2:15am    
Thanks
Espen Harlinn 12-Jun-12 8:19am    
5'ed!
I agree, it's a hardware problem.

Have you tried covering the light with electrical tape?
 
Share this answer
 
Comments
Aescleal 12-Jun-12 19:26pm    
That's worth a 5 any day of the week!
JackDingler 12-Jun-12 23:29pm    
Someone who wants to install spyware and watch people in their bedrooms, didn't like my idea. :)
Member 8576081 14-Jun-12 2:09am    
5'ed for this comment ;)
stib_markc 13-Jun-12 5:26am    
5!
Vitaly Tomilov 13-Jun-12 18:36pm    
1. Switch the lights off;
2. Switch the torch on;
3. Connect your webcam;
4. Switch the torch off;
5. Switch the lights back on.

Gives you a lot more thrill if you don't bother with the light at all, and do it the neighbor's house with a mask on ;)

P.S. As for C++,...not sure what this got to do with anything...
DirectShow[^] is your best bet

There are a few examples of directshow projects available here on CodeProject[^] , but they're C# based - that may or may not be helpful/an alternative

Create an IGraphBuilder by creating a CLSID_FilterGraph, then a ICaptureGraphBuilder2 from CLSID_CaptureGraphBuilder2, call its SetFiltergraph method, then use the RenderStream method

you can use the graphedt.exe[^] to play with DirectShow
 
Share this answer
 
Comments
thuyphuongid 12-Jun-12 2:13am    
Thank a lot.
But i mean. When i connect the webcam device, it's always show the light. I would like to turn the light off using c++.

So sorry if i make misunderstanding.
barneyman 12-Jun-12 2:15am    
oh - i see - that'll be a hardware thing the camera does, probably immutable - and at that point, I'm going to back away from the scene of the lawsuit :)
thuyphuongid 12-Jun-12 3:59am    
thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900