1

I'm trying to use gscam (http://wiki.ros.org/gscam) compiled with the gstreamer 1.0 flag with a camera connected via ethernet to my laptop running Ubuntu16.04, ROS kinetic and gstreamer 1.0.

I'm able to properly start gstreamer and see the stram window using the command:

gst-launch-1.0 udpsrc caps="application/x-rtp,media=video,clock-rate=90000,encoding-name=H264, payload=96" port=5002 ! rtph264depay  ! video/x-h264,framerate=24/1,width=640,height=480 ! queue ! avdec_h264 ! videoconvert ! autovideosink sync=FALSE

but following the gscam instuction, running the command:

export GSCAM_CONFIG="udpsrc caps="application/x-rtp,media=video,clock-rate=90000,encoding-name=H264,payload=96" port=5002 ! rtph264depay  ! video/x-h264,framerate=24/1,width=640,height=480 ! decodebin ! videoconvert"

and then:

rosrun gscam gscam

I get the error:

[FATAL] [1533651268.132080791]: no element "udpsrc"
[FATAL] [1533651268.132104353]: Failed to initialize gscam stream!

This happens both when installing gscam using:

sudo apt-get install ros-kinetic-gscam

and compiling it from source using catkin

Can anyone please help me?

Update: A crucial missing information is that gscam was build from source with gstreamer-1.0 flags. Thus, it is not the common application from the ROS ppa which uses gstreamer-0.10.

Tik0
  • 2,499
  • 4
  • 35
  • 50
nirnakern
  • 13
  • 4
  • Install gstreamer 0.1 and check if it will fix. I tested gscam on indigo and gscam used gsreamer 0.1 instead of 1.0 dunno about kinetic – Mohammad Ali Aug 28 '18 at 01:31

1 Answers1

0

First the direct solution: It seems that you are missing some plugin packages. udpsrc is part of gst-plugins-good-plugins-0.10, which you can install under Ubuntu 16.04 as follows (with necessary base plugins):

sudo apt-get install gstreamer0.10-plugins-base gstreamer0.10-plugins-base-apps gstreamer0.10-plugins-good

Second, some info about gstreamer: gscam does depend on gstreamer-0.10 and not gstreamer-1.0, which are completely disjunct versions. You can check this out by typing

$ apt-cache depends ros-kinetic-gscam
...
libgstreamer0.10-0
...

You have to watch out when elaborating config strings with gstreamer-1.0 and then try to use these in gstreamer-0.10. It might not always work, so try directly working with gstreamer-0.10.

Tik0
  • 2,499
  • 4
  • 35
  • 50
  • Thank you for your answer; I was using gstreamer 1.0 because it was already working well with the camera and on the gscam repository they explained it was possible to use it also with gstreamer 1.0. I tried installing gstreamer 0.10 but then when I try starting it with the command: gst-launch-0.10 udpsrc caps.. I get the error: no element avdec_h264. Is avdec_h264 available also in gstreamer 0.10? While I still get the same previous error when trying to use it with gscam – nirnakern Aug 28 '18 at 09:28
  • If the answer helped you, please accept it. Furthermore, you mean [this](https://github.com/ros-drivers/gscam) repo? I think they clearly state that you have to build gscam explicitly with `gstreamer-1.0` on your own. The gscam which comes from ROS ppa uses `gstreamer-0.10`. So which one do you use? – Tik0 Aug 28 '18 at 09:28
  • yes, i downloaded it from the repo and built it with the gstreamer 1.0 flags – nirnakern Aug 28 '18 at 09:30
  • Ah, ok. Would be nice if you can point this out explicitly in the question. So [udpsrc](https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good/html/gst-plugins-good-plugins-udpsrc.html) is part of `gstreamer1.0-plugins-good` which you can install with `sudo apt-get install gstreamer1.0-plugins-good`. Then it should actually work. – Tik0 Aug 28 '18 at 09:44
  • sry I didn't mention. The problem is that udpsrc is installed, because if I start gstreamer everything works, but gscam seems unable to find it and gives the error "no element udpsrc" when i run it – nirnakern Aug 28 '18 at 09:54
  • Are you sure that you build against `gstreamer-1.0`? What does the cmd `ldd | grep gst` tells you? On the other hand, if gstreamer does not find the plugins, you can [set the path explicitly](https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gst-running.html). – Tik0 Aug 28 '18 at 10:01
  • the output of ldd is:"libgstreamer-0.10.so.0 => /usr/lib/x86_64-linux-gnu/libgstreamer-0.10.so.0 (0x00007fba0b605000) libgstapp-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libgstapp-1.0.so.0 (0x00007fba0ae93000) libgstbase-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libgstbase-1.0.so.0 (0x00007fba0ac2f000) libgstreamer-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0 (0x00007fba0a905000) " so i think the package is correctly compiled. I also tryed setting the path, GST_PLUGIN_PATH to "/usr/lib/x86_64-linux-gnu/gstreamer-1.0" but i still get the error – nirnakern Aug 28 '18 at 10:19
  • The output looks actually pretty bad. You are linking against `libgstreamer-0.10` **AND** `libgstreamer-1.0`, so I assume the outcome of running your version of `gscam` is pretty unpredictable. Please make sure that it exclusively links against `libgstreamer-1.0` (by e.g. setting rpath, or copying libraries, etc.). – Tik0 Aug 28 '18 at 10:50
  • fixed the linking (uninstalled gstreamer 0.10, removed all reference and recompiled gscam package) and now it works, thanks for the help – nirnakern Aug 29 '18 at 12:34
  • nice, also do not forget to upvote if this post was helpful. – Tik0 Aug 29 '18 at 13:11