Closed grauwald closed 3 years ago
Some further info on this for anyone willing and able to tackle it. As the Video library is built off GStreamer decided to take a look at that project directly and found a recent commit that adds support of Mac OS X Catalina:
https://github.com/GStreamer/cerbero/commit/2c9fc162f15e68c33b75f287dfa401e27452e3f7
Perhaps this is as simple as integrating this new build?
I'm seeing the same problem, even simple Processing Video example Sketch is not working on Mac OS Catalina.
Some further info on this for anyone willing and able to tackle it. As the Video library is built off GStreamer decided to take a look at that project directly and found a recent commit that adds support of Mac OS X Catalina:
Perhaps this is as simple as integrating this new build?
I tried to look but can't figure out where to make change in order to integrate the new build of cerbero.
I am looking forward to catch this bug. Please solve and release. Thank you.
@codeanticode it looks like you are the primary maintainer of this lib. Any chance Mac OS Catalina will be supported in the future?
@grauwald Definitely, this is a high-priority issue. I haven't installed Mac OS Catalina yet, so I'm curious if you have tried the latest beta, does it work with it?
@codeanticode I can confirm that with latest beta build video examples stat working again. There is another issue with samples - you have to pass camera name to Capture constructor). This code: video = new Capture(this, width, height); generates null pointer exception, but video = new Capture(this,320, 240, "FaceTime HD Camera"); works
@vdurnev this is great news, thanks a lot for testing! The other issue you mentioned has been fixed with this PR: https://github.com/processing/processing-video/pull/135
Super news. How does an ordinary user get access to this update? (No update available in install library menu...?)
@codeanticode was able to successfully run the latest beta of v2 of the video library. Yay!!!
For those coming along trying to do this, had to do some command line to get OS X to give permissions to run the .dylib used by the lib. Based on this hackish solution here: https://github.com/Jackett/Jackett/issues/5589#issuecomment-508560798
Guessing the final release of this lib will be signed and verified so this security issue in Catalina won't be a problem.
v2 library works on catalina, thank you @codeanticode
How to install
$ xattr -p com.apple.quarantine libavcodec.58.35.100.dylib it will return string like this: 0081;5dc1bfaa;Chrome;78F18F7D-3F71-4E55-8D58-BAB946AB4707
replace 0081 with 00c1 and copy string
then replace STRING in the following command with your string $ xattr -w com.apple.quarantine "STRING" *.dylib it will fix all libraries in this folder
then cd to gstreamer-1.0/ and run command again
Worked for me. Thanks!
Thanks a lot, @ihaveaccount. That did the trick. There were two parts that I struggled with for a second:
then replace STRING in the following command with your string $ xattr -w com.apple.quarantine "STRING" *.dylib
Don't forget the quotation marks!
then cd to gstreamer-1.0/ and run command again
At first, I skipped over this part, as I thought it was talking about re-running the project at this point. gstreamer-1.0/, however, is a sub-dir of library/macosx/. You're supposed to run the xattr -w command in both directories.
It might have been my lack of reading comprehension, but I figured I'd share this as there will be many users in need of this solution over the next couple of days.
You want to run something like this:
$ cd ~/Documents/processing/libraries/video/library/macosx
$ xattr -p com.apple.quarantine libavcodec.58.35.100.dylib
$ xattr -w com.apple.quarantine "00c1;5dc1bfaa;Chrome;78F18F7D-3F71-4E55-8D58-BAB946AB4707" *.dylib
$ cd gstreamer-1.0
$ xattr -w com.apple.quarantine "00c1;5dc1bfaa;Chrome;78F18F7D-3F71-4E55-8D58-BAB946AB4707" *.dylib
Also, be aware that your Processing sketchbook might not be in ~/Documents/processing/
, if you have configured the path yourself.
I have tried this twice and the only difference I can see is that I'm using Safari instead of Chrome. Would this make a difference?
@Stuver, I don't think the source makes a difference. Did you make sure that you used your result from xattr -p com.apple.quarantine libavcodec.58.35.100.dylib
and replaced the first four chars with 00c1
?
Do you get an error message in Processing or an OS error message regarding insecure libraries?
Yes. I've done that and manually verified all the packages within the library and still no luck
I can also confirm it worked, the manual validation of 200+ lib files is wildly frustrating, aside from that @ihaveaccount and @easytarget2000 give solid instructions.
Hey, it tried it all and it still isn't working for me. But I also got a different result from running xattr -p com.apple.quarantine libavcodec.58.35.100.dylib
. As instead of 0081 I got 0083, changed it anyways to 00c1.
The error message that I now receive are Processing video library using GStreamer 1.16.0
and a couple NullPointerException
I also updated to Catalina and struggled with this and only got it working thanks to comments by @codeanticode @ihaveaccount and @vdurnev. However to get it work on my 2018 Macbook Pro 13" needed to change the name of the camera "FaceTime HD Camera" -> "FaceTime HD Camera (Built-in)".
import processing.video.*;
static final String CAMERA_NAME = "FaceTime HD Camera (Built-in)";
Capture cam;
void setup() {
size(1080, 720);
cam = new Capture(this, width, height, CAMERA_NAME);
cam.start();
}
Update: OK, @danieloskarsson thanks, tried your method and it works perfect. You saved my life π₯
Hi guys, I'm new here... very exited :) So I got the video library working with your amazing advice and updates, but now, trying to use opencv library for computer vision, I get this error message: Processing video library using GStreamer 1.16.0 NullPointerException...
Help please
Here's the code (from examples of opencv library):
import gab.opencv.*;
import processing.video.*;
import java.awt.*;
Capture video;
OpenCV opencv;
void setup() {
size(640, 480);
video = new Capture(this, 640/2, 480/2);
opencv = new OpenCV(this, 640/2, 480/2);
opencv.loadCascade(OpenCV.CASCADE_FRONTALFACE);
video.start();
}
void draw() {
scale(2);
opencv.loadImage(video);
image(video, 0, 0 );
noFill();
stroke(0, 255, 0);
strokeWeight(3);
Rectangle[] faces = opencv.detect();
println(faces.length);
for (int i = 0; i < faces.length; i++) {
println(faces[i].x + "," + faces[i].y);
rect(faces[i].x, faces[i].y, faces[i].width, faces[i].height);
}
}
void captureEvent(Capture c) {
c.read();
}
@romya0010 I think that's because of a bug in beta 4 reported here #130. For the time being, the workaround is to add the camera name to the arguments of the Camera constructor.
Hello, im new and this is my first day i worked with processing. I hope you can help me. I got the Problem with the FaceTime Camera. I also work with macOS Catalina.
At this point I can't get forward.
- open console, cd to ~/Documents/processing/libraries/video/library/macosx
Which console? what do you mean with "cd"
And I can't find this file: 0081;5dc1bfaa;Chrome;78F18F7D-3F71-4E55-8D58-BAB946AB4707
And I don't understand this: then replace STRING in the following command with your string $ xattr -w com.apple.quarantine "STRING" *.dylib it will fix all libraries in this folder
then cd to gstreamer-1.0/ and run command again
Please help me, thanks a lot!
v2 library works on catalina, thank you @codeanticode
How to install
- replace ~/Documents/processing/libraries/video with "video" folder from https://github.com/processing/processing-video/releases/tag/r6-v2.0-beta4
- open console, cd to ~/Documents/processing/libraries/video/library/macosx
$ xattr -p com.apple.quarantine libavcodec.58.35.100.dylib it will return string like this: 0081;5dc1bfaa;Chrome;78F18F7D-3F71-4E55-8D58-BAB946AB4707
replace 0081 with 00c1 and copy string
then replace STRING in the following command with your string $ xattr -w com.apple.quarantine "STRING" *.dylib it will fix all libraries in this folder
then cd to gstreamer-1.0/ and run command again
Solution worked for me (macOS Catalina 10.15.1 MacBook Pro Retina 13 inch early 2013 edition). Thanks @ihaveaccount and @codeanticode !
Installed beta 4 successfully following @ihaveaccount's directions, on Catalina. Video examples work as long as a name is specified for the camera, but the default camera (no name specified) does not, as others have pointed out.
@codeanticode, thanks much for your work on this. FYI, I do camera capture with a BlackMagic interface. For some reason it's never turned up with a name in the "Available Cameras" list, but it does work as the default camera (without specifying a name). So, for now my ability to use it is broken, and I'll be very happy when the previous default camera behavior returns. Thanks again!
@dantepfer thanks for your update. I had pause the work on the video library while I take care of other projects but the plan is to come back to it as soon as time permits and finalize the v2 release :-)
Only partial success for me. I can see the attached cameras when I search for them, and the sketches will run, however the cameras are not activated and I get the following errors. When sketch run in Processing: Processing video library using GStreamer 1.16.0 BaseSrc: [avfvideosrc0] : Internal data stream error.
When sketch run in Sublime Text: Processing video library using GStreamer 1.16.0 Could not run the sketch (Target VM failed to initialize).
Anyone have any insights or alternate steps?
oof, this was a tough bug to discover on the first night of class covering computer vision... @codeanticode is there any update on this? might be good to land a beta release or something for classes that are starting this week. [edit: fortunately only 4 or 5 students had catalina installed]
Hi everyone,
I've tried mixing this answers without success. It keeps saying:
java.lang.NullPointerException at processing.app.Library.getClassPath(Library.java:368) at processing.mode.java.JavaBuild.preprocess(JavaBuild.java:424) at processing.mode.java.JavaBuild.preprocess(JavaBuild.java:155) at processing.mode.java.JavaBuild.build(JavaBuild.java:122) at processing.mode.java.JavaBuild.build(JavaBuild.java:104) at processing.mode.java.JavaMode.handleLaunch(JavaMode.java:122) at processing.mode.java.JavaEditor.lambda$0(JavaEditor.java:1099) at java.lang.Thread.run(Thread.java:748)
What can I do?
Thanks for your help.
Thanks a lot, @ihaveaccount. That did the trick. There were two parts that I struggled with for a second:
then replace STRING in the following command with your string $ xattr -w com.apple.quarantine "STRING" *.dylib
Don't forget the quotation marks!
then cd to gstreamer-1.0/ and run command again
At first, I skipped over this part, as I thought it was talking about re-running the project at this point. gstreamer-1.0/, however, is a sub-dir of library/macosx/. You're supposed to run the xattr -w command in both directories.
It might have been my lack of reading comprehension, but I figured I'd share this as there will be many users in need of this solution over the next couple of days.
You want to run something like this:
$ cd ~/Documents/processing/libraries/video/library/macosx
$ xattr -p com.apple.quarantine libavcodec.58.35.100.dylib
$ xattr -w com.apple.quarantine "00c1;5dc1bfaa;Chrome;78F18F7D-3F71-4E55-8D58-BAB946AB4707" *.dylib
$ cd gstreamer-1.0
$ xattr -w com.apple.quarantine "00c1;5dc1bfaa;Chrome;78F18F7D-3F71-4E55-8D58-BAB946AB4707" *.dylib
Also, be aware that your Processing sketchbook might not be in
~/Documents/processing/
, if you have configured the path yourself.I also updated to Catalina and struggled with this and only got it working thanks to comments by @codeanticode @ihaveaccount and @vdurnev. However to get it work on my 2018 Macbook Pro 13" needed to change the name of the camera "FaceTime HD Camera" -> "FaceTime HD Camera (Built-in)".
import processing.video.*; static final String CAMERA_NAME = "FaceTime HD Camera (Built-in)"; Capture cam; void setup() { size(1080, 720); cam = new Capture(this, width, height, CAMERA_NAME); cam.start(); }
TDLR: Verify that the exact name of your camera is used in your code.
@AryCuber If I remember correctly NullPointerException is what I saw before changing the name of the camera as indicated in my previous post that you have quoted last in your post.
In more detail what I did to get my camera name was to go to "About This Mac" > "System Report..." > "Hardware" > "Camera" and copy all before the ":". I.e. the "FaceTime HD Camera (Built-in)" part from "FaceTime HD Camera (Built-in):" and use that as the value of CAMERA_NAME. If you have not already I would make sure that you send in a matching camera name as the forth parameter to the Camera constructor.
static final String CAMERA_NAME = "FaceTime HD Camera (Built-in)";
cam = new Capture(this, width, height, CAMERA_NAME);
Thanks, really helpful, it started. working.
Hi everyone, I've also tried everything listed here and I still get this result.
[Processing video library using GStreamer 1.16.2
Available cameras:
[0] "FaceTime HD Camera"
BaseSrc: [avfvideosrc0] : Device video access permission has just been denied
BaseSrc: [avfvideosrc0] : Device video access permission has just been denied
Could not run the sketch (Target VM failed to initialize).
For more information, read revisions.txt and Help β Troubleshooting.
Is there anything else I can try? Thank you.
@elsameyer looks like Processing is not allowed to use the Camera. Try going to "System Preferences > Security & Privacy > Camera" and make sure that Processing is checked.
@danieloskarsson When I go to settings, processing isn't even listed as an option for the camera to open.
@danieloskarsson When I go to settings, processing isn't even listed as an option for the camera to open.
Then something has gone wrong. Upon first use of the Camera on Catalina (e.g. running a sketch that wants to use it) there should be a popup dialog asking you to confirm access to the Camera.
Edit: Please note that this is just something that I had to make sure of was correct when making accessing the camera work in Processing on Catalina. Your result may of course be because of something else.
@danieloskarsson When I load the code in Processing, before it prompts me to confirm camera access, the code crashes and gives the above result instead.
@elsameyer If not already I would try a minimal working example sketch instead of the one that crashes.
I have the same issue as @elsameyer. Which version of Catalina are you in? I'm in 10.15.2. Apparently in Catalina, when an app is going to use the camera, a popup should show. The problem is that this popup never shows in Processing. It might be due to the lack of the key NSCameraUsageDescription
on their Info.plist. I tried to add it manually but PDE just stopped opening altogether. I have no idea what to do anymore.
Update Processing today, still can't camera sketches to run,though I am getting a new error. Seems to be Java Core Dump disabled?
BaseSrc: [avfvideosrc0] : Internal data stream error. OpenCV for Processing 0.5.4 by Greg Borenstein http://gregborenstein.com Using Java OpenCV 2.4.5.0 sceneCount.get(i): 0 sceneCount.get(i): 1 sceneCount.get(i): 2 sceneCount.get(i): 3 sceneCount.get(i): 4 sceneCount.get(i): 5 #
#
#
#
So a quick update: sketches using the video library will work, it's now limited to any sketch using OpenCV (haven't tried Open Kinect). OpenCV can produce a list of attached cameras, but cannot activate them.
Unfortunately, still don't get any solution, I already did all solutions on this page but video captures still don't work. I already downloaded Processing 4 but there is the same problem, however I will wait for some good news! Thanks for all the support.
I have tried with V2, but the camera still didn't work . also, I cannot access the camera list with Capture.list(). Same as this issue , my macbook is the new one, 16 inch , late 2019, macOS 10.15.2(Catalina). There`s another problem with the new Mac , when I run the processing .such as window stuck occurs, when I using P3D, and the console will show some bug message which I could not understand.
I have tried to use the beta version of processing-video and the correct camera name. But when I run the example sketch, it still doesn't work.
This is my result:
Processing video library using GStreamer 1.16.0 Available cameras: [0] "FaceTime HD Camera" Could not run the sketch (Target VM failed to initialize). For more information, read revisions.txt and Help β Troubleshooting.
I thought maybe the processing can't prompt me to confirm camera access.
I have tried to run the example in Linux in a virtual machine, and it will prompt me to confirm camera access to the virtual machine software. Then it works properly.
I have tried to use the beta version of processing-video and the correct camera name. But when I run the example sketch, it still doesn't work. This is my result:
Processing video library using GStreamer 1.16.0 Available cameras: [0] "FaceTime HD Camera" Could not run the sketch (Target VM failed to initialize). For more information, read revisions.txt and Help β Troubleshooting.
I thought maybe the processing can't prompt me to confirm camera access. I have tried to run the example in Linux in a virtual machine, and it will prompt me to confirm camera access to the virtual machine software. Then it works properly.
same here; tried the above workaround, also get a no such xattr com.apple.quarantine somehow. Currently doing a project with students it's pretty sad I can't get it work. Thanks for your great work btw :)
Here's my solution, adapted from https://github.com/processing/processing-video/issues/134#issuecomment-550000519:
~/Documents/Processing/libraries
. (Remove the existing video
folder if it's there)cd
, a space, and dragging in the video
folder. Then press enter. It should look like this:
cd /Users/YOUR_USER_NAME/Documents/Processing/libraries/video
xattr -r -d com.apple.quarantine *
GettingStartedCapture
example should work out of the box. All other examples require an extra step.Capture
constructor requires the name of the camera. Adapt each example like so: // old code
video = new Capture(this, 640, 480);
// new code
String[] cameras = Capture.list();
video = new Capture(this, 640, 480, cameras[0]);
Thanks All for trying to solve this issue! Tried all the solutions , but no result:(
Catalina 10.15.3 Using the basic GettingStartedCapture example, also tried to include camera name.
The best that I got is the next.
Processing video library using GStreamer 1.16.0 Available cameras: [0] "USB Camera #2" [1] "FaceTime HD Camera (Built-in)" Could not run the sketch (Target VM failed to initialize). For more information, read revisions.txt and Help β Troubleshooting.
tried to add the second usb camera. Also, I don't see in Security & Privacy Processing thing.
Hope OpenCV , Processing, And apple developers will fix this bug.
Update. manually installed streamer 1.16.2 from here
now new language
Processing video library using GStreamer 1.16.2 Available cameras: [0] "USB Camera" [1] "FaceTime HD Camera (Built-in)" BaseSrc: [avfvideosrc0] : Device video access permission has just been denied
Checked Security &Privacy - nothing about processing in the Camera tab
I just updated to Catalina and I have exactly the same problem as @elsameyer. I have replaced the video library with the beta one and the .dylib don't seem to be quarantined, when I run the command
xattr -p com.apple.quarantine libavcodec.58.35.100.dylib
it returns
xattr: libavcodec.58.35.100.dylib: No such xattr: com.apple.quarantine
However when I try to run the GettingStartedCapture example, the sketch crashes and I get this in the console:
Processing video library using GStreamer 1.16.0 Available cameras: [0] "FaceTime HD Camera" Could not run the sketch (Target VM failed to initialize). For more information, read revisions.txt and Help β Troubleshooting.
I have checked into my security preferences and under camera, Processing doesn't show up. I've never had a window pop up asking if I wanted to allow Processing to use the camera. I tried to use Xcode to add the NSCameraUsageDescription key to the Processing Info.plist file but after that Processing wouldn't open without crashingβ¦
@C0T0N the correct invocation is:
xattr -r -d com.apple.quarantine *
Or if you want to remove the quarantine flag just on the single dylib
:
xattr -d com.apple.quarantine libavcodec.58.35.100.dylib
@fdb
I tried to run that command while in the video directory and both the macos and gstreamer-1.0 directories. Restarted Processing each time and I'm still getting the same error:
Processing video library using GStreamer 1.16.0 Available cameras: [0] "FaceTime HD Camera" Could not run the sketch (Target VM failed to initialize). For more information, read revisions.txt and Help β Troubleshooting.
I'm not sure it's a quarantine problem. Processing never asked to access my webcam and it doesn't show up in the camera tab in Security & Privacy in my System Preferences.
I tried the method @fdb used(Thank you very much for that) but still the sketch crashes and this error occur
Could not run the sketch (Target VM failed to initialize).
very similar to the situation that @C0T0N met
I guess that's because the access to the built in camera still blocked by macOS for some reason. I don't have a usb camera so I don't know if usb camera can work...
and my system is in Traditional Chinese so the built in camera name have Chinese characters, I don't know if that matter...
This process is working for me and a few others as a work around. Not the best but it does allow to permanently add camera access. This is working on both Mojave and Catalina. (Catalina needs to have the Video 2.0-beta3 lib installed).
1) turn off SIP
a.) reboot/restart in safe mode - hold cmd R on restart
b.) from the menu bar go to utilities/terminal
c.) enter cmd - csrutil disable
d.) restart computer
2) in terminal navigate to ~/Library/ApplicationSupport/com.apple.TC
a.)cd /Users/##YOUR_USER##/Library/Application Support/com.apple.TC
3) open sqlite db - sqlite3 TCC.db
(as extra precaution maybe copy TCC.db to back up (cp TCC.db TCC_BACKUP_DATE.db
) )
4) OPTIONAL modify view (this just makes it easier to look at)
a) .mode columns
b) .headers on
5) OPTIONAL - see everything with access
select * from access;
6) ADD camera access for processing - run this insert query - this will add a camera access entry for Processing to the TCC database
INSERT INTO access (service, client, client_type, allowed, prompt_count) VALUES ('kTCCServiceCamera','org.processing.app',0,1,0);
7) TEST - open processing & check camera access - also you can test that Processing shows up in SystemPrefs/privacy/camera
8) If success quit sqlite - ctrl-d
9) Turn SIP back on (REVERSE of STEP 1 - restart back into safe mode)
but instead run csrutil enable
10) After restart you may need to re-install Processing.app. It kept crashing, re-installing fixed it
Hope it helps some.
Running the example file that comes with the Processing video library throws the following error:
libc++abi.dylib: terminating with uncaught exception of type NSException Could not run the sketch (Target VM failed to initialize). Make sure that you haven't set the maximum available memory too high. For more information, read revisions.txt and Help β Troubleshooting.
This issue is also reported here:
https://discourse.processing.org/t/did-macos-catalina-or-something-break-the-video-library/14699
There is some speculation in that thread that the library depends on 32bit compiled code which is no longer supported in Mac OS Catalina as Apple is now requiring applications be 64bit.
Resolving this issue is beyond my expertise but it would be awesome if Mac users could continue to use the video library without having to downgrade to older versions of OS X.