Question

So i got this cool double WebCam that connect to the mac from a single usb cable.b

i can see that my mac recognized the cameras as i connect it. i write a little program from XCODE that stream cam video to QTCaptureView in to two QTCaptureViews left and right

                 [ left cam view ]    [ right cam view ]

before i post some code i would like to tell that if i choose one of the cams to be streamed and the face time camera also (for example it could be any other cam instead of the cam that connected to the same port) i get both streamed at the same time. but if i choose both camera to be projected only one will work. it could be something that is impossible on the hardware level? i would really like to hear some ideas.

Was it helpful?

Solution

A simple solution is to use "Video Capture Sources" filter from GraphEdit where you should see two capture ports that can be rendered simultaneously.

A more advanced solution is to use OpenCV as follows:

Mat Lframe,Rframe;

For multi-head camera, use:

VideoCapture cap(0); // open the default camera
if(cap.grab())
    cap.retrieve(Lframe,0); cap.retrieve(Rframe,1);// get a new frame

For two stereo cameras:

VideoCapture capL(0),capR(1);
capL.grab();capR.grab();
capL.retrieve(Lframe); capR.retrieve(Rframe);// get a new frame

See VideoCapture for more details.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top