macOS 10.14+ Media Capture Authorization
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- macos, python
- 领域
- build-system, desktop
调研方向
从链接的授权条件处开始检查 OpenCV 的 modules/videoio/src/cap_avfoundation_mac.mm,然后检查 wheel 构建配置及其 macOS 编译器设置。在 macOS 10.15.3 上使用 opencv-python 4.1.2.30 重现打包应用的行为。当受支持的 wheel 构建能够正确请求相机授权,且不使报告的 Qt 行为发生回归时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Actual Behaviour
I'm currently trying to package a (windowed) Kivy app with PyInstaller and have spent a decent amount of time trying to track down this bug. I believe the issue I'm running into is not with any of those libraries or with OpenCV. I'm pretty sure the issue is with how your wheels are generated.
When using opencv-python in the Terminal, the Terminal requests camera permissions and everything seems ok. However when running a packaged version of the same app it crashes.
For MacOS 10.14 and above OpenCV should request camera permissions. I've been through Apple's documentation and nothing there has helped.
Running a packaged app (using opencv-python version 4.1.2.30 from PyPi) in Xcode Instruments I'm getting this error:
OpenCV: Cannot use FaceTime HD Camera (Built-in)
OpenCV: camera failed to properly initialize!
Expected Behaviour
When camera access is not authorized the following should be printed:
OpenCV: not authorized to capture video (status 0), requesting...
OpenCV: camera failed to properly initialize!
If camera access has been rejected:
OpenCV: camera access has been denied. Either run 'tccutil reset Camera' command in same terminal to reset application authorization status, either modify 'System Preferences -> Security & Privacy -> Camera' settings for your application.
OpenCV: camera failed to properly initialize!
The Issue
OpenCV uses compiler flags to determine whether or not media capture needs to be authorized (see here). When the opencv-python wheels are built, it seems like xcode9.4 is the only version used. I'm guessing xcode10.2 or newer would satisfy #if defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101400 but I'm not totally sure.
Using your repo I built a wheel locally, and verified that I am getting the behavior I expect. However the version I built is having some issues with Qt. Would it be possible to have a 10.14+ wheel in addition to the 10.9 one to ensure this code is run on the correct machines? I understand this is a bit of an edge case but I think it would be an improvement if its not a lot of work for you.
I can provide more info or a more concrete example if needed.
Steps to reproduce
- For sample code I've been using code from here
- macOS 10.15.3
- architecture x86_64
- opencv-python version 4.1.2.30
- 主要语言
- Python
- 星标
- 5.4k
- 派生
- 1k
- 平均合并
- 22 小时 17 分钟
- 30 天内合并 PR
- 3
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
opencv/opencv-python 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 85/100
opencv/opencv-python#1217 · 3 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
opencv/opencv-python#1165 · 2 条评论 · 1 个 reaction ·
-
难度 5/5 一周以上 新手友好度 25/100
opencv/opencv-python#1273 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 45/100
opencv/opencv-python#1272 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 70/100
opencv/opencv-python#1268 · 1 条评论 ·
查看 opencv/opencv-python 的全部 Issue
相似的 Issue
-
essnmx good first issue
难度 1/5 1 小时以内 新手友好度 95/100
-
难度 2/5 1-3 小时 新手友好度 65/100
syfoud/Simulated_Scepter#174 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
Giskard-AI/giskard-oss#2840 · 1 条评论 ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success 未关闭area: repo bug perceived difficulty: 2
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 75/100
yeti-platform/yeti#1380 ·