Gstreamer under weston does not work

Background info: I am trying to setup WPEWebkit + cog under weston using r35.6.0

After building WPEWebkit’s minibrowser, I attempted to load some websites and was greeted with gstreamer critical errors. In particular, I was getting

ERROR webkitmediaplayer MediaPlayerPrivateGStreamer.cpp:1728:handleMessage: Your GStreamer installation is missing a plug-in. (url=xxx.mp4) (code=12)

Weird I thought because in x11, I was able to playback any mp4 using gst-launch. So I referenced this page to do the same thing for weston. Turns out video playback in weston does not work.

Steps to reproduce:

  1. Download a mp4 file, say from file-examples.
  2. GST_DEBUG=2 gst-launch-1.0 filesrc location=<filename.mp4> ! qtdemux name=demux ! h264parse ! nvv4l2decoder ! nveglglessink winsys=wayland

This results in

ERROR nveglglessink gsteglglessink.c:2087:gst_eglglessink_upload:<eglglessink0> Failed to upload texture

Any ideas? Thank you!

Hi,
Please refer to

Accelerated GStreamer — NVIDIA Jetson Linux Developer Guide 1 documentation

Not sure if you run the script before running gst-launch-1.0 commands:

$ nvstart-weston.sh

Yes nvstart-weston.sh is run before everything. As I said above in x11, the tutorial works but the corresponding section for weston does not work. Thanks for the follow up!

Hi,
We don’t hit the issue on AGX Xavier developer kit/Jetpack 5.1.4(r35.6). Attach the log for reference:

nvidia@nvidia-desktop:~$ nvstart-weston.sh
Warning: The unit file, source configuration file or drop-ins of gdm.service changed on disk. Run 'systemctl daemon-reload' to reload units.
Launching weston...

!!! Weston launched successfully !!!

Weston startup log at:/tmp/weston-startup.log

To exit weston gracefully, execute:
    pkill -15 weston

Execute the following steps before starting X11 again:
    pkill -15 weston
    sudo rmmod tegra-udrm
nvidia@nvidia-desktop:~$ gst-launch-1.0 videotestsrc is-live=1 ! nvvidconv ! 'video/x-raw(memory:NVMM)' ! nvegltransform ! nveglglessink winsys=wayland
Setting pipeline to PAUSED ...

Using winsys: wayland
Pipeline is live and does not need PREROLL ...
Got context from element 'eglglessink0': gst.egl.EGLDisplay=context, display=(GstEGLDisplay)NULL;
Setting pipeline to PLAYING ...
New clock: GstSystemClock
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:10.975250896
Setting pipeline to NULL ...
Freeing pipeline ...
nvidia@nvidia-desktop:~$ cat /etc/nv_tegra_release
# R35 (release), REVISION: 6.0, GCID: 37391689, BOARD: t186ref, EABI: aarch64, DATE: Wed Aug 28 09:12:27 UTC 2024

Hi DaneLLL,

Thank you for the reply. For sanity check, I re-flashed a jetson xavier with 35.6.0 to conduct the experiment.

While your example worked, the original command I listed failed still. In particular, I am referring to this command applied to an h264 coded video.

The entire error message is attached here

Setting pipeline to PAUSED ...

