Question

I'm trying to create a very simply Gstreamer pipeline where I have a source element that is my FaceTime camera and a sink element that is a udp sink.

I first install Gstreamer using the instructions here. I ran some of the basic pipelines no problem; however, when I tried to use the following command

./gst-launch-0.10 v4l2src ! xviimagesink

I got the following error:

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

So I did some digging and turns out that the v4l2src plugin is in a gst-plugins-good. I installed these good plugins using macports using the following command:

port install gst-plugins-good

After a very long time everything installed without error. Now gst-launch appears in three places.

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

If I try to run the above mentioned pipline from any of those directories I still get

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

If I type the following command from anywhere I get some more errors but seems like it still is not finding v4lsrc.

gst-launch v4l2src ! xviimagesink

Gives:

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".

So it seems like I have GStreamer mess and I still can't get my camera to work because GStreamer can't find v4l2src.

Some help would be appreciated! Thanks in advance.

Was it helpful?

Solution

v4l2src means "video-for-linux (ver.2) source". since you are not running "linux", it is not so surprising that you cannot use "v4l2".

you might try to use the osxvideosrc (afaik this is in gstreamer-plugins-bad).

generally i suggest to check which elements are installed on your machine when you are looking for a a specific functionality, e.g.:

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

PS: and usually i find it a good idea to throw some colorspace-converter (like ffmpegcolorspace) between a video-source and and -sink.

OTHER TIPS

For me those two works from MacPorts (https://www.macports.org/):

GStreamer 1.0, applemedia: avfvideosrc: Video Source (AVFoundation), use device-index parameter to select a device (index will vary depending on the connection order).

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 (autodetect: autovideosrc: Auto video source)

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

I use autovideosink or osxvideosink for testing (second works faster, first use Xorg). Use gst-inspect <module> for module information.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top