ofVideoGrabber Issue - Uncaught Exception

Hello,

I hope you can help. I am very new to OpenFrameworks (and coding in general), so apologies if this post is incorrect / in the wrong place, or if this stuff has been covered already elsewhere (I did a forum search but couldn’t find a similar issue).

I am working through the OpenFrameworks Essentials book, and noticing that some things don’t seem to work anymore, through being deprecated, etc… I’ve managed to find and update most of these parts through the documentation, but am completely stuck on the section about grabbing a feed from a webcam.

The code I was using, was meant to let me switch on the webcam by pressing the ‘C’ key, but this did not work and would crash Xcode. I then scrapped that code, and tried the Camera Grabber example that comes with OF, but still not working.

The code compiles fine, but then the viewing window crashes and Xcode highlights the code in the screenshot I have attached here. Have no idea how to properly debug yet, but I keep seeing this error message:

[notice ] Device: 0: FaceTime HD Camera (Built-in)
[notice ] 0: FaceTime HD Camera (Built-in)
2018-06-21 10:43:17.032978+0100 videoGrabberExampleDebug[40901:1890400] OSXVideoGrabber Init Error: Error Domain=AVFoundationErrorDomain Code=-11815 “Cannot Use FaceTime HD Camera (Built-in)” UserInfo={NSLocalizedRecoverySuggestion=Stop any other actions using the FaceTime HD Camera (Built-in) and try again., AVErrorDeviceKey=<AVCaptureDALDevice: 0x10131f860 [FaceTime HD Camera (Built-in)][0x1a11000005ac8509]>, NSLocalizedDescription=Cannot Use FaceTime HD Camera (Built-in)}
2018-06-21 10:43:17.035752+0100 videoGrabberExampleDebug[40901:1890400] [General] An uncaught exception was raised
2018-06-21 10:43:17.035799+0100 videoGrabberExampleDebug[40901:1890400] [General] *** Can’t add a nil AVCaptureInput
2018-06-21 10:43:17.035933+0100 videoGrabberExampleDebug[40901:1890400]

48

If someone could point me in the right direction, I’d be hugely grateful. Many thanks!

Matt

I had a very similar problem using ofVideoGrabber on macos 10.13 recently;

Turn’s out that by removing a software that create a virtual camera input on the mac (camTwist for instance) solved my problem.

In my case, Quicktime X would also crash when that input (camtwist) was selected.

Oh, I am very new here… I somehow managed to edit my OP into my response. Posting here as well:

Thank you for getting back to me. macOS 10.13 here as well.

Miraculously, it started working for me later on in the day. Only think I can think of was that I deleted Da Vinci Resolve yesterday. I wonder if that was causing problems.

Anyway, all sorted. Thanks again!

Hello,
Welcome !
You can still edit back your OP, click the ‘little pen’ on the top right of the message.
I guess you have to copy, edit (bottom right of message), paste.
A post is supposed to be found by other that may experience the same issue.

Have fun.

1 Like

Brilliant, thanks. All done.