Did macOS Catalina (or something) break the Video library?

Hi,

I am currently unable to run any code using processing.video's Capture object- including the basic Example sketches.

It seems that instantiating the Capture object is where the crash occurs, and it happens regardless of using new Capture(this, width, height); or when attempting to specify with new Capture(this, cameras[0]);, because it also seems to crash on Capture.list().

Any insight would be greatly appreciated, thanks!


2019-10-14 13:20:36.015 java[24743:1078170] -[__NSArray0 addObjectsFromArray:]: unrecognized selector sent to instance 0x7fff8bc482a0 2019-10-14 13:20:36.016 java[24743:1078170] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArray0 addObjectsFromArray:]: unrecognized selector sent to instance 0x7fff8bc482a0'

3 Likes

did you google about your system?
https://www.forbes.com/sites/ewanspence/2019/10/10/apple-macos-catalina-update-broken-32bit-mac-imac-macbook-pro-fix-mistake/#12c604be2f60 ,
https://www.theverge.com/2019/10/12/20908567/apple-macos-catalina-breaking-apps-32-bit-support-how-to-prepare-avoid-update ,
can that be connected?

Same problem here. All of my programs that use Capture object crash since upgrading to Catalina, same error codes.

1 Like

After upgrading to Catalina I cannot playback video files using the Movie object. A side note is that I can’t make a screen cap of full screen video in the web browser,

1 Like

It seems like Catalina unceremoniously dropped all support for 32-bit software. I’m assuming that maybe these libraries are 32-bit compiled?

Nailed it, that dropping of 32-bit support seems like the culprit to me.

3 Likes

There are now related issues open on the Video library repo:

2 Likes

Indeed. This is a serious problem for my students! I tried unsuccessfully to implement the workarounds suggested in the GitHub (swap out library with beta, and use terminal to change files). I wish I could help in fixing this issue but I just don’t have that knowledge – sorry. But I’m very keen that this gets fixed and the video library gets updated asap – we have a project coming up in the new year which uses a lot of live camera tracking techniques.

BTW – my workaround here to get live video into Processing has been to either use a Kinect, or opening a live camera window in Quicktime and using Syphoner to send it to Processing via Syphon.

I can play movies but not capture video after Catalina update. Some of my students using Catalina reported that they could not play movies either. 1 of them reported he solved it by uninstalling the Video library and then reinstalling it again – apparently.

This might be related to a missing permission key https://developer.apple.com/documentation/avfoundation/cameras_and_media_capture/requesting_authorization_for_media_capture_on_macos I haven’t updated my testing macOS machine to Catalina yet to look at this myself (I’m now the main developer on the GStreamer bindings that Processing Video uses) - let me know how you get on!

Hey Neil. Thanks for getting back. It may well be something like this – it would be great if it was simple. While I understand what is required, I am not in a position to implement anything within any codebase. I’m dependent upon good people like yourself! If there was something I could call from Processing to force the permission that would be fine. Or a flag I could set (like in Android mode), or something.

If this is the answer I think it just involves adding the NSCameraUsageDescription key (with some String value) in to the Info.plist file inside the Processing app download (eg. Processing.app/Contents/Info.plist ) No coding, just a couple of lines of XML.

1 Like

In which case, possibly related: https://stackoverflow.com/questions/44690075/xcode-missing-info-plist-key-for-nscamerausagedescription/44690185

(I am not on Catalina)

Yes, good link - hopefully just a case of adding lines similar to https://stackoverflow.com/a/44690785

Hi. I tried simply copying a couple of lines into the Info.plist:

    <key>NSCameraUsageDescription</key>
    <string>APPNAME requires access to your phone’s camera.</string>

… but Processing fails to launch

Did you ever get this working? Just saw this looking back (someone asked elsewhere). I have a feeling editing the .info file might break the signing on the app?!

1 Like

Here’s what I did to solve this issue.

  1. Download the latest video release from from the releases page.
  2. Unzip the folder into ~/Documents/Processing/libraries. (Remove the existing video folder if it’s there)
  3. Open the Terminal, type 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
  1. Type xattr -r -d com.apple.quarantine * — this deletes the quarantine flags that cause the “gstreamer is not signed” error.
  2. The basic GettingStartedCapture example should work out of the box. All other examples require an extra step.
  3. In each example, the 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]);
3 Likes

Great info!

I reported that last year and it’s been fixed in master for months - time to nag for a new release! :smile:

2 Likes

Hi all. Thanks for your help in trying to get video capture working. enigmeta I followed you excellent instructions but instead of GettingStartedCapture failing by reporting:

libc++abi.dylib: terminating with uncaught exception of type NSException

… it now reports there being no cameras available:

Processing video library using GStreamer 1.12.4
There are no cameras available for capture.

String[] cameras = Capture.list();
is empty!

I checked my System Prefs in Privacy and ensured Processing is granted access to the camera. I’m using Processing 3.5.4 and the ‘Video Library Release 6 (version 2.0-beta4)’ on MacOS Catalina (10.15.3)

Hi thanks for your instructions!

I also added

<key>NSCameraUsageDescription</key>
<string>APPNAME requires access to your phone’s camera.</string>

in Processing.app/Contents/Info.plist

console output

Processing video library using GStreamer 1.16.0
Available cameras:
[0] “FaceTime HD Camera (Built-in)”

So my camera is getting detected. If I execute cam.start() - the light of my camera shortly turns on and off.

I never get any image from the camera --> black screen

Any ideas?

1 Like