Screenshot using cat /dev/fb0?
-
I'm trying to take a full 1920x1080px screenshot of a running RetroArch game, launched from EmulationStation, including a bezel overlay.
I've got RetroPie 4.7.8
Pi 4B 4GB
Full (not fake) KMS (vc4-kms-v3d)I've tried screenshots via the RetroArch options menu, but they don't include the bezel, and I think that they are always square pixels, not scaled as I see on the screen.
What options have I got? Something that I can run using an SSH command would be good.
I've tried raspi2png but that fails
pi@rpi-tv:~ $ raspi2png -p screen.png raspi2png: unable to open display 0
I have taken screenshots outside of an X server before by using
cat /dev/fb0 > screen.fb
and then converting the dump to a .png with
pi@rpi-tv:~ $ ffmpeg -f rawvideo -pixel_format rgb565 -video_size 1920x1080 -i screen.fb screen.png
That creates a valid .png file, but it is of the runcommand "Launching" message, not the running game+bezel.
Can anyone say how to screenshot the whole screen including the bezel?
-
I've learned over at the Raspberry Pi forum that some applications (like X, and it seems RetroArch) can draw on the screen without writing to the framebuffer, so that option's out.
Is there a switch or other config to persuade RetroArch to write to the framebuffer API temporarily? Or other way to get a full screenshot?
-
@busywait said in Screenshot using cat /dev/fb0?:
Is there a switch or other config to persuade RetroArch to write to the framebuffer API temporarily? Or other way to get a full screenshot?
No, RetroArch 'writes' using the MESA OpenGL drivers, which don't use the framebuffer (
/dev/fb0
). Have you tried toggling the 'GPU Screenshot' option in RetroArch ?
Either that or switch to thefkms
driver (soraspi2png
works again). -
@mitu Thx, I checked that GPU Screenshots was enabled, and it doesn't grab the full 1920x1080 screen area...
I checked in the RetroArch RGUI, Settings > Video, and I have GPU screenshots enabled, checked in configs/all/retroarch.cfg and it says
video_gpu_screenshot = "true"
Also I edited configs/all/retroarch.cfg and uncommented
input_screenshot = f8
Pressing the hotkey on my controller and f8 on the keyboard captures a screenshot that gives me a glimpse of my bezel, but it's cropped to the size and location of the game window (which is overscanned and partially masked by the bezel).
I'll find a moment to try rebooting with
dtoverlay=vc4-fkms-v3d
Here's what my "cropped" RetroArch screenshot looked like it - it is stretched to the correct dimensions, 1378x1200px:
-
@mitu I got my screenshot the way you suggested:
- flip back to dtoverlay=vc4-fkms-v3d in /boot/config.txt
- use raspi2png
Thanks!
===
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.