Webcam doesn't work

Does anyone meet the same issue?

I try to use basic webcam code to do something, but there are no image in webcam window. Weird thing is the indicator light of the computer camera is on. (I use mackbook’s camera)

I add below code in header file:

ofVideoGrabber webcam;

And cpp file is:

void ofApp::setup(){
webcam.setup(640, 480);
}
void ofApp::update(){
webcam.update();
}
void ofApp::draw(){
webcam.draw(0, 0, 320, 240);
}

The output window is:

MacOS Monterey 12.3.
openframework version: of_v20220128_osx_release.tmp.
Xcode version: 13.3

When I run the project, it asks me to access the camera and I click ‘Allow’. Does any one have any idea?

OK it works.
The only change is that I uninstall an application named ‘Snap Camera’, but I’m not sure that’s the key reason.

I guessed Snap Camera can intercept the camera and then adds the filter. So I tried to uninstall it, then it works! Weird and funny issue.

Hey!

I think the issue is that the Snap virtual device shows up as a device with a higher order/id than the webcam.

If you did webcam.listDevice(); before setup it would print out the device IDs for all cameras connected to the computer.

Then you can do:
webcam.setDeviceID(1);
to open the second device ( by default 0 / the first is opened ).

That is why it worked when you removed the snap device, as the webcam went back to being device 0.

Hope that explains it!
Theo