1

我正在尝试创建一个非常简单的 Gstreamer 管道,其中我有一个源元素,即我的 FaceTime 摄像头和一个接收器元素,即 udp 接收器。

我首先使用此处的说明安装 Gstreamer 。我跑了一些基本的管道没问题;但是,当我尝试使用以下命令时

./gst-launch-0.10 v4l2src ! xviimagesink

我收到以下错误:

ERROR: pipeline could not be constructed: no element "v4l2src".

所以我做了一些挖掘,结果发现 v4l2src 插件在 gst-plugins-good 中。我使用以下命令使用 macports 安装了这些优秀的插件:

port install gst-plugins-good

很长一段时间后,一切安装都没有错误。现在 gst-launch 出现在三个地方。

/Library/Frameworks/GStreamer.framework/Versions/0.10/bin/gst-launch-0.10
/opt/local/bin/gst-launch
/opt/local/bin/gst-launch-0.10

如果我尝试从这些目录中的任何一个运行上述管道,我仍然会得到

ERROR: pipeline could not be constructed: no element "v4l2src".

如果我从任何地方键入以下命令,我会收到更多错误,但似乎仍然找不到 v4lsrc。

gst-launch v4l2src ! xviimagesink

给出:

Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded!
Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded!
Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded!
Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded!
GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Not enough memory)
ERROR: pipeline could not be constructed: no element "v4l2src".

所以看起来我有 GStreamer 混乱,我仍然无法让我的相机工作,因为 GStreamer 找不到 v4l2src。

一些帮助将不胜感激!提前致谢。

4

2 回答 2

7

v4l2src意思是“video-for-linux (ver.2) source”。由于您没有运行“linux”,因此不能使用“v4l2”也就不足为奇了。

您可以尝试使用osxvideosrc(afaik 这是在 gstreamer-plugins-bad 中)。

通常,我建议您在寻找特定功能时检查您的机器上安装了哪些元素,例如:

$ gst-inspect | grep -i video |grep -i source

PS:通常我发现ffmpegcolorspace在视频源和接收器之间放置一些色彩空间转换器(如)是个好主意。

于 2012-10-22T08:21:38.930 回答
3

对我来说,这两个来自 MacPorts ( https://www.macports.org/ ) 的作品:

GStreamer 1.0, applemedia: avfvideosrc: Video Source (AVFoundation),使用device-index参数选择设备(索引会因连接顺序而异)。

bash-3.2# port install gstreamer1*

iCeDeROM:~ cederom$ gst-inspect-1.0 |grep video | grep src
inter:  intervideosrc: Internal video source
decklink:  decklinkvideosrc: Decklink Video Source
applemedia:  qtkitvideosrc: Video Source (QTKit)
applemedia:  avfvideosrc: Video Source (AVFoundation)
ximagesrc:  ximagesrc: Ximage video source
videotestsrc:  videotestsrc: Video test source
autodetect:  autovideosrc: Auto video source

GStreamer 0.10(自动检测:autovideosrc:自动视频源

bash-3.2# port install gstreamer0*

iCeDeROM:~ cederom$ gst-inspect-0.10 |grep video | grep src
ximagesrc:  ximagesrc: Ximage video source
inter:  intervideosrc: FIXME Long name
gsettings:  gsettingsvideosrc: GSettings video src
gconfelements:  gconfvideosrc: GConf video source
autodetect:  autovideosrc: Auto video source
applemedia:  qtkitvideosrc: Video Source (QTKit)
applemedia:  miovideosrc: Video Source (MIO)
videotestsrc:  videotestsrc: Video test source

我使用autovideosinkorosxvideosink进行测试(第二个工作更快,首先使用 Xorg)。用于gst-inspect <module>模块信息。

于 2016-03-07T16:25:43.757 回答