我已经通过自制的方式在我的mac上安装了Gstreamer。我想要播放mac的内部摄像头的镜头,但是当我运行gst-device-monitor-1.0
时,我一直得到Probing devices... Failed to start device monitor!
我还尝试使用GST_DEBUG=2
运行相同的命令,然后
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
我正在运行的版本是
gst-device-monitor-1.0 version 1.20.0
GStreamer 1.20.0
我怎么才能让这个起作用?我已经检查了mac的设置,我没有看到任何东西会阻止这一点。我如何使gstreamer看到我的mac的内部摄像头?
发布于 2022-04-03 19:54:24
我的Mac电脑(M1,macOS Monterey)也有同样的问题。这是gst的问题-设备-监视器-1.0。根据其源代码,它找不到任何相应的设备提供程序:
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的内部摄像头)和音频源。
视频:
gst-launch-1.0 avfvideosrc device-index=0 ! video/x-raw, framerate=30/1, width=1280, height=720 ! queue ! autovideosink
音频:
gst-launch-1.0 -v osxaudiosrc device=0 ! audio/x-raw ! queue ! autoaudiosink
注:avfvideosrc
是gst-plugins-bad
的一部分,osxaudiosrc
是gst-plugins-good
的一部分
https://stackoverflow.com/questions/71612540
复制相似问题