gstreamer HW Acceleration on Intel Arc GPU - gstreamer error
Hi, I've been looking into using xpra with hardware acceleration on the server side. The hardware is a Beelink MINI-S12 Pro (amd64), So this is using an Intel Arc GPU For the operating system to give myself the best chance, I've been using Gentoo (so I can tweak different versions of libraries and xpra itself) with the hardware acceleration use flags enabled such as "gstreamer vaapi qsv"
My understanding is that xpra uses gstreamer which then taps into libva which is then provided by media-libs/libva-intel-media-driver under gentoo (I've also got media-libs/vpl-gpu-rt-24.4.4 and media-libs/libvpl installed but I don't think they're being used by xpra)
I managed to get it working once for xfce-session but other times or using startplasma-x11, it seems to bomb out with the below logs I admit I think this is an experimental setup, it could also be related to the versions of packages I'm using but I've also seen other issues as well https://github.com/Xpra-org/xpra/issues/3964 I figured I'd post this in case the logs were of any use For now I've just disabled gstreamer support on the build I'm using which works fine and is easily faster than rdp / vnc (so no complaints)
To Reproduce
# server command
xpra start-desktop :100 --start="startplasma-x11" --bind-tcp=0.0.0.0:10000 --dpi=96
# client windows 10 gui
System Information (please complete the following information):
- Server OS: Gentoo latest amd64, systemd, plasma profile
- Client OS: Windows 10
- Xpra Server Version 6.2.3
- Xpra Client Version 6.2.3
The first bit of /run/user/1000/xpra/100/server.log
2025-03-01 23:29:58,813 created tcp socket '0.0.0.0:10000'
2025-03-01 23:29:58,853 no uinput module (not usually needed)
X.Org X Server 1.21.1.15
X Protocol Version 11, Revision 0
Current Operating System: Linux App3 6.12.16-gentoo-dist #1 SMP PREEMPT_DYNAMIC Fri Feb 21 16:00:51 -00 2025 x86_64
Kernel command line: BOOT_IMAGE=/boot/kernel-6.12.16-gentoo-dist root=UUID=e24137f5-7897-4d27-a01c-9b59051d2d79 ro
Current version of pixman: 0.44.2
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(++) Log file: "/run/user/1000/xpra/100/Xorg.log", Time: Sat Mar 1 23:29:58 2025
(++) Using config file: "/etc/xpra/xorg.conf"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
2025-03-01 23:30:00,314 pointer device emulation using XTest
2025-03-01 23:30:00,315 wrote pid 756 to '/run/user/1000/xpra/100/server.pid'
2025-03-01 23:30:00,316 serving html content from '/usr/share/xpra/www'
2025-03-01 23:30:00,464 some GStreamer elements are missing or unavailable on this system:
2025-03-01 23:30:00,464 vaapih264enc, vaapih265enc, openh264enc, vp8enc, vp9enc, av1enc
2025-03-01 23:30:00,471 created unix domain sockets:
2025-03-01 23:30:00,471 '/var/run/xpra/App3-100'
2025-03-01 23:30:00,471 '/run/user/1000/xpra/100/socket'
2025-03-01 23:30:00,471 created abstract sockets:
2025-03-01 23:30:00,471 '@xpra/100'
2025-03-01 23:30:00,472 xvfb pid 761
2025-03-01 23:30:00,480 Warning: failed to load the mdns publishers
2025-03-01 23:30:00,480 No module named 'zeroconf'
2025-03-01 23:30:00,480 No module named 'avahi'
2025-03-01 23:30:00,480 install 'python-avahi', 'python-zeroconf'
2025-03-01 23:30:00,480 or use the 'mdns=no' option
2025-03-01 23:30:00,500 D-Bus notification forwarding is available
2025-03-01 23:30:00,512 pulseaudio not started: 'pulseaudio' command not found
2025-03-01 23:30:00,514 removing private directory '/run/user/1000/xpra/100/pulse'
2025-03-01 23:30:00,533 watching for applications menu changes in:
2025-03-01 23:30:00,534 '/usr/share/applications'
2025-03-01 23:30:00,534 using 'Gio file monitor'
2025-03-01 23:30:00,547 printer forwarding enabled using postscript and pdf
2025-03-01 23:30:00,577 xpra is ready.
2025-03-01 23:30:00,581 xpra X11 desktop server version 6.2.3-r3
2025-03-01 23:30:00,585 uid=1000 (ric), gid=1000 (ric)
2025-03-01 23:30:00,585 running with pid 756 on Linux Gentoo 2.17
2025-03-01 23:30:00,585 cpython 3.12
2025-03-01 23:30:00,587 connected to X11 display :100 with 24 bit colors
2025-03-01 23:30:00,588 initial resolution: 2048x1536
2025-03-01 23:30:00,592 :100.0 (541x406 mm - DPI: 96x96)
2025-03-01 23:30:00,592 DUMMY0 (542x406 mm)
2025-03-01 23:30:00,722 15.4GB of system memory
2025-03-01 23:30:00,874 GStreamer version 1.24.11
2025-03-01 23:30:01,671 OpenGL is supported on display ':100'
2025-03-01 23:30:01,671 using 'llvmpipe (LLVM 19.1.7, 256 bits)' renderer
2025-03-01 23:30:01,672 started command `startplasma-x11` with pid 860
2025-03-01 23:30:01,673 wrote pid 860 to '/run/user/1000/xpra/100/startplasma-x11.pid'
Initializing "/usr/lib64/qt6/plugins/plasma/kcms/systemsettings/kcm_style.so"
kf.kirigami.platform: Failed to find a Kirigami platform plugin for style "Fusion"
Initializing "/usr/lib64/qt6/plugins/plasma/kcms/systemsettings/kcm_fonts.so"
Initializing "/usr/lib64/qt6/plugins/plasma/kcms/systemsettings/kcm_mouse.so"
kcm_mouse: Not able to select appropriate backend.
org.kde.plasma.session: process job "kcminit_startup" finished with exit code 0
org.kde.kameleon: found no RGB LED devices
QDBusObjectPath: invalid path "/modules/kded_plasma-welcome"
kf.dbusaddons: The kded module name "kded_plasma-welcome" is invalid!
Couldn't start kglobalaccel from org.kde.kglobalaccel.service: QDBusError("org.freedesktop.DBus.Error.ServiceUnknown", "The name org.kde.kglobalaccel was not provided by any .service files")
Couldn't start kglobalaccel from org.kde.kglobalaccel.service: QDBusError("org.freedesktop.DBus.Error.ServiceUnknown", "The name org.kde.kglobalaccel was not provided by any .service files")
QDBusObjectPath: invalid path "/modules/plasma-session-shortcuts"
kf.dbusaddons: The kded module name "plasma-session-shortcuts" is invalid!
org.kde.colorcorrectlocationupdater: Geolocator stopped
kcm_touchpad: Using X11 backend
kf.coreaddons: The plugin "/usr/lib64/qt6/plugins/kaccounts/daemonplugins/gdrive.so" explicitly states an Id in the embedded metadata, which is different from the one derived from the filename The Id field from the KPlugin object in the metadata should be removed
kf.config.kconf_update: /usr/share/kconf_update/ark.upd defined Version=5 but Version=6 was expected
kf.config.kconf_update: /usr/share/kconf_update/dolphin_detailsmodesettings.upd defined Version=5 but Version=6 was expected
kf.config.kconf_update: /usr/share/kconf_update/dolphin_directorysizemode.upd defined Version=5 but Version=6 was expected
kf.config.kconf_update: /usr/share/kconf_update/filepicker.upd defined Version=5 but Version=6 was expected
kf.config.kconf_update: /usr/share/kconf_update/konsole.upd defined Version=5 but Version=6 was expected
kf.config.kconf_update: /usr/share/kconf_update/okular.upd defined Version=5 but Version=6 was expected
Couldn't start kglobalaccel from org.kde.kglobalaccel.service: QDBusError("org.freedesktop.DBus.Error.ServiceUnknown", "The name org.kde.kglobalaccel was not provided by any .service files")
kf.kio.gui: Failed to determine systemd version, falling back to extremely legacy forking mode.
Initializing "/usr/lib64/qt6/plugins/plasma/kcms/systemsettings_qwidgets/kcm_kgamma.so"
Initializing "/usr/lib64/qt6/plugins/plasma/kcms/systemsettings/kcm_touchpad.so"
kcm_touchpad: Using X11 backend
kwin_platform_x11_standalone: glSwapInterval is unsupported
Xlib XKB extension major= 1 minor= 0
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
kf.modemmanagerqt: Failed enumerating MM objects: "org.freedesktop.systemd1.NoSuchUnit"
"Unit dbus-org.freedesktop.ModemManager1.service not found."
xsettingsd: Loaded 14 settings from /home/ric/.config/xsettingsd/xsettingsd.conf
xsettingsd: Created window 0x2600001 on screen 0 with timestamp 254523
xsettingsd: Selection _XSETTINGS_S0 is owned by 0x0
xsettingsd: Took ownership of selection _XSETTINGS_S0
Known activities: QList("3bbed55e-0719-4af4-88d6-195f4a5cb93e")
Known activities: QList("3bbed55e-0719-4af4-88d6-195f4a5cb93e")
kf.bluezqt: PendingCall Error: "The name org.bluez.obex was not provided by any .service files"
kf.bluezqt: PendingCall Error: "Unit dbus-org.bluez.service not found."
kf.config.core: "\"fsrestore1\" - conversion of \"0,0,0,0\" to QRect failed"
kf.config.core: "\"fsrestore2\" - conversion of \"0,0,0,0\" to QRect failed"
kf.config.core: "\"fsrestore3\" - conversion of \"0,0,0,0\" to QRect failed"
kf.kio.gui: Failed to determine systemd version, falling back to extremely legacy forking mode.
New PolkitAgentListener 0x56119e3fa1e0
Adding new listener PolkitQt1::Agent::Listener(0x56119e3fc670) for 0x56119e3fa1e0
Listener online
Authentication agent result: true
kscreen.kded: PowerDevil SuspendSession action not available!
Failed to create wl_display (No such file or directory)
kwin_platform_x11_standalone: Bogus refresh rate -29087
X server XKB extension major= 1 minor= 0
Couldn't start kglobalaccel from org.kde.kglobalaccel.service: QDBusError("org.freedesktop.DBus.Error.ServiceUnknown", "The name org.kde.kglobalaccel was not provided by any .service files")
Couldn't start kglobalaccel from org.kde.kglobalaccel.service: QDBusError("org.freedesktop.DBus.Error.ServiceUnknown", "The name org.kde.kglobalaccel was not provided by any .service files")
Starting kclockd 24.08.3
Registered on DBus: true
PowerDevil not found, using wait worker thread for time tracking.
KPackageStructure of KPluginMetaData(pluginId:"org.kde.graphsplasmoid", fileName: "/usr/share/plasma/plasmoids/org.kde.graphsplasmoid/metadata.json") does not match requested format "Plasma/Applet"
KPackageStructure of KPluginMetaData(pluginId:"org.kde.plasma.kclock_1x2", fileName: "/usr/share/plasma/plasmoids/org.kde.plasma.kclock_1x2/metadata.json") does not match requested format "Plasma/Applet"
KPackageStructure of KPluginMetaData(pluginId:"org.kde.plasma.kweather_1x4", fileName: "/usr/share/plasma/plasmoids/org.kde.plasma.kweather_1x4/metadata.json") does not match requested format "Plasma/Applet"
QThreadStorage: Thread 0x55a626d1fba0 exited after QThreadStorage 9 destroyed
QThreadStorage: Thread 0x55a626d1fba0 exited after QThreadStorage 7 destroyed
QThreadStorage: Thread 0x55a626d1fba0 exited after QThreadStorage 1 destroyed
org.kde.powerdevil: org.kde.powerdevil.discretegpuhelper.hasdualgpu failed
org.kde.powerdevil: org.kde.powerdevil.chargethresholdhelper.getthreshold failed ""
org.kde.powerdevil: org.kde.powerdevil.backlighthelper.brightness failed
kwin_platform_x11_standalone: Bogus refresh rate -29087
kf.plasma.quick: Applet preload policy set to 1
file:///usr/share/plasma/plasmoids/org.kde.desktopcontainment/contents/ui/main.qml:178:25: QML FolderViewDropArea (parent or ancestor of QQuickLayoutAttached): Binding loop detected for property "minimumWidth":
file:///usr/share/plasma/plasmoids/org.kde.desktopcontainment/contents/ui/main.qml:201:9
org.kde.kscreen.dpms: DPMS extension not available
PowerDevil found on DBus
org.kde.powerdevil: Handle button events action could not check for screen configuration
org.kde.powerdevil: org.kde.powerdevil.chargethresholdhelper.getthreshold failed ""
Toolbox not loading, toolbox package is either invalid or disabled.
kwin_platform_x11_standalone: Bogus refresh rate -29087
kwin_platform_x11_standalone: Bogus refresh rate -29087
2025-03-01 23:30:05,810 loaded 90 start menu entries from 12 sub-menus in 5.2 seconds
kwin_platform_x11_standalone: Bogus refresh rate -29087
org.kde.plasma.kicker: Entry is not valid "org.kde.kontact.desktop" 0x564c84ed6b80
org.kde.plasma.kicker: Entry is not valid "org.kde.discover.desktop" 0x564c84ed6b80
org.kde.plasma.kicker: Entry is not valid "org.kde.kontact.desktop" 0x564c84ed6b80
org.kde.plasma.kicker: Entry is not valid "org.kde.discover.desktop" 0x564c84ed6b80
kwin_platform_x11_standalone: Bogus refresh rate -29087
kwin_platform_x11_standalone: Bogus refresh rate -29087
file:///usr/share/plasma/plasmoids/org.kde.plasma.private.systemtray/contents/ui/main.qml:50:9: QML KSortFilterProxyModel: Binding loop detected for property "sourceModel"
file:///usr/share/plasma/plasmoids/org.kde.plasma.private.systemtray/contents/ui/main.qml:50:9: QML KSortFilterProxyModel: Binding loop detected for property "sourceModel"
qt.dbus.integration: Could not connect "org.cups.cupsd.Notifier" to PrinterFinishingsChanged(QString, QString, QString, uint, QString, bool) :
org.kde.plasma.notificationmanager: Failed to register Notification service on DBus
kwin_platform_x11_standalone: Bogus refresh rate -29087
Listener adapter polkit_qt_listener_initiate_authentication
GSimpleAsyncResult: 0x56119fe8c960
polkit_qt_listener_initiate_authentication callback for 0x56119e3fa1e0
Initiating authentication
Action description has been found
kwin_platform_x11_standalone: Bogus refresh rate -29087
kwin_platform_x11_standalone: Bogus refresh rate -29087
kwin_platform_x11_standalone: Bogus refresh rate -29087
User: "unix-user:root"
Trying again
REQUEST
Request: "Password: "
error getting max keyboard brightness via dbus QDBusError("org.freedesktop.DBus.Error.UnknownObject", "No such object path '/org/kde/Solid/PowerManagement/Actions/KeyboardBrightnessControl'")
QFont::setPointSizeF: Point size <= 0 (0.000000), must be greater than 0
kwin_platform_x11_standalone: Bogus refresh rate -29087
kwin_platform_x11_standalone: Bogus refresh rate -29087
kameleon supported false
kameleon enabled true
Interesting bit
2025-03-01 23:30:09,430 New tcp connection received
2025-03-01 23:30:09,430 from '192.168.111.66:64856'
2025-03-01 23:30:09,430 on '0.0.0.0:10000'
2025-03-01 23:30:09,440 Handshake complete; enabling connection
2025-03-01 23:30:09,469 Python/GTK3 Microsoft Windows aero client version 6.2
2025-03-01 23:30:09,469 OpenGL is enabled using win32 backend with IntelR UHD Graphics
2025-03-01 23:30:09,477 setting key repeat rate from client: 500ms delay / 33ms interval
2025-03-01 23:30:09,480 setting keyboard layout to 'gb'
2025-03-01 23:30:09,518 client did not supply any modifier definitions, using defaults
kf.windowsystem.keyserver.x11: Your keyboard setup doesn't provide a key to use for meta. See 'xmodmap -pm' or 'xkbcomp $DISPLAY'
2025-03-01 23:30:09,730 automatic picture encoding enabled, also available:
2025-03-01 23:30:09,730 h264, vp9, vp8, png, png/P, png/L, rgb24, rgb32, jpeg, jpega, scroll
2025-03-01 23:30:09,753 client 1 @03.296 Xpra X11 desktop server version 6.2
2025-03-01 23:30:09,753 client 1 @03.296 remote desktop size is 7680x4320
2025-03-01 23:30:09,753 client 1 @03.296 :100.0 (2030x1141 mm - DPI: 96x96) workarea: 7680x4254
2025-03-01 23:30:09,753 client 1 @03.296 DUMMY0 (2032x1143 mm)
2025-03-01 23:30:09,760 found GPU accelerated encoders for: h264
2025-03-01 23:30:09,760 switching to 'stream' encoding for 'desktop' window 1
2025-03-01 23:30:09,760 using 'gstreamer' stream mode
2025-03-01 23:30:09,791 Error setting up the pipeline:
2025-03-01 23:30:09,791 gst_parse_error: could not link videoconvert0 to encoder with caps video/x-raw, format=(string)NV12 (3)
2025-03-01 23:30:09,791 GStreamer pipeline for:
2025-03-01 23:30:09,791 ximagesrc show-pointer=False do-timestamp=True use-damage=False xid=1231 name=capture ! \
2025-03-01 23:30:09,791 queue leaky=2 max-size-buffers=1 ! \
2025-03-01 23:30:09,791 videoconvert ! \
2025-03-01 23:30:09,792 video/x-raw,format=NV12 ! \
2025-03-01 23:30:09,792 vah264lpenc name=encoder ! \
2025-03-01 23:30:09,792 video/x-h264,alignment=(string)au,stream-format=(string)byte-stream ! \
2025-03-01 23:30:09,792 appsink name=sink emit-signals=True max-buffers=1 drop=False sync=False async=False qos=False
2025-03-01 23:30:09,792 Error: processing new connection from Protocol(tcp socket: 192.168.111.56:10000 <- 192.168.111.66:64856):
Traceback (most recent call last):
File "/usr/lib/python3.12/site-packages/xpra/server/base.py", line 442, in process_hello_ui
self.send_initial_data(ss, c, send_ui, share_count)
File "/usr/lib/python3.12/site-packages/xpra/server/base.py", line 467, in send_initial_data
bc.send_initial_data(self, ss, c, send_ui, share_count)
File "/usr/lib/python3.12/site-packages/xpra/server/mixins/window.py", line 137, in send_initial_data
self.send_initial_windows(ss, share_count > 0)
File "/usr/lib/python3.12/site-packages/xpra/x11/desktop/base.py", line 193, in send_initial_windows
self.send_new_desktop_model(model, ss, sharing)
File "/usr/lib/python3.12/site-packages/xpra/x11/desktop/base.py", line 201, in send_new_desktop_model
ss.damage(wid, model, 0, 0, w, h)
File "/usr/lib/python3.12/site-packages/xpra/server/source/windows.py", line 600, in damage
ws.damage(x, y, w, h, damage_options)
File "/usr/lib/python3.12/site-packages/xpra/server/window/compress.py", line 1579, in damage
self.do_damage(ww, wh, x, y, w, h, options)
File "/usr/lib/python3.12/site-packages/xpra/server/window/video_compress.py", line 657, in do_damage
if self.gstreamer_pipeline or self.start_gstreamer_pipeline():
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/xpra/server/window/video_compress.py", line 698, in start_gstreamer_pipeline
self.gstreamer_pipeline = capture_and_encode(capture_element, self.encoding, self.full_csc_modes, w, h)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/xpra/codecs/gstreamer/capture.py", line 192, in capture_and_encode
return CaptureAndEncode(capture_element, encoding, encoder, csc_mode, w, h)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/xpra/codecs/gstreamer/capture.py", line 205, in __init__
super().__init__(element, pixel_format, width, height)
File "/usr/lib/python3.12/site-packages/xpra/codecs/gstreamer/capture.py", line 62, in __init__
self.create_pipeline(element)
File "/usr/lib/python3.12/site-packages/xpra/codecs/gstreamer/capture.py", line 233, in create_pipeline
raise RuntimeError("failed to setup gstreamer pipeline")
RuntimeError: failed to setup gstreamer pipeline
2025-03-01 23:30:09,804 Disconnecting client 192.168.111.66:64856:
2025-03-01 23:30:09,804 connection error (error accepting new connection)
2025-03-01 23:30:09,805 Python/GTK3 client 1 disconnected.
2025-03-01 23:30:09,809 Error: unknown or invalid packet type 'keymap-changed'
2025-03-01 23:30:09,809 received from Protocol(tcp socket: 192.168.111.56:10000 <- 192.168.111.66:64856)
2025-03-01 23:30:09,809 14 packets received (9.2K bytes)
2025-03-01 23:30:09,809 5 packets sent (5.4K bytes)
My understanding is that xpra uses gstreamer which then taps into libva
Only for intel via libva, for other GPUs, xpra has its own codecs and those are much more reliable than the gstreamer adapter.
but other times or using startplasma-x11, it seems to bomb out with the below logs
Many desktop environments require OpenGL acceleration nowadays, it could be the problem.
vah264lpenc(..)gst_parse_error: could not link videoconvert0 to encoder with caps video/x-raw, format=(string)NV12 (3)
Sorry, but this is one of the reasons why the gstreamer adapter is not on the same level as as the true native codecs. It's flaky.
After a bit of digging I think this is a gstreamer issue related to vah264lpenc trying to use the graphics hardware
# Basic test video - works fine
gst-launch-1.0 videotestsrc ! autovideosink
# take the parameters xpra is using
# but with different source (test image) and destination (X window)
# this Fails
gst-launch-1.0 videotestsrc ! queue leaky=2 max-size-buffers=1 ! videoconvert ! video/x-raw,format=NV12 ! vah264lpenc name=encoder ! video/x-h264,alignment="au",stream-format="byte-stream" ! autovideosink
setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Got context from element 'autovideosink0': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayX11\)\ gldisplayx11-0";
Got context from element 'encoder': gst.va.display.handle=context, gst-display=(GstObject)"\(GstVaDisplayDrm\)\ vadisplaydrm2", description=(string)"Intel\(R\)\ Gen\ Graphics", path=(string)/dev/dri/renderD128;
ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0: Internal data stream error.
Additional debug info:
../gstreamer-1.24.11/libs/gst/base/gstbasesrc.c(3177): gst_base_src_loop (): /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0:
streaming stopped, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
So far I've tried updating to the latest media-libs/libva-intel-media-driver (25.1.2) but without much luck
Using the examples gstreamer gives as a basis, it seems to work when the sink is a file but not a real video source
# Fails
gst-launch-1.0 videotestsrc num-buffers=60 ! timeoverlay ! vah264lpenc ! h264parse ! mp4mux ! autovideosink
# Works
gst-launch-1.0 videotestsrc num-buffers=60 ! timeoverlay ! vah264lpenc ! h264parse ! mp4mux ! filesink location=test.mp4
issue related to vah264lpenc trying to use the graphics hardware
We only use the gstreamer adapter to mediate access to the hardware encoders.
but with different source (test image) and destination (X window) (..)
video/x-h264,alignment="au",stream-format="byte-stream" ! autovideosink
xpra uses an appsink to receive the h264 stream data and then forward it to the client. (and clients usually do not use gstreamer at all)
I don't think that autovideosink can handle the bytestream directly without something like: h264parse ! avdec_h264 ! videoconvert ! autovideosink
filesink "works" but you're just saving the bytestream.
Thanks for the tip, I thought it was something like that but I'm a bit new to gstreamer with that bit of info I've done a bit of experimenting, but I've not been able to replicate any errors via gst-launch in an existing X window (kde plasma)
Starting to wonder if this might be a question of timing, if perhaps xpra is launching gstreamer before X is ready to give its output via ximagesrc, but thats just guessing / speculation, although it might explain why I managed to get it working the one time.
Pure Invocation
This doesn't go anywhere obviously but also doesn't error
gst-launch-1.0 ximagesrc show-pointer=False do-timestamp=True use-damage=False xid=1231 name=capture ! queue leaky=2 max-size-buffers=1 ! videoconvert ! video/x-raw,format=NV12 ! vah264lpenc name=encoder ! video/x-h264,alignment="au",stream-format="byte-stream" ! appsink name=sink emit-signals=True max-buffers=1 drop=False sync=False async=False qos=False
Console Output
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Got context from element 'encoder': gst.va.display.handle=context, gst-display=(GstObject)"\(GstVaDisplayDrm\)\ vadisplaydrm2", description=(string)"Intel\(R\)\ Gen\ Graphics", path=(string)/dev/dri/renderD128;
Redistribute latency...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Redistribute latency...
videotestsrc as input, autovideosink as output
No errors, queue seems to stall / delay the output, maybe that's expected
gst-launch-1.0 videotestsrc ! timeoverlay ! queue leaky=2 max-size-buffers=1 ! videoconvert ! video/x-raw,format=NV12 ! vah264lpenc name=encoder ! video/x-h264,alignment="au",stream-format="byte-stream" ! avdec_h264 ! videoconvert ! autovideosink
Console Output
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Got context from element 'autovideosink0': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayX11\)\ gldisplayx11-0";
Got context from element 'encoder': gst.va.display.handle=context, gst-display=(GstObject)"\(GstVaDisplayDrm\)\ vadisplaydrm2", description=(string)"Intel\(R\)\ Gen\ Graphics", path=(string)/dev/dri/renderD128;
Redistribute latency...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
Redistribute latency...
New clock: GstSystemClock
ximagesrc as input, autovideosink as output
Gives a fun window in window effect, I think that's just what's causing the warnings, no errors though.
gst-launch-1.0 ximagesrc show-pointer=False do-timestamp=True use-damage=False xid=1231 name=capture ! queue leaky=2 max-size-buffers=1 ! videoconvert ! video/x-raw,format=NV12 ! vah264lpenc name=encoder ! video/x-h264,alignment="au",stream-format="byte-stream" ! avdec_h264 ! videoconvert ! autovideosink
Console Output
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Got context from element 'autovideosink0': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayX11\)\ gldisplayx11-0";
Got context from element 'encoder': gst.va.display.handle=context, gst-display=(GstObject)"\(GstVaDisplayDrm\)\ vadisplaydrm2", description=(string)"Intel\(R\)\ Gen\ Graphics", path=(string)/dev/dri/renderD128;
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Redistribute latency...
Redistribute latency...
WARNING: from element /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstGLImageSinkBin:autovideosink0-actual-sink-glimage/GstGLImageSink:sink: A lot of buffers are being dropped.
Additional debug info:
../gstreamer-1.24.11/libs/gst/base/gstbasesink.c(3147): gst_base_sink_is_too_late (): /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstGLImageSinkBin:autovideosink0-actual-sink-glimage/GstGLImageSink:sink:
There may be a timestamping problem, or this computer is too slow.
WARNING: from element /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstGLImageSinkBin:autovideosink0-actual-sink-glimage/GstGLImageSink:sink: A lot of buffers are being dropped.
Additional debug info:
../gstreamer-1.24.11/libs/gst/base/gstbasesink.c(3147): gst_base_sink_is_too_late (): /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstGLImageSinkBin:autovideosink0-actual-sink-glimage/GstGLImageSink:sink:
There may be a timestamping problem, or this computer is too slow.
ERROR: from element /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstGLImageSinkBin:autovideosink0-actual-sink-glimage/GstGLImageSink:sink: Quit requested
Additional debug info:
../gst-plugins-base-1.24.11/ext/gl/gstglimagesink.c(1922): gst_glimage_sink_show_frame (): /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstGLImageSinkBin:autovideosink0-actual-sink-glimage/GstGLImageSink:sink
Execution ended after 0:00:02.746836742
Setting pipeline to NULL ...
Freeing pipeline ...
if perhaps xpra is launching gstreamer before X is ready to give its output via ximagesrc
- xpra may or may not use
ximagesrc ximagesrcis always available since xpra starts the X11 server first
This might be a driver issue. https://github.com/intel/media-driver/issues/1800
This might be a driver issue. intel/media-driver#1800
I tried running the same command mentioned in the linked issue, but it seemed to work fine at least on my setup without crashing. Pulling from ximagesrc doesn't seem to be a problem for me if done directly. That might be because I'm using the latest version of the driver via gentoo. For some reason xpra seems to have issues with it though
gst-launch-1.0 ximagesrc show-pointer=0 remote=1 blocksize=16384 use-damage=0 ! "video/x-raw,framerate=60/1" ! vapostproc scale-method=fast ! "video/x-raw(memory:VAMemory),format=NV12" ! vah264lpenc aud=false b-frames=0 cpb-size=67 dct8x8=false key-int-max=1024 mbbrc=enabled num-slices=4 rate-control=cbr target-usage=4 bitrate=4000 ! "video/x-h264,profile=high,stream-format=byte-stream" ! h264parse ! queue ! fakesink
Closing in favour of #4628