Sample Header Ad - 728x90

How to record screen when using eglfs on Broadcom VideoCore IV

0 votes
0 answers
601 views
I have a full-screen Qt app running on a Raspberry Pi 3 using the "eglfs" platform. It draws using KMS/DRM and the /dev/dri/core0 GPU device. The GPU is a Broadcom VideoCore IV. I'd like to record the screen and have not been successful. The closest I've got is: 1. Using ffmpeg and the kmsgrab input device. Unfortunately ffmpeg -f kmsgrab -i - -vf 'hwdownload,format=bgr0' output.mp4 produces garbled video, as shown below. Garbled output from ffmpeg 2. Redirect Qt to the framebuffer. For example: ./my_app -platform linuxfb:fb=/dev/fb0. Then the more straight-forward ffmpeg -f fbdev -i /dev/fb0 output.mp4 works. Unfortunately linuxfb does not render features from Qt5Compat.GraphicalEffects such as layer.effect, so my buttons do not show. Given the garbled output from ffmpeg seems so close, I've tried passing various format_modifier's from [drm_fourcc.h](https://elixir.bootlin.com/linux/latest/source/include/uapi/drm/drm_fourcc.h#L380) but have not seen any difference. Surely there's a set of hwmap or format_modifier flags that will ensure the output resembles what appears on screen? For reference I'm using kernel version 5.4.83-v8 and dtoverlay=vc4-fkms-v3d. I could adjust those things if I thought it would make any difference.
Asked by Heath Raftery (1652 rep)
Mar 29, 2022, 04:32 AM
Last activity: Mar 29, 2022, 05:09 AM