Opened 21 months ago
Last modified 6 months ago
#10188 new defect
kmsgrab pixel formats missing DRM_FORMAT_ARGB2101010 and others
Reported by: | jean | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avdevice |
Version: | git-master | Keywords: | kmsgrab pixfmt |
Cc: | jean | Blocked By: | |
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Summary of the bug: When a DRM plane is using certain formats found in modern wayland compositors, kmsgrab will fail to recognize the pixel format and refuse to start.
How to reproduce:
On KDE Plasma wayland 5.26.5:
% sudo ffmpeg -f kmsgrab -i - output.mp4 ffmpeg version N-109841-ge3bbf5c17d Copyright (c) 2000-2023 the FFmpeg developers built with gcc 12.2.1 (GCC) 20230201 ... [kmsgrab @ 0x559fd171b2c0] Framebuffer pixel format 30335241 is not a known supported format.
This was tested on Arch Linux.
The specific pixfmt missing in my case was DRM_FORMAT_ARGB2101010
, though it's possible other formats of this classification (32 bpp format with 10 bits per color and 2 bits of alpha) might also be used and would also need to be added.
Change History (2)
comment:1 by , 7 months ago
comment:2 by , 6 months ago
It looks like that format 30334241
is DRM format DRM_FORMAT_ABGR2101010
. Although missing the 0x
prefix, the number is actually in hexadecimal, and not in decimal as it may suggest.
The following 32bpp-RGB DRM formats are missing:
DRM_FORMAT_XBGR2101010
DRM_FORMAT_RGBX1010102
DRM_FORMAT_BGRX1010102
DRM_FORMAT_ARGB2101010
DRM_FORMAT_ABGR2101010
DRM_FORMAT_RGBA1010102
DRM_FORMAT_BGRA1010102
Among these formats, DRM_FORMAT_ARGB2101010
and DRM_FORMAT_ABGR2101010
seems to be more common, and they are also the ones informed here in the user commands above. A patch was proposed in 2019 for adding them, but it was rejected.
But it looks like the solution is not so simple as just adding these formats. VAAPI/libva/Mesa also needs to support them, and it appears the support is equally missing there. An issue is opened in the libva repository requesting them since 2019, without any answer from upstream. There seems to be some complexity involved, and the problem is also discussed in ticket #8542, being described there as not being a ffmpeg bug in the current situation.
DRM format
30334241
is also missing.The command bellow fails in Wayland and runs fine under X11: