pythonarcade / arcade

Easy to use Python library for creating 2D arcade games.
http://arcade.academy
Other
1.69k stars 319 forks source link

Documentation: Add guide on taking screenshots & recordings #1338

Open pushfoo opened 1 year ago

pushfoo commented 1 year ago

Documentation request:

What documentation needs to be added?

Per-platform guides to:

  1. Recording still images and video from the screen
  2. Converting captures to formats supported by web browsers and Discord

It should cover:

Where should it be located & linked?

Since these guides aren't specific to getting help, they should probably be added to the Programming Guide under their own page or page group. The How to Get Help page should link the guides as part of outlining how users should get help.

Why should it be added?

tl;dr

  1. The guides will help users get help more effectively
  2. The guides will help users show off their games

I've had trouble finding reliable information on this myself, especially when using Wayland as a display server. For less technical users, this guide will help them get assistance by reducing the number of illegible photos or videos taken via phone.

Cleptomania commented 1 year ago

FYI for Linux I’ve used Flameshot for a long, it’s really powerful for still screenshots(unsure if it works on Wayland or with XWayland), doesn’t cover video recording but is one of the better desktop environment independent tools I’ve used on Linux for screenshots

pushfoo commented 1 year ago

tl;dr Flameshot looks amazing, but their Wayland support is experimental. Gnome/Wayland is the default DE setup on many popular distros. The beginner instructions should recommend something that works with it reliably & is easy to install. EasyScreenCast seems to fit this better than Flameshot.

Given that educational users are still a primary target for arcade, I think we should base our beginner doc around tools that ship with the OS whenever possible (Screenshot toolbar on macOS & Xbox game bar on Windows).

Gnome seems to be the most popular default DE base, but it doesn't ship screen recording tools that can capture a specific window. I think we should aim for the following criteria for the "default" Gnome Linux doc:

  1. Work on Gnome, regardless of display server
  2. Require minimal additional steps to install

Although Flameshot looks amazing, it seems like installation might be tricky for beginners (taken from their project's README.md):

Gnome doesn't treat a stable extension API as a priority, so it is best if we try to minimize the number of extensions involved. We can mention Flameshot for advanced users, but I think EasyScreenCast may be a better beginner default for Wayland+Gnome desktops. It takes only one apt command or GUI action to install, and has been working reliably for me for months.

eschan145 commented 1 year ago

We have a get_image function that takes a screenshot of the screen. It takes x, y, width, and height parameters. It returns a PIL image, which can be saved. An example is demonstrated in the source code.

It is possible to take a screenshot every $x$ frames, and then add it to a list and convert that to a mp4 or other playable video media, though I'm not sure of the performance drop.

einarf commented 1 year ago

It is possible to take a screenshot every frames, and then add it to a list and convert that to a mp4 or other playable video media, though I'm not sure of the performance drop.

It's possible to pipe each frame directly into ffmpeg instead. We don't have a wrapper for this, but it's not too difficult to make.

It definitely has a cost, but you can also fake frame times if you get into performance issues.

pushfoo commented 1 year ago

It is possible to take a screenshot every x frames, and then add it to a list and convert that to a mp4 or other playable video media, though I'm not sure of the performance drop.

It's possible to pipe each frame directly into ffmpeg instead. We don't have a wrapper for this, but it's not too difficult to make.

This is intriguing, but not directly in scope. The goal for this ticket is to make documentation that can help even the least experienced beginners. I created a new ticket to cover expanding the screenshot API: #1342.