Bug 493586 - When recording video, the mouse pointer motion is not properly recorded leading to jerky movements
Summary: When recording video, the mouse pointer motion is not properly recorded leadi...
Status: RESOLVED DUPLICATE of bug 477788
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: git-master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Noah Davis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-24 13:39 UTC by Sebastian Parborg
Modified: 2024-11-19 20:20 UTC (History)
2 users (show)

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


Attachments
Video showcasing the jerky mouse movement issue (417.96 KB, video/mp4)
2024-09-24 13:39 UTC, Sebastian Parborg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Parborg 2024-09-24 13:39:23 UTC
Created attachment 174027 [details]
Video showcasing the jerky mouse movement issue

SUMMARY

When recording video in Spectacle, it seems like the mouse position is not properly updated and frames are dropped if the rest of the content of the captured screen is drawn. (Starts to happen around 3 seconds into the video)

If you force redraw, of the captured region, it seems like the mouse position is updated.
In the attached example video, I'm using Blender and first moving the cursor in a circle, notice that the mouse position seemingly freezes and then jumps to where I actually moved it a few moments later.

This even more obvious later when I'm drawing in Blender. You can see how the cursor position in the video stops updating after certain stokes and then teleports to the the actual mouse position when I start the next stroke.

STEPS TO REPRODUCE
1. Capture a rectangular region on the desktop.
2. Move the mouse around without interacting with any windows
3. Notice that the captured mouse movement in the video is not captured correctly.

OBSERVED RESULT
A lot of video frames with mouse movement in them has been dropped.

EXPECTED RESULT
The video should contain smooth and accurate mouse movements that matches the actual mouse movements during recording.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:  Gentoo Linux
KDE Plasma Version:  6.1.5
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.2
Comment 1 Sebastian Parborg 2024-09-24 13:49:36 UTC
I think this might be an issue with how spectacle captures video with variable framerate.

As the cursor is added in post, I'm guessing that there are simply no frame being produced when the mouse starts to lag.
IE if nothing besides the mouse is changing on the screen there will be no frame updates. 

You can see this with the attached video file by stepping on a per frame basis in the file ("." and "," in mpv).
When the mouse seemingly freeze, there are no frames between it and where the mouse teleports to next.

I think the easily solution here is to not use variable frame rate when capturing (at least not when capturing with the mouse).
Sadly I didn't find out how to do that as the pipewire API seems to kinda cryptic so I couldn't figure out how to change it.
Comment 2 Filip 2024-11-19 20:20:20 UTC
*** This bug has been marked as a duplicate of bug 477788 ***