我正在构建一个基于python的视频播放器,但遇到了Gstreamer的问题。 当尝试使用7英寸触摸屏在树莓派3上播放视频时,出现一堆错误消息。我在Balena.io平台上的docker环境中运行
startx /usr/bin/gst-launch-1.0 -ve playbin uri=file:///usr/src/app/big_buck_bunny_720p_stereo.avi
[Logs] [2019-7-18 6:54:14 PM] [main] Got context from element 'sink': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayX11\)\ gldisplayx11-0";
[Logs] [2019-7-18 6:54:14 PM] [main] error: XDG_RUNTIME_DIR not set in the environment.
[Logs] [2019-7-18 6:54:14 PM] [main] WARNING: from element /GstWaylandSink:waylandsink0: Could not initialise Wayland output
[Logs] [2019-7-18 6:54:14 PM] [main] Additional debug info:
[Logs] [2019-7-18 6:54:14 PM] [main] gstwaylandsink.c(289): gst_wayland_sink_find_display (): /GstWaylandSink:waylandsink0:
[Logs] [2019-7-18 6:54:14 PM] [main] Redistribute latency...
[Logs] [2019-7-18 6:54:14 PM] [main] Failed to create GstWlDisplay: 'Failed to connect to the wayland display '(default)''
在我的dockerfile中,安装以下文件:
RUN apt-get update && apt-get install --no-install-recommends \
xserver-xorg \
xinit \
xterm \
xfonts-utils \
xfonts-traditional \
python3-gi \
python3-gst-1.0 \
python3-gi-cairo \
gir1.2-gtk-3.0 \
gstreamer1.0-libav \
libgstreamer1.0-0-dbg \
gstreamer1.0-tools \
libgstreamer-plugins-base1.0-0 \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-ugly \
gstreamer1.0-plugins-bad-dbg \
gstreamer1.0-omx \
gstreamer1.0-alsa
据我了解,Gstreamer使用Wayland而不是Xserver,但是我无法弄清楚应如何/将XDG_RUNTIME_DIR设置为什么,或者是否需要导出其他内容才能使Wayland识别显示?