Using winsys: wayland 
Opening in BLOCKING MODE 
0:00:00.214944548 46372 0xaaaad73460a0 WARN                    v4l2 gstv4l2object.c:4561:gst_v4l2_object_probe_caps:<nvv4l2decoder0:src> Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Unknown error -1
0:00:00.215014792 46372 0xaaaad73460a0 WARN                    v4l2 gstv4l2object.c:2420:gst_v4l2_object_add_interlace_mode:0xaaaad732b670 Failed to determine interlace mode
0:00:00.215086348 46372 0xaaaad73460a0 WARN                    v4l2 gstv4l2object.c:2420:gst_v4l2_object_add_interlace_mode:0xaaaad732b670 Failed to determine interlace mode
0:00:00.215146576 46372 0xaaaad73460a0 WARN                    v4l2 gstv4l2object.c:2420:gst_v4l2_object_add_interlace_mode:0xaaaad732b670 Failed to determine interlace mode
0:00:00.215206995 46372 0xaaaad73460a0 WARN                    v4l2 gstv4l2object.c:2420:gst_v4l2_object_add_interlace_mode:0xaaaad732b670 Failed to determine interlace mode
0:00:00.217187780 46372 0xaaaad73460a0 WARN                 basesrc gstbasesrc.c:3600:gst_base_src_start_complete:<filesrc0> pad not activated yet
Pipeline is PREROLLING ...
0:00:00.217951920 46372 0xaaaad73460a0 WARN               structure gststructure.c:1861:priv_gst_structure_append_to_gstring: No value transform to serialize field 'display' of type 'GstEGLDisplay'
Got context from element 'eglglessink0': gst.egl.EGLDisplay=context, display=(GstEGLDisplay)NULL;
0:00:00.218058358 46372 0xaaaad7202760 WARN                 qtdemux qtdemux_types.c:239:qtdemux_type_get: unknown QuickTime node type iods
0:00:00.218320357 46372 0xaaaad7202760 WARN                 qtdemux qtdemux.c:3250:qtdemux_parse_trex:<demux> failed to find fragment defaults for stream 1
0:00:00.218622326 46372 0xaaaad7202760 WARN                 qtdemux qtdemux.c:3250:qtdemux_parse_trex:<demux> failed to find fragment defaults for stream 2
NvMMLiteOpen : Block : BlockType = 261 
NvMMLiteBlockCreate : Block : BlockType = 261 
0:00:00.328835925 46372 0xaaaad7202760 WARN                    v4l2 gstv4l2object.c:4561:gst_v4l2_object_probe_caps:<nvv4l2decoder0:src> Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Unknown error -1
0:00:00.328923578 46372 0xaaaad7202760 WARN                    v4l2 gstv4l2object.c:2420:gst_v4l2_object_add_interlace_mode:0xaaaad732b670 Failed to determine interlace mode
0:00:00.328998143 46372 0xaaaad7202760 WARN                    v4l2 gstv4l2object.c:2420:gst_v4l2_object_add_interlace_mode:0xaaaad732b670 Failed to determine interlace mode
0:00:00.329071683 46372 0xaaaad7202760 WARN                    v4l2 gstv4l2object.c:2420:gst_v4l2_object_add_interlace_mode:0xaaaad732b670 Failed to determine interlace mode
0:00:00.329134695 46372 0xaaaad7202760 WARN                    v4l2 gstv4l2object.c:2420:gst_v4l2_object_add_interlace_mode:0xaaaad732b670 Failed to determine interlace mode
0:00:00.455666347 46372 0xaaaad7202760 WARN            v4l2videodec gstv4l2videodec.c:2305:gst_v4l2_video_dec_decide_allocation:<nvv4l2decoder0> Duration invalid, not setting latency
0:00:00.456361234 46372 0xaaaad7202760 WARN          v4l2bufferpool gstv4l2bufferpool.c:1114:gst_v4l2_buffer_pool_start:<nvv4l2decoder0:pool:src> Uncertain or not enough buffers, enabling copy threshold
0:00:00.469188464 46372 0xaaaad72029e0 WARN          v4l2bufferpool gstv4l2bufferpool.c:1565:gst_v4l2_buffer_pool_dqbuf:<nvv4l2decoder0:pool:src> Driver should never set v4l2_buffer.field to ANY
nveglglessink cannot handle Legacy NVMM Buffers gst_eglglessink_cuda_buffer_copy
0:00:00.469571494 46372 0xaaaad7202580 ERROR          nveglglessink gsteglglessink.c:2087:gst_eglglessink_upload:<eglglessink0> Failed to upload texture
0:00:00.470711527 46372 0xaaaad7202760 WARN                 qtdemux qtdemux.c:6630:gst_qtdemux_loop:<demux> error: Internal data stream error.
0:00:00.470751881 46372 0xaaaad7202760 WARN                 qtdemux qtdemux.c:6630:gst_qtdemux_loop:<demux> error: streaming stopped, reason error (-5)
ERROR: from element /GstPipeline:pipeline0/GstQTDemux:demux: Internal data stream error.
Additional debug info:
qtdemux.c(6630): gst_qtdemux_loop (): /GstPipeline:pipeline0/GstQTDemux:demux:
streaming stopped, reason error (-5)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

Thank you!

Hi,
It looks like caps is not correctly set. Please link the tail like this:

... ! nvvidconv ! 'video/x-raw(memory:NVMM)' ! nvegltransform ! nveglglessink winsys=wayland

Thank you! It did work after putting in nvegltransform.

In particular
gst-launch-1.0 filesrc location=<file.mp4> ! qtdemux name=demux ! h264parse ! nvv4l2decoder ! nvegltransform ! nveglglessink winsys=wayland did the trick.

So now that video playback is possible, it looks like the GST errors are probably due to webkit not adding certain parameters or some configuration issue in the abstraction layer.

Finally, it would be great if the nvidia documentation is updated!