You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
VideoCapture crashes on MacOS Mojave due to privacy protection #14258
Operating System / Platform => MacOS 10.14 (Mojave)
Compiler => xcode
Detailed description
MacOS Mojave has tightened privacy protection, and now applications need to prompt the user before they can access the camera. Once the user has approved to do so, the application will be permanently added to the list in MacOS privacy settings.
However when VideoCapture cap(0); in C++, the application immediately crashes instead of prompting the user for camera access. This only happens for opencv; if I access the camera via ffmpeg, then it does not crash and get prompted.
Questions: why would there even be a prompt for camera access from the native MacOS Terminal App? Isn't that triggered by Info.plist which must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data?
Or is the developer required to create a Info.plist file in support of a build package?
I'm not totally sure how this new authentication stuff works on the Mac.
Activity
zipzit commentedon May 8, 2019
Questions: why would there even be a prompt for camera access from the native MacOS Terminal App? Isn't that triggered by Info.plist which must contain an
NSCameraUsageDescriptionkey with a string value explaining to the user how the app uses this data?Or is the developer required to create a Info.plist file in support of a build package?
I'm not totally sure how this new authentication stuff works on the Mac.
ref: /Applications/Utilities/Terminal.app/Contents/info.plist
klich3 commentedon Jan 20, 2023
Solution
I found only one existing way:
shell /Applications/Blender.app/Contents/MacOS/BlenderCheck your permisses in System Properties > Privacy and policy > Camera

*1 : create simply code sample code name it as
sample.pyand run it in your terminalpython ./sample.py-> allow Camera access.and thats it!