https://bugs.kde.org/show_bug.cgi?id=470440

            Bug ID: 470440
           Summary: ffmpeg screen capture with kmsgrab and vaapi either
                    fails or gives corrupt video on kwin wayland
    Classification: Plasma
           Product: kwin
           Version: 5.27.5
          Platform: Archlinux
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: egl
          Assignee: kwin-bugs-n...@kde.org
          Reporter: vasish...@gmail.com
  Target Milestone: ---

SUMMARY
On Intel UHD 620 (8th gen KBL-R), when using KDE with wayland backend, the
default DRM color format is ARGB2101010 (30-bit). When trying to use kmsgrab
with ffmpeg in this mode, it results in the error "drm format not supported by
vaapi" since there is no match in vaapi for this drm format. On specifying
KWIN_DRM_PREFER_COLOR_DEPTH=24 in /etc/environment, the DRM format changes to
ARGB8888 (24-bit), this makes the ffmpeg kmsgrab successful but the output
video is garbled. 

This works completely fine on Kwin X11 and GNOME wayland, the only difference I
could find was that in both these cases, the color format was XRGB8888.

Here is the ffmpeg command I am running:

ffmpeg -device /dev/dri/card0 -f kmsgrab -framerate 60 -i - -vf
'hwmap=derive_device=vaapi,scale_vaapi=w=1920:h=1080:format=nv12' -c:v
hevc_vaapi output.mkv

I have tried using h264_vaapi, vp8_vaapi codecs also, the result is same.

STEPS TO REPRODUCE
1. Login to Plasma wayland with KWIN_DRM_PREFER_COLOR_DEPTH=24
2. Record screen with ffmpeg kmsgrab using vaapi.

OBSERVED RESULT

Video output is grabled

EXPECTED RESULT

Normal screen capture

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 6.3.4-zen1-1-zen (64-bit)/5.27.5
(available in About System)
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.106.0
Qt Version: 5.15.9

ADDITIONAL INFORMATION
Mesa version: 23.2.0-devel (git-613eb64011)
ffmpeg version: 6.0

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to