ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

A problem with Gstreamer 1.0 on ROS

asked 2016-04-29 08:57:19 -0500

Nexus8 gravatar image

updated 2016-04-29 09:40:34 -0500

gvdhoorn gravatar image


I'm trying to get running a UDP Camera with the help of Gstreamer on ROS.

I carefully went through the tutorials of Gstreamer and I managed to get a functional C program to get the video feed. I mean, I know the pipeline is correct. I built this program with cmake and make, it works with gstreamer 1.0 and it depays/decodes RTP H264 video. When I run this program I can confirm with: gst_version_string() that the version of Gstreamer is >1.0.

The problem arises when I try to do this on ROS. I added the exact same lines on the cmakeslists.txt of my package to find and link Gstreamer 1.0, but when I run my node I get gstreamer version is 0.10. The lines that share my cmakelists.txt on the pure C and Ros Package are:

pkg_check_modules(GSTREAMER REQUIRED gstreamer-1.0)
pkg_check_modules(GST_APP REQUIRED gstreamer-app-1.0)

So, my best guess is that I have to change something on my cmakeslist.txt or some catkin_make related setting. Do you know how can I make this work?

Any help would be greatly appreciated.


ps. I require Gstreamer 1.0 because 0.1 is now not recommended. Ubuntu recently moved to libav which works great with 1.0 and lastly, the components on the pipeline I'm using to decode H264 are only available on 1.0.

edit retag flag offensive close merge delete


Did you solve it? If so, can you share your solution?

Fabiobreo gravatar image Fabiobreo  ( 2016-06-23 08:34:10 -0500 )edit

Same here: Sharing is caring :) Thanks!

tanasis gravatar image tanasis  ( 2018-04-24 04:22:05 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2016-06-23 09:52:48 -0500

Nexus8 gravatar image

Yes sir, I did!

## System dependencies are found with CMake's conventions
## GStreamer 1.0 package required

macro(find_gstreamer_component prefix pkg lib)
  pkg_check_modules(PC_${prefix} REQUIRED ${pkg})
  find_library(${prefix}_LIBRARIES NAMES ${lib} HINTS ${PC_${prefix}_LIBRARY_DIRS} ${PC_${prefix}_LIBDIR})
  list(APPEND gstreamer_INCLUDE_DIRS ${PC_${prefix}_INCLUDE_DIRS})
  list(APPEND gstreamer_LIBRARIES ${${prefix}_LIBRARIES})
  mark_as_advanced(${prefix}_LIBRARIES gstreamer_LIBRARIES gstreamer_INCLUDE_DIRS)

find_gstreamer_component(gst      gstreamer-1.0       gstreamer-1.0)
find_gstreamer_component(gstbase  gstreamer-base-1.0  gstbase-1.0)
find_gstreamer_component(gstapp   gstreamer-app-1.0   gstapp-1.0)
find_gstreamer_component(gstvideo gstreamer-video-1.0 gstvideo-1.0)

I'm terribly sorry not to give credit to the authors, but I don't remember where I find a ROS package that also required Gstreamer 1.0.


edit flag offensive delete link more


Thanks a lot, it worked for me!

Fabiobreo gravatar image Fabiobreo  ( 2016-06-27 09:17:11 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2016-04-29 08:57:19 -0500

Seen: 2,268 times

Last updated: Jun 23 '16