Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am working on camera capturte project.
i have to connect two camera simultaneously.
hMyWindow1 = capCreateCaptureWindow("", WS_CHILD | WS_VISIBLE, rect1.left, rect1.top,rect1.right,rect1.bottom, hw_video1, 0);
  
SendMessage(hMyWindow2,WM_CAP_DRIVER_CONNECT,0,0);

hMyWindow2 = capCreateCaptureWindow("", WS_CHILD | WS_VISIBLE, rect2.left, rect2.top,rect2.right,rect2.bottom, hw_video2, 0);
  
SendMessage(hMyWindow2,WM_CAP_DRIVER_CONNECT,0,0);

Now second window is also get connected to first web cam for changing it to second webcam i have to use
SendMessage(hMyWindow2,WM_CAP_DLG_VIDEOSOURCE,0,0);

but i want to perform this task programmatic so that two web cams got connected on two different window n user need not to select videosource via dialog (created by using
SendMessage(hMyWindow2,WM_CAP_DLG_VIDEOSOURCE,0,0);
)
Posted
Updated 17-Jan-12 19:06pm
v2
Comments
Member 12193780 9-Mar-16 5:11am    
Hey, ever get the chance to solve this?

1 solution

Hi,

While Sending the WM_CAP_DRIVER_CONNECT message , the third parameter refers to the DriverIndex, since you are using two webcams, you have to send two messages ,one with DriverIndex as 0, and other with DriverIndex as 1.

Cheers
 
Share this answer
 
Comments
pranav_30 18-Jan-12 1:50am    
i dont think so because i have already try this thing after setting that value to "1" WM_CAP_DRIVER_CONNECT returns 0 that means driver not connected.
Satheesh1546 18-Jan-12 2:43am    
Are you using the same driver for both webcams?
pranav_30 18-Jan-12 3:30am    
its normal web cam. i dont know much about drivers but its microsoft wdm .
Satheesh1546 18-Jan-12 6:57am    
Since, most of the Webcam's use Microsoft WDM driver. So i think connecting to two camera's simultaneously is not possible with VFW. Better to use DirectX.
pranav_30 18-Jan-12 7:36am    
i am able to connect two camera simultaneously. even i have recorded video from both camera simultaneously.
i just want to do the work of "SendMessage(hMyWindow2,WM_CAP_DLG_VIDEOSOURCE,0,0);" by me itself. so that user need not to choose camera.

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