Change resolution and/or framerate in wpesrc

We are investigating the use of wpesrc to create animated HTML overlays for live streamed video in the cloud for a large number of users.

Our ideal would be to run in Docker using CPU based rendering so have the following environment variable set:

export LIBGL_ALWAYS_SOFTWARE=true

We have the plugin working using the gst-launch-1.0 command, bit when we try to add a capsFilter we get a reason not-negotiated (-4) error as below.

We will also investigate GPU based rendering, but it seems changing the resolution or framerate using caps is not working for software rendering?

We are using Ubuntu Jammy and installed gstreamer1.0-wpe using apt-get so might be issue with older 1.20.3 plugin only?

Without changing the caps, we are using a lot of CPU for the 1920x1080 @ 30 fps video being generated by default.

Thanks in advance!

# gst-launch-1.0 -e -v wpesrc location="XXX" draw-background=0 ! "video/x-raw,width=1280,height=720,framerate=5/1" ! fakesink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstWpeSrc:wpesrc0/GstWpeVideoSrc:wpevideosrc0.GstPad:src: caps = video/x-raw, format=(string)BGRA, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1
Could not determine the accessibility bus address
ERROR: from element /GstPipeline:pipeline0/GstWpeSrc:wpesrc0/GstWpeVideoSrc:wpevideosrc0: Internal data stream error.
Additional debug info:
../libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstWpeSrc:wpesrc0/GstWpeVideoSrc:wpevideosrc0:
**streaming stopped, reason not-negotiated (-4)**
Execution ended after 0:00:00.107517575
Setting pipeline to NULL ...
Freeing pipeline ...

Details of plugin:

# gst-inspect-1.0 wpesrc
Factory Details:
  Rank                     none (0)
  Long-name                WPE source
  Klass                    Source/Video/Audio
  Description              Creates Audio/Video streams from a web page using WPE web engine
  Author                   Philippe Normand <philn@igalia.com>, ?an Dober?ek <zdobersek@igalia.com>

Plugin Details:
  Name                     wpe
  Description              WPE src plugin
  Filename                 /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstwpe.so
  Version                  1.20.3
  License                  LGPL
  Source module            gst-plugins-bad
  Source release date      2022-06-15
  Binary package           gst-plugins-bad

as far as I understand, wpesrc’s framerate is fixed to 30/1, that would be the reason for the negotiation failure.

It turns out the LIBGL_ALWAYS_SOFTWARE environment variable is not needed, even in Docker container with no GPU. By not setting the environment variable to true (or omitting), the caps came through as expected and performance improved.