0

I tried playing videos on Raspbian stretch with gstreamer but failed. I started installing gst-omx and tried the following pipelines:

gst-launch-1.0 videotestsrc ! videoconvert ! glimagesink
-> ERROR: from element /GstPipeline:pipeline0/GstGLImageSinkBin:glimagesinkbin0/GstGLImageSink:sink: Failed to connect to X display server

gst-launch-1.0 --gst-debug=3 uridecodebin uri=file:///opt/test/file.mp4 ! autovideosink
and
gst-launch-1.0 --gst-debug=3 playbin uri=file:///opt/test/file.mp4
-> gldisplay gstgldisplay_x11.c:88:gst_gl_display_x11_new: Failed to open X11 display connection with name, '(null)'

It seems like GStreamer is looking for an X display server. But I don't want to use one.

Did anyone get it running on a Raspbian Stretch? It seemed to work on Wheezy.

gst
  • 1,251
  • 1
  • 14
  • 32
moritz.vieli
  • 1,747
  • 1
  • 14
  • 17
  • 1
    Depends on how you want to display it. `glimagesink` and `ximagesink` require an X instance. There are probably multiple available. `fbdevsink` uses a frame buffer directly. Perhaps the Pi has its own custom sink? – Florian Zwoch Sep 10 '18 at 07:44
  • I haven't found one. It seems like autovideosink/playbin should automatically choose the HDMI output. But unfortunately they still require an X instance. However, meanhwile i found another site, stating that glimagesink should be compiled without X support. I'll try this solution: https://www.raspberrypi.org/forums/viewtopic.php?t=193152 – moritz.vieli Sep 10 '18 at 09:03

1 Answers1

1

Finally got it working with this gist: https://gist.github.com/moritzvieli/417de950209a24a4f7a57ce1bb5bfeb7

I had to build gstreamer from the sources. This is how i configured the base plugins:

./configure --prefix=/usr \
--disable-gtk-doc --disable-examples \
--disable-opengl --enable-gles2 --enable-egl --disable-glx \
--disable-x11 --enable-wayland --enable-dispmanx \
--with-gles2-module-name=/opt/vc/lib/libbrcmGLESv2.so \
--with-egl-module-name=/opt/vc/lib/libbrcmEGL.so

After this, I always got EGL_NOT_INITIALIZED error, because gstreamer was picking the wrong shared libraries. This could be fixed temporarly with this hack:

sudo ln -fs /opt/vc/lib/libbrcmEGL.so /usr/lib/arm-linux-gnueabihf/libEGL.so.1
sudo ln -fs /opt/vc/lib/libbrcmGLESv2.so /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2

I still have to figure out a proper solution. Maybe uninstall the egl mesa libraries.

moritz.vieli
  • 1,747
  • 1
  • 14
  • 17