-
Edited by deisi1
Hey @jadahl
I'm currently trying to write a little python program that pics up on your work with the gnome screen cast api. However I can't really wrap my head around your example script. I have a somewhat decent python knowledge but I don't really know gsteamer and dbus. Could you help me with a little start.
What I need is a python program, that dumps out the pipewire stream into a file or even print. Could be raw data, I don't care, but I really don't understand this
stream.connect_to_signalandpipeline.set_stateand what not, further I couldn't find documentation on all these methods. All I need is a minimal example that captures the raw pipewire stream in some way so that I can parse it into another program later on.The goal is to write a capture program for hyperion
Thx in advance.
-
stream.connect_to_signalconnects to a D-Bus signal. How it works is that you create a screen cast session, say what you want to record, which will get you stream D-Bus objects. Then when you start, the display server (GNOME Shell) will start pipewire streams, and let you know via thePipeWireStreamAddedsignal on the correspondingorg.gnome.Mutter.ScreenCast.Streamobject.You then use the pipewire stream ID to create a gstreamer pipeline. The
set_stateyou see above is actually gst_element_set_state(). You can change the above code to output to a file by changing theximagesinkto something else (e.g. something ending with a filesink. You can add encoding etc by adapting the gstreamer pipeline to your needs. -
Thx a lot. I also started to learn more about gstreamer and it turns out that I need some more knowledge about it, but I'm getting there. :)
-
Edited by Florian Zwoch
Is there an example how to get a list of monitor/window ids to be used for this interface? With the defaults I have this running just fine - just not sure how to configure for anything other than not configuring and let the defaults kick in. I figured that I probably should use
org.freedesktop.portal.ScreenCast- however although I seem to have pipewire/gstreamer working correctly I have no idea what I have to do get this interface exposed:dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.ScreenCast” on object at path /org/freedesktop/portal/desktopRunning Debian/sid. Any hints are appreciated.
EDIT:
Don't know what package exactly was needed, but after installing
gnome-remote-desktopthe xdg API was accessible via dbus.
Please register or sign in to comment