Can't access the webcam from eclipse. Problem requesting webcam permissions in Catalina.

I am making an application in java using Eclipse. When I try to access the webcam with opencv it throws error:


OpenCV: not authorized to capture video (status 0), requesting...
OpenCV: can not spin main run loop from other thread, set OPENCV_AVFOUNDATION_SKIP_AUTH=1 to disable authorization request and perform it in your application.
OpenCV: camera failed to properly initialize!


I need to give permissions to a program developed in java (.jar) to access the webcam. Apple indicates that it is done from info.plist as can be seen in this link.


How can I do this in eclipse? How can I access the webcam?

Replies

Using the camera requires

NSCameraUsageDescription
property in your
Info.plist
. Also, if you enable the hardened runtime [1], you’ll need the Camera entitlement (
com.apple.security.device.camera
) baked into your code signature.

Setting these up with Xcode is pretty straightforward. I don’t know how you’d go about doing that with Eclipse. If you need help with that, I recommend that you escalate this via Eclipse’s support channel.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

[1] Which you should, because it’s require for notarisation.