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:
Using
ffmpegand thekmsgrabinput device. Unfortunatelyffmpeg -f kmsgrab -i - -vf 'hwdownload,format=bgr0' output.mp4produces garbled video, as shown below.Redirect Qt to the framebuffer. For example:
./my_app -platform linuxfb:fb=/dev/fb0. Then the more straight-forwardffmpeg -f fbdev -i /dev/fb0 output.mp4works. Unfortunatelylinuxfbdoes not render features fromQt5Compat.GraphicalEffectssuch aslayer.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 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.

jkqxzin #ffmpeg on IRC kindly identified the distortion as likely to be the Broadcom VC4 "T" format tiling,DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED. Alas, we still don't have a way to decode it. Thehwdownloadfilter can only deal with linear (as documented), theuntilevideo filter does not help, and attempts to use thevulkandevice forhwmapresult in "Failed to created derived device context: -12. ... Cannot allocate memory".config.json({"device": "/dev/dri/card0","outputs": [{"name": "DSI","format": "xrgb2101010"}]}) and launching the app withQT_QPA_EGLFS_KMS_CONFIG=config.json. I couldn't detect any difference.