【问题标题】:Playing a video with gstreamer on a Raspberry Pi 3 with Raspbian Stretch在带有 Raspbian Stretch 的 Raspberry Pi 3 上使用 gstreamer 播放视频
【发布时间】:2018-09-09 18:32:48
【问题描述】:

我尝试使用 gstreamer 在 Raspbian 拉伸上播放视频,但失败了。我开始安装 gst-omx 并尝试了以下管道:

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)'

GStreamer 似乎正在寻找 X 显示服务器。但我不想用一个。

有人让它在 Raspbian Stretch 上运行吗?它似乎对 Wheezy 有效。

【问题讨论】:

  • 取决于您希望如何显示它。 glimagesinkximagesink 需要 X 实例。可能有多个可用。 fbdevsink 直接使用帧缓冲区。也许 Pi 有自己的自定义接收器?
  • 我还没有找到。似乎 autovideosink/playbin 应该自动选择 HDMI 输出。但不幸的是,它们仍然需要一个 X 实例。然而,我发现另一个站点,说明 glimagesink 应该在没有 X 支持的情况下编译。我会试试这个解决方案:raspberrypi.org/forums/viewtopic.php?t=193152

标签: video raspberry-pi gstreamer raspbian omxplayer


【解决方案1】:

终于可以使用这个要点了:https://gist.github.com/moritzvieli/417de950209a24a4f7a57ce1bb5bfeb7

我必须从源代码构建 gstreamer。这就是我配置基本插件的方式:

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

在此之后,我总是收到 EGL_NOT_INITIALIZED 错误,因为 gstreamer 选择了错误的共享库。这可以通过这个 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

我仍然需要找出一个合适的解决方案。也许卸载 egl mesa 库。

【讨论】:

    猜你喜欢
    • 2019-03-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多