• @jadahl Thanks for this, I've created a similar snippet for screen-shots based on this in https://gitlab.gnome.org/snippets/814

  • Could this be updated for more recent versions of python3-gi? Or at least inform which version-range it would work with?

    Ref:

    [2021-01-22 14:56:40] 0 x10an14@machine:~
    -> $ python3
    Python 3.8.5 (default, Jul 28 2020, 12:59:40)
    [GCC 9.3.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import gi
    >>> gi.repository
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    AttributeError: module 'gi' has no attribute 'repository'
    >>> gi.Repository
    <class 'gi.Repository'>
    >>> from gi.Repository import GLib
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ModuleNotFoundError: No module named 'gi.Repository'
    >>> gi.version_info
    (3, 36, 0)
    >>>
    Edited by Christian C.
  • Could this be updated for more recent versions of python3-gi?

    Hmm,

    >>> import gi
    >>> gi.version_info
    (3, 38, 0)
    >>> gi.repository
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    AttributeError: module 'gi' has no attribute 'repository'
    >>> gi.Repository
    <class 'gi.Repository'>

    but the script still works.

    FWIW, I removed the deprecated GObject.threads_init() so that warning should no longer occur.

  • @jadahl Hello. Thanks for this code. How can I record in MP4 with sound? The examples I've used before with ximagesrc don't work ...

  • @amikha1lov you need to set up your own gstreamer pipeline that combines some audio source with the pipewire stream; it's more of a gstreamer question.

  • Hi, thanks for the snippet! However, when I tried to connect screen_cast_call(portal.CreateSession, on_create_session_response, options={ 'session_handle_token': session_token }) to a button, in the second press of the button (after ending the first pipewire stream), it gives this error Failed to create session: 2. I assume that it has something to do that it can only have one successful request per session?

Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment