How to fix Processing (https://processing.org) Camera and Microphone on macOS 10.15 Catalina
Last updated on 2020_11_08
Update: In Processing alpha2 (15 September 2020) with the libraries Sound 2.2.3 and Video 2.0, Audio and Video input are still broken. The workaround below should work with that version as well, although I have not tested it.
Apple has been changing around things for developers quite a lot since 2019. This concerns (among others):
- newly required permissions for apps that access the camera and microphone
- the removal of 32 bit applications
- the "notarization" mechanism
- access to (un-)signed apps
Since the development of Processing has slowed down significantly, audio (microphone) and video (camera) are broken in versions 3.5.4 as well as in 4.0 alpha 1 (both released in January 2020).
Here is a workaround that hopefully will be obsolete soon.
If you haven't, install Processing 3.5.4 from https://processing.org/download/
Start it and install the P5 Sound Library with Sketch -> Import Library -> Sound
Go to
https://github.com/processing/processing-video/releases/tag/r6-v2.0-beta4
Download the file video-2.0-beta4.zip
, unzip and put the video folder into the libraries folder in your sketch folder.
Make a note of this folder.
Result: You now have these libraries installed: Video 2.0-beta4
and Audio 2.2.3
(at the time of me writing this; later versions may work as well)
Edit both /Applications/Processing.app/Contents/Info.plist
and
/Applications/Processing.app/Contents/PlugIns/jdk1.8.0_202.jdk/Contents/Info.plist
and add the keys
<key>NSCameraUsageDescription</key>
<string>Processing needs access to the camera for creative coding</string>
<key>NSMicrophoneUsageDescription</key>
<string>Processing needs access to the microphone for creative coding</string>
You have to go into the Processing App bundle to do this. If you open the plist files with XCode, you can add the keys from the dropdown list. Both have the "Privacy ..." prefix.
In a Terminal enter:
codesign --remove-signature /Applications/Processing.app
codesign -s "<YOUR IDENTITY>" -v /Applications/Processing.app
This is the step which requires you to be a registered Apple developer: replace <YOUR IDENTITY> with one of your Apple developer identities. You find these in Keychain Access. I am using my Apple Development certificate which is valid for 6 months by which time the Processing developers have hopefully spent 10 minutes to fix this.
Result: Now audio (microphone access) will work. To confirm this, restart Processing and run
Examples > Libraries > Sound > IO > AudioInput
You will get a pop up asking you to give Processing access to your microphone. Confirm.
Later you can switch this on/off in your Mac's System Preferences > Security & Privacy > Privacy > Microphone
setting.
In a terminal, go to the folder where you copied the video in step 4 and change access settings:
cd /Users/<YOUR USERNAME>/Documents/Processing/libraries/video
xattr -r -d com.apple.quarantine *
Note that this step circumvents Apple's mechanisms that Apple thinks should protect you. To do this you should trust the developers of the Processing video library and the security of Github. Proceed on you own risk. No warranties given (see license below).
Result: Now video (camera access) will work. To confirm this, restart Processing and run
Examples > Contributed Libraries > Video > Getting started Capture
You will get a pop up asking you to give Processing access to your camera. Confirm.
Later you can switch this on/off in your Mac's System Preferences > Security & Privacy > Privacy > Camera
setting.
Note: you might need to edit older code including some of the examples thhat come with the Video library. If you see something like this in your setup()
function,
video = new Capture(this, 640, 480);
replace it with something like this:
String[] cameras = Capture.list();
video = new Capture(this, 640, 480, cameras[0]);
Hopefully new version of Processing and its libraries are released that makes this obsolete.
Note: I still get lots of crashes (errors) in the processing console, many not related to audio/video such as GL errors. Thus Processing still ist not working ok, but at least the sketch runs.
Note: As mentioned above, you must be a member of the Apple Developer program in order for this to work. When I was researching the issue, a lot of people already had contributed suggestions online - thank you. So other approaches might work as well including ones where you can avoid step 6 for which you have to be enrolled in the Apple Developer program.
Good starting points are: processing/processing-sound#51 and processing/processing-video#134
This work is licensed under a Creative Commons Attribution 4.0 International License. https://creativecommons.org/licenses/by/4.0/
It’s really not hard for the developers to fix this issue....