Bug 483397

Summary: After upgrading to Plasma 6, corrupt output when recording full screen; works fine when recording a rectangle selection
Product: [Plasma] xdg-desktop-portal-kde Reporter: Adam Fontenot <adam.m.fontenot+kde>
Component: generalAssignee: Plasma Bugs List <plasma-bugs-null>
Status: REPORTED ---    
Severity: normal CC: aleixpol, jgrulich, nate
Priority: NOR Keywords: qt6
Version First Reported In: 6.0.1   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: screenshot of the screen recording showing the issue

Description Adam Fontenot 2024-03-13 03:14:59 UTC
Created attachment 167079 [details]
screenshot of the screen recording showing the issue

SUMMARY

This is reproducible using screen recording apps like Kooha, and also with simple scripts that may help narrow down the issue, like this one: https://gitlab.gnome.org/-/snippets/19

Tested on 6.0.1 because of Arch version, but 6.0.2 (latest release) doesn't have anything in the changelog that seems relevant.

STEPS TO REPRODUCE
1. Open e.g. Kooha, and select to record the full screen. The portal "Screen Sharing" window will appear.
2. Select the checkbox on "Laptop screen" (or something else appropriate to recording whole screen in your case).
3. Uncheck "Allow restoring on future sessions" - I haven't checked if this makes a difference.
4. Click share and record a few seconds of video, then stop.

OBSERVED RESULT

Garbage output, see screenshot. Repeating the reproduction steps but choosing a rectangular region works fine.

EXPECTED RESULT

Working output

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.0.1
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Kernel Version: 6.7.9-arch1-1 (64-bit)
Graphics Platform: Wayland
Comment 1 Nate Graham 2024-03-13 17:55:22 UTC
Cannot reproduce at 225% scale on Wayland; a full-screen recording in Kooha succeeds for me. I'm using a 10th gen Intel HD620 iGPU; what's your graphics hardware look like?
Comment 2 Adam Fontenot 2024-03-13 18:14:07 UTC
Integrated AMDGPU on mobile Ryzen 5000 series. 1:1 scale at 1080p on my built-in laptop screen.

Broken hardware encoding of the video is not a possible cause - this is x264 encoded video with both Kooha and the Gstreamer script. Incidentally, the little tiny preview of the screen in the Screen Sharing portal window looks normal.

I wonder if there's any reason the portal would provide the video stream in a different format when selecting the whole screen. Perhaps the internal pipeline for the video changes the format slightly when cropping to a rectangular screen area, avoiding an issue with Gstreamer-based recording on my system.
Comment 3 Adam Fontenot 2024-03-14 13:25:52 UTC
I'm not able to reproduce this with a new user account, even when I copy over my .config and .local. There's probably some other configuration I'm missing somewhere. I'm going to keep trying to figure out the cause. This is a pretty new computer that was only on Plasma 5 for about a month, and has always had an very vanilla configuration.