4K video playback with gstreamer on Apalis IMX8

I’m trying to play a 4K content on my Apalis IMX8 on Ixora board (V1.2A).

For prototyping purpose, I’ve installed the Full Multimedia Reference image.

I tried the following pipeline:

root@apalis-imx8:~# gst-launch-1.0 -v filesrc location=/media/sda1/4k_content.mkv  ! qtdemux name=d d.video_0 ! queue ! h265parse ! v4l2h265dec !  imxvideoconvert_g2d ! queue ! waylandsink

But it failed:

error: XDG_RUNTIME_DIR not set in the environment. 0:00:00.188971226 1069 0xaaaac60c9e00 WARN waylandsink gstwaylandsink.c:428:gst_wayland_sink_find_display:<waylandsink0> warning: Could not initialise Wayland output 0:00:00.189001100 1069 0xaaaac60c9e00 WARN waylandsink gstwaylandsink.c:428:gst_wayland_sink_find_display:<waylandsink0> warning: Failed to create GstWlDisplay: 'Failed to connect to the wayland display '(default)'' ERROR: Pipeline doesn't want to pause. WARNING: from element /GstPipeline:pipeline0/GstWaylandSink:waylandsink0: Could not initialise Wayland output Additional debug info: ../git/ext/wayland/gstwaylandsink.c(428): gst_wayland_sink_find_display (): /GstPipeline:pipeline0/GstWaylandSink:waylandsink0: Failed to create GstWlDisplay: 'Failed to connect to the wayland display '(default)'' Setting pipeline to NULL ...

I guess there’s a issue with Wayland. Is there something I need to check in the reference multimedia linux system ?

I also tried to use glimagesink but it ended with SIGSEGV.

gst-launch-1.0 -v filesrc location=/media/sda1/4k_content.mkv   ! qtdemux name=d d.video_0 ! queue ! h265parse ! v4l2h265dec ! queue ! glimagesink async=false enable-last-sample=false qos=false sync=false

Setting pipeline to PAUSED ...
error: XDG_RUNTIME_DIR not set in the environment.
Caught SIGSEGV
exec gdb failed: No such file or directory
Spinning.  Please run 'gdb gst-launch-1.0 1173' to continue debugging, Ctrl-C to quit, or Ctrl-\ to dump core

.
I’m just wondering if there’s something with the pipeline above or if I need to check further the linux wayland configuration ?

Thanks.

Karim

Hi @karim , set XDG_RUNTIME_DIR in your console, export XDG_RUNTIME_DIR=/run/user/0.

Hi @benjamin.tx ,

thanks for your reply.
I’ve added the export XDG_RUNTIME_DIR=/run/user/0 and it works much better.

I finally use the following pipeline:

gst-launch-1.0 -v filesrc location=/media/sda1/solo.mkv  ! video/x-matroska ! aiurdemux  ! h265parse ! v4l2h265dec !  imxvideoconvert_g2d ! ! queue ! waylandsink

It appears the waylandsink is a better quality. With glimagesink the playback is a bit jerky.

Anyway, another problem remains, after few minutes, the playback is freezing.
But gstreamer is still alive, and after a while it logs:

GstWaylandSink:autovideosink0-actual-sink-wayland: A lot of buffers are being dropped...

What I’m wondering is, could it come from the v4l2h265dec plugin and options ? Or better from the queue plugins used in the pipeline ?

How could I debug or monitor the VPU processor ?

Thanks.

Karim

Hi @karim , does gplay-1.0 solo.mkv make it better ? Or you can add sync=false to the end of your pipeline.

Hi @benjamin.tx
Actually it was a buffering issue, so I’ve added queue elements in my pipeline.
Still stuttering sometime but much better than yesterday.
So this subject is closed as the really first answer helped me to fix the initial issue.

Thank you for the feedback.