Bug 477788 - Spectacle's recordings of mouse movement are not smooth
Summary: Spectacle's recordings of mouse movement are not smooth
Status: REPORTED
Alias: None
Product: KPipeWire
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: qt6
: 493586 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-11-30 18:46 UTC by Patrick Silva
Modified: 2025-03-17 19:00 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
video recorded with OBS Studio (3.85 MB, video/x-matroska)
2023-12-17 12:56 UTC, Patrick Silva
Details
video recorded with Spectacle (286.11 KB, video/webm)
2023-12-17 12:56 UTC, Patrick Silva
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2023-11-30 18:46:05 UTC
STEPS TO REPRODUCE
1. use Wayland
2. open Spectacle
3. click on "Recording" tab and then on "Full screen" button
4. move the mouse pointer repeatedly for a few seconds while the screen is recorded
5. finish the screen recording
6.  watch the recorded video

OBSERVED RESULT
mouse pointer is barely visible while moved in the recorded video, as if some frames had been dropped while the screen was recorded.

EXPECTED RESULT
mouse pointer is well visible while moved in the recorded video

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.90.0
KDE Frameworks Version: 5.246.0
Qt Version: 6.6.1
Kernel Version: 6.6.3-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 4 × Intel® Core™ i5-4670K CPU @ 3.40GHz
Memory: 15,5 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 4600
Comment 1 Noah Davis 2023-12-14 16:02:24 UTC
Could you post a sample file? I could not reproduce this issue.
Comment 2 Patrick Silva 2023-12-17 12:56:32 UTC
Created attachment 164247 [details]
video recorded with OBS Studio
Comment 3 Patrick Silva 2023-12-17 12:56:54 UTC
Created attachment 164248 [details]
video recorded with Spectacle
Comment 4 Noah Davis 2023-12-17 13:36:16 UTC
OK, so this is a frame drop issue. The cursor itself is not barely visible. Does the lack of smoothness only affect the cursor or does it affect other moving content too? Does the lack of smoothness happen when recording without the cursor?
Comment 5 Patrick Silva 2023-12-17 13:51:36 UTC
The animations lightly stutter in the recorded video, windows are moved smoothly. Animations are smooth if the mouse pointer is not recorded.
Comment 6 Filip 2024-11-19 20:20:20 UTC
*** Bug 493586 has been marked as a duplicate of this bug. ***
Comment 7 Nate Graham 2025-03-07 14:41:14 UTC
*** This bug has been marked as a duplicate of bug 488896 ***
Comment 8 Sebastian Parborg 2025-03-07 15:18:52 UTC
@Nate I don't think this is a duplicate as I have this issue regardless of which codec I use.

The issue is that spectacle is using variable framerate so if the capture (kpipewire) deems that there has been no screen updates, not new frames will be sent.

However this doesn't take into account the mouse cursor. So all the mouse movement that doesn't occur while the underlying content is updated will be dropped. This is very noticable in Blender for example (like in my bug report: https://bugs.kde.org/show_bug.cgi?id=493586)
Comment 9 Nate Graham 2025-03-11 20:43:56 UTC
Hmm, so you think it's a KPipeWire issue, but a different one?
Comment 10 Sebastian Parborg 2025-03-15 10:08:33 UTC
I don't think the issue I'm experiencing is related to the codec, yes.

From looking at and debugging the code, it seems like KPipeWire doesn't send any updates when the mouse moves and there is no damage/updates reported after the previous frame.

So Spectacle simply doesn't get any new information about where the mouse is currently unless a new frame is sent from KPipeWire as well.
I first thought we would work around this by having Spectacle query the mouse position at a fixed rate, but from what I could tell, the mouse position data is tied to the frame that Kpipewire sends. So if there is no new frame data, no new mouse position data is available.