首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在Mac上找不到内部摄像头

在Mac上找不到内部摄像头
EN

Stack Overflow用户
提问于 2022-03-25 05:26:53
回答 2查看 692关注 0票数 2

我已经通过自制的方式在我的mac上安装了Gstreamer。我想要播放mac的内部摄像头的镜头,但是当我运行gst-device-monitor-1.0时,我一直得到Probing devices... Failed to start device monitor!

我还尝试使用GST_DEBUG=2运行相同的命令,然后

代码语言:javascript
运行
复制
WARN devicemonitor gstdevicemonitor.c:501:gst_device_monitor_start:<devicemonitor0> No filters have been set, will expose all devices found
0:00:00.002759000 24294 0x7ffc5151c190 WARN devicemonitor gstdevicemonitor.c:507:gst_device_monitor_start:<devicemonitor0> No providers match the current filters

我正在运行的版本是

代码语言:javascript
运行
复制
gst-device-monitor-1.0 version 1.20.0
GStreamer 1.20.0

我怎么才能让这个起作用?我已经检查了mac的设置,我没有看到任何东西会阻止这一点。我如何使gstreamer看到我的mac的内部摄像头?

EN

Stack Overflow用户

回答已采纳

发布于 2022-04-03 19:54:24

我的Mac电脑(M1,macOS Monterey)也有同样的问题。这是gst的问题-设备-监视器-1.0。根据其源代码,它找不到任何相应的设备提供程序:

代码语言:javascript
运行
复制
  if (monitor->priv->filters->len == 0) {
    GST_WARNING_OBJECT (monitor, "No filters have been set, will expose all "
        "devices found");
    gst_device_monitor_add_filter_unlocked (monitor, NULL, NULL);
  }

  if (monitor->priv->providers->len == 0) {
    GST_OBJECT_UNLOCK (monitor);
    GST_WARNING_OBJECT (monitor, "No providers match the current filters");
    return FALSE;
  }

这个问题一年前就出现了,至今仍未解决:https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/780 https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/667

尽管如此,gstreamer本身仍然可以在macOS上访问视频(包括mac的内部摄像头)和音频源。

视频:

代码语言:javascript
运行
复制
gst-launch-1.0 avfvideosrc device-index=0 ! video/x-raw, framerate=30/1, width=1280, height=720 ! queue ! autovideosink

音频:

代码语言:javascript
运行
复制
gst-launch-1.0 -v osxaudiosrc device=0 ! audio/x-raw ! queue ! autoaudiosink

注:avfvideosrcgst-plugins-bad的一部分,osxaudiosrcgst-plugins-good的一部分

票数 1
EN
查看全部 2 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71612540

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档