美文网首页
【原创】mac下ffmpeg打开音视频设备(开启音视频设备访问限

【原创】mac下ffmpeg打开音视频设备(开启音视频设备访问限

作者: 一二三人生 | 来源:发表于2020-03-25 00:07 被阅读0次

The app's Info.plist must contain an NSMicrophoneUsageDescription key with a string value explaining to the user how the app uses this data

在mac上用Xcode用ffmpeg的API:

ret = avformat_open_input(&fmt_ctx, devicename, iformat, &options);

报上述错误:该应用已崩溃,因为它尝试访问没有使用说明的隐私敏感数据。该应用程序的Info.plist必须包含一个NSMicrophoneUsageDescription键,该键具有一个字符串值,向用户解释该应用程序如何使用此数据。

因为我使用的Xcode版本是当前最新的版本(11.3.1),无法直接Capalbility中直接关闭沙盒,必须在Info.plist中添加键字符串对,来打开mac的安全限制

解决方案如下:

<key>NSPhotoLibraryUsageDescription</key>

<string>This app requires access to the photo library.</string>

<key>NSMicrophoneUsageDescription</key>

<string>This app does not require access to the microphone.</string>

<key>NSCameraUsageDescription</key>

<string>This app requires access to the camera.</string>

所有的键值对的详细信息,大家可以参考:developer.apple.com

相关文章

网友评论

      本文标题:【原创】mac下ffmpeg打开音视频设备(开启音视频设备访问限

      本文链接:https://www.haomeiwen.com/subject/yzyzyhtx.html