rharder / imagesnap

Capture Images from the Command Line
https://github.com/rharder/imagesnap
458 stars 50 forks source link

Terminating app due to uncaught exception 'NSInvalidArgumentException' #43

Open ryandesign opened 1 year ago

ryandesign commented 1 year ago

On a MacBookPro10,1 running macOS 12.3.1:

% imagesnap -h | grep Version
Version: 0.2.16
% imagesnap 
Capturing image from device "FaceTime HD Camera (Built-in)"...2023-02-24 19:28:29.374 imagesnap[64493:733390] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[AVCaptureStillImageOutput_Tundra captureStillImageAsynchronouslyFromConnection:completionHandler:] Inactive/invalid connection passed'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007ff80240a7fb __exceptionPreprocess + 242
    1   libobjc.A.dylib                     0x00007ff80216be58 objc_exception_throw + 48
    2   AVFCapture                          0x00007ff81c4a7df4 -[AVCaptureStillImageOutput_Tundra _receiveSampleBuffer:] + 0
    3   imagesnap                           0x00000001045232d1 imagesnap + 25297
    4   imagesnap                           0x0000000104522a15 imagesnap + 23061
    5   imagesnap                           0x0000000104521928 imagesnap + 18728
    6   imagesnap                           0x0000000104521279 imagesnap + 17017
    7   dyld                                0x00000001106a651e start + 462
)
libc++abi: terminating with uncaught exception of type NSException
zsh: abort      imagesnap
PhilippeCarphin commented 1 month ago

I have the exact same problem

pen-ballagas commented 3 weeks ago

I have this problem as well on a MacBook Pro 13-inch, M2, 2022 running macOS 14.5 with imagesnap installed from homebrew

% imagesnap -h | grep Version
Version: 0.2.16
% imagesnap
Capturing image from device "Logitech BRIO"...*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[AVCaptureStillImageOutput_Tundra captureStillImageAsynchronouslyFromConnection:completionHandler:] Inactive/invalid connection passed'
*** First throw call stack:
(
    0   CoreFoundation                      0x0000000184e872ec __exceptionPreprocess + 176
    1   libobjc.A.dylib                     0x000000018496e788 objc_exception_throw + 60
    2   AVFCapture                          0x00000001a2a61028 -[AVCaptureStillImageOutput_Tundra _receiveSampleBuffer:] + 0
    3   imagesnap                           0x0000000104bc98dc -[ImageSnap takeSnapshotWithFilename:] + 188
    4   imagesnap                           0x0000000104bc924c -[ImageSnap saveSingleSnapshotFrom:toFile:withWarmup:withTimelapse:withLimit:] + 1104
    5   imagesnap                           0x0000000104bc8588 processArguments + 1220
    6   imagesnap                           0x0000000104bc80a4 main + 72
    7   dyld                                0x00000001849aa0e0 start + 2360
)
libc++abi: terminating due to uncaught exception of type NSException
zsh: abort      imagesnap

Wondering if this is somehow related to camera permissions in the System Settings. I expected the system to display a permission grant dialog, but it seems to crash instead.