• Frenchgeek@lemmy.ml
    link
    fedilink
    arrow-up
    1
    ·
    7 hours ago

    I’m still trying to figure out why the only real way of taking screenshots fast in Wayland is to do a video capture of the desktop with pipewire…

      • Frenchgeek@lemmy.ml
        link
        fedilink
        arrow-up
        2
        ·
        2 hours ago

        I need it to automate fishing in Minecraft, and the normal way to take screenshots in Python (which is one line with PIL) on Linux went from at least 30 possible fps on X11 to 2 on Wayland. The only way to do it fast enough then is to use Pipewire. Which is one hell of a convoluted mess. (The next part of this whole mess will be finding a way to send mouse clicks without having Minecraft registering a mouse move too in case xdotools stop working)

        • prole@lemmy.blahaj.zone
          link
          fedilink
          arrow-up
          1
          ·
          edit-2
          2 hours ago

          You need the print screen key for something else is what you’re saying (I had trouble following your reply)?

          Can only speak for KDE, but you can easily change the screenshot shortcut to something else in settings.

          • Frenchgeek@lemmy.ml
            link
            fedilink
            arrow-up
            1
            ·
            edit-2
            21 minutes ago

            I’m writing a script that automatically take screenshots of the desktop (in particular the Minecraft game window) and then use OpenCV to do template matching to recognize if I’ve caught a fish or not.

            If I use any usual screenshot capabilities of any python library, I simply cannot take pictures fast enough (at least 10 images per second) to have the script work (under Wayland the usual system top out at 2 images per second).

            The only way fast enough I’ve found so far is to use Pipewire to create a livestream of the desktop and get frames of it to do the job.

            And it is a complex mess. (At least I’ve found a (very basic and badly documented) library to do most of the work instead of having to work it all through Dbus myself.)

            It’s just that what once was a single line in my previous X11 script is now a full on script by itself, and I understand almost nothing of it.