Home        Store        Docs        Blog

Setup_gst.sh on Ubuntu MATE 16.04?

(Dan Zimmerman) #1

Presumably this isn’t expected to work, but I’m trying to install gstreamer from source on a Raspberry Pi 3B with Ubuntu MATE 16.04.5 LTS/Xenial using the Blue Robotics companion computer setup_gst.sh script.

I need the hardware-accelerated omxh264enc h264 encoder. There’s no binary available. I’ve used the script before on Raspbian, but want to run a couple ROS nodes on my companion and I’m having a lot of trouble getting ROS Kinetic built with the required packages on Raspbian.

I’ve had two problems so far with the script. First was the absence of libdirac-dev in the apt install portion of the script. I took it out for now (as I can’t figure out how to install it on my version Ubuntu MATE)

Without that, it makes a lot of progress, but ultimately fails trying to build GstGL-1.0.gir:

collect2: error: ld returned 1 exit status
linking of temporary binary failed: Command '['../../../libtool', '--mode=link', '--tag=CC', 'gcc', '-o', '/home/computername/src/gstreamer/gst-plugins-bad/gst-libs/gst/gl/tmp-introspectDfxeqO/GstGL-1.0', '-export-dynamic', '-I/opt/vc/include', '-I/opt/vc/include/interface/vcos/pthreads', '-I/opt/vc/include/interface/vmcs_host/linux', '-Wno-error', '-Wno-redundant-decls', '-I/opt/vc/include', '-I/opt/vc/include/interface/vcos/pthreads', '-I/opt/vc/include/interface/vmcs_host/linux', '-I/opt/vc/include', '-I/opt/vc/include/interface/vcos/pthreads', '-I/opt/vc/include/interface/vmcs_host/linux', '-Wno-error', '-Wno-redundant-decls', '-I/opt/vc/include', '-I/opt/vc/include/interface/vcos/pthreads', '-I/opt/vc/include/interface/vmcs_host/linux', '-L/opt/vc/lib', '-L/opt/vc/lib', 'tmp-introspectDfxeqO/home/computername/src/gstreamer/gst-plugins-bad/gst-libs/gst/gl/tmp-introspectDfxeqO/GstGL-1.0.o', '-L.', 'libgstgl-1.0.la', '-L/usr/local/lib', '-lgio-2.0', '-Wl,--export-dynamic', '-lgmodule-2.0', '-pthread', '-lgstvideo-1.0', '-lgstbase-1.0', '-lgstreamer-1.0', '-lgobject-2.0', '-lglib-2.0']' returned non-zero exit status 1
Makefile:1694: recipe for target 'GstGL-1.0.gir' failed
make[5]: *** [GstGL-1.0.gir] Error 1
make[5]: Leaving directory '/home/computername/src/gstreamer/gst-plugins-bad/gst-libs/gst/gl'

I’m curious if this is a known issue and has a known solution, or if anyone on the forum has a good, working recipe for building gstreamer from source on Ubuntu MATE 16.04.

Also, what’s libdirac-dev used for and might it be causing the problem? Finding very little info on how to get it installed, if it’s possible.

I don’t care about building it from source if I don’t have to. So if anyone has another way to getting access to omxh264enc or an alternative on Ubuntu Mate 16.04 (can’t upgrade the distro AFAIK, because I need ROS Kinetic) that would also be great.

(Patrick José Pereira) #2

Hi Dan,

Yes, the setup_gst.sh script is not working, we have added an issue related to that in our repository.

I don’t have ubuntu 16.04 , but you should be able to install gstreamer and all necessary packages via apt, ubuntu 16.04 appears to distribute gstreamer 1.8.3 that should be enough (named gstreamer1.0).

You’ll need to install:

  • gstreamer1.0-plugins-base
  • gstreamer1.0-plugins-good
  • gstreamer1.0-plugins-bad
  • gstreamer1.0-plugins-ugly
  • gstreamer1.0-libav

For the omx, you’ll probably need to download and compile it from the repository: https://github.com/GStreamer/gst-omx

(Dan Zimmerman) #3

Thanks. I tried that a couple times already, installing all the binary packages and just building gst-omx from source, but it looks like I’ve finally got it to work.

Some background on the failures:

With gst-omx >= 1.9.1, gstreamer 1.8.3 isn’t new enough to satisfy dependencies.

I downloaded 1.9.1 and unzipped it, and when I run autogen.sh (or when I run configure) it fails like this:

checking for glib-genmarshal... glib-genmarshal (from pkg-config path)
checking for glib-mkenums... glib-mkenums
checking for GIO... yes
checking for GMODULE_NO_EXPORT... yes
checking for GST... no
configure: Requested 'gstreamer-1.0 >= 1.9.1' but version of GStreamer is 1.8.3
configure: error: no gstreamer-1.0 >= 1.9.1 (GStreamer) found
  configure failed

For gst-omx < 1.9.1 (1.0.0 at least), I’ve had problems where bug 750056 listed as fixed here prevents a successful build.


But I seem to have made it work with 1.2.0, which I don’t think I tried before. I have to address the OMX_Broadcom.h error here:

The fix is adding --with-omx-header-path=/opt/vc/include/IL to autogen.sh below.

So here are my final steps, I think. Will update/edit when I try this on another install:

I got every package available for gstreamer1.0:

sudo apt-get install gstreamer1.0*

Then I downloaded and unpacked https://gstreamer.freedesktop.org/src/gst-omx/gst-omx-1.2.0.tar.xz

In the resulting directory gst-omx-1.2.0, I ran

./autogen.sh --with-omx-target=rpi --with-omx-header-path=/opt/vc/include/IL


sudo make install

After that, there are lots of .lo and .la files in gst-omx-1.2.0/omx, and also gst-omx-1.2.0/config/rpi/gstomx.conf which lists the plugins. But gstreamer still doesn’t know about any of them. There are not yet any omx-related plugins in gst-inspect-1.0

Now, following along with https://raspberrypi.stackexchange.com/questions/528/how-can-i-install-gstreamer-gst-omx, I added the following to my .profile

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/gst-omx-1.2.0/omx/
export GST_PLUGIN_PATH=$HOME/gst-omx-1.2.0/omx
export GST_OMX_CONFIG_DIR=$HOME/gst-omx-1.2.0/config/rpi/

and sourced my .profile.

Then the omx plugins are now listed in gst-inspect:

user@computername:~/gst-omx-1.2.0/config/rpi$ gst-inspect-1.0 | grep omx
omx:  omxhdmiaudiosink: OpenMAX HDMI Audio Sink
omx:  omxanalogaudiosink: OpenMAX Analog Audio Sink
omx:  omxh264enc: OpenMAX H.264 Video Encoder
omx:  omxvc1dec: OpenMAX WMV Video Decoder
omx:  omxmjpegdec: OpenMAX MJPEG Video Decoder
omx:  omxvp8dec: OpenMAX VP8 Video Decoder
omx:  omxtheoradec: OpenMAX Theora Video Decoder
omx:  omxh264dec: OpenMAX H.264 Video Decoder
omx:  omxh263dec: OpenMAX H.263 Video Decoder
omx:  omxmpeg4videodec: OpenMAX MPEG4 Video Decoder
omx:  omxmpeg2videodec: OpenMAX MPEG2 Video Decoder

and it seems to work well with a fake video source test pattern.

I did all this on a second Ubuntu Mate install on a spare Pi, so have to install it on my other hardware to see if it enables the nice, low-latency streaming I got with the setup_gst.sh build on Raspbian.


(Dan Zimmerman) #4

I actually cannot yet reproduce this build on my second installation.

Getting fatal error: gst/gl/gstglconfig.h: No such file or directory

Also getting a warning warning: /usr/local/lib/gstreamer-1.0/include: No such file or directory

Will update if I can fix it. There is no folder /usr/local/lib/gstreamer-1.0 and I don’t know what installs it there.

(Jacob) #5

Can you get on a later version of ubuntu? The later versions have gstreamer > 1.8.4 which is what we crated the script for. Also, gstreamer > 1.8.4 is only necessary for using the usb webcam.

(Dan Zimmerman) #6

As far as I know I need to stick with Xenial to make sure everything in ROS Kinetic works right, and I believe there are some things I’m trying to use in ROS that won’t work properly with a newer version of ROS than Kinetic.

I need to try on a fresh installation, because I kept poor notes and I don’t know exactly what I did, but with some hacking around I did get it working on my second Ubuntu Mate install on the real hardware. I think I may have simply copied the entire /usr/local/lib/gstreamer-1.0 directory over from the working installation since they were nominally identical when I started with them.