processing / processing-video

GStreamer-based video library for Processing
276 stars 130 forks source link

Processing cannot access Camera in macOS Catalina #144

Closed toyoxx closed 3 years ago

toyoxx commented 4 years ago
## Description

Since the launch of Catalina, Apple requires the apps to explicitly ask for permission in order to access Files, Camera, Microphone, etc. The Processing Development Environment does not prompt for permission to use the Camera, so whenever I try to run a sketch that uses the camera, it fails. I cannot set the permissions through Settings -> Security & Privacy -> Camera because the app never requests for it, so my hands are tied.

Expected Behavior

The sketch should activate the camera and show the camera feed

Current Behavior

Currently, I run the project, and then it tells me:

Could not run the sketch (Target VM failed to initialize).
For more information, read revisions.txt and Help → Troubleshooting.

Steps to Reproduce

To reproduce it, you can open any example from the video library that uses the camera.

  1. Open Examples -> Video -> Capture -> AsciiVideo
  2. Run the sketch

Your Environment

Possible Causes / Solutions

Through some research, some people mention that "if your app uses device cameras, include the NSCameraUsageDescription key in your app’s Info.plist file". I tried to add this key in the Info.plist at /Applications/Processing.app/Contents/ but the PDE stops working. Maybe it's related to this?

Bobby54 commented 4 years ago

I don't work on any of the iOS Systems, but most OSs have the possibility to set permissions for applications manually without having them ask for it. So if you check the permissions Processing has on your machine you might be able to allow camera use or might even be able to set Processing as a trusted application. This would be my only idea on how to fix this.

vwls commented 4 years ago

In early December I had success patching what I believe was the same issue discussed above. See here for the (temporary) solution: https://github.com/processing/processing-video/issues/134#issuecomment-560551924

That said, I now run into the issue and cannot solve it with the operations that had worked previously.

Not sure if it's Apple, Processing, or Gstreamer that is best positioned to fix this, but hoping for a fix soon!

Moonraker069 commented 4 years ago

This is not limited to this use case. I have OBS, Global Meet Conferencing, terminal, and others terminating upon launch OR upon access to a camera. Global Meet works great until I turn on the camera in a conference. The moment camera / microphone access is selected, the app terminates.

The issue is related to this security item, specifically - access certain devices, folders, resources, etc. may or may not permit the application to run. Note that even when the application shows up and is enabled in the security settings, this behavior is the same for these applications.

In addition, programs that are terminated upon launch because they access those resources immediately, do not show up in the settings to permit them to be enabled.

So as the original poster stated, a fully patched system with the latest software will still cause programs to terminate because of this security feature and some sort of permissions. If we could know how to bypass or enable the programs to access what they need, this can be resolved.

christo commented 4 years ago

This is very closely related to #134 - possibly best called a duplicate although both issues contain valuable detail.

benfry commented 3 years ago

Closing as duplicate of #134.