Bug 500024

Summary: WEBM encoder hangs and maxes out 1 core when stopping the recording
Product: [Applications] Spectacle Reporter: Tom Oostveen <18gatenmaker6>
Component: GeneralAssignee: Noah Davis <noahadvs>
Status: RESOLVED FIXED    
Severity: major CC: john.kizer, kde
Priority: NOR    
Version First Reported In: 24.12.2   
Target Milestone: ---   
Platform: NixOS   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 6.3.3
Sentry Crash Report:
Attachments: Coredump for spectacle

Description Tom Oostveen 2025-02-13 20:46:29 UTC
Created attachment 178318 [details]
Coredump for spectacle

SUMMARY
When I try to record even the shortest video as a webm file (which is the default) Spectacle hangs for a while, seems to only try to encode after the fact only on a single core. If I make a 2 second video I can get back a result after ~30 seconds...

STEPS TO REPRODUCE
1. Open spectacle
2. Record full screen
3. Stop the recording

OBSERVED RESULT
Spectacle is not responding anymore and it seems like it will never save the file (even though it does after a disproportionally long time). I also get some weird logs (only the ones after stopping the recording):
```
[libvpx-vp9 @ 0x7f83c0652340] v1.15.0
qt.multimedia.ffmpeg.mediadataholder: AVStream duration -9223372036854775808 is invalid. Taking it from the metadata
vaExportSurfaceHandle failed
    failed to get textures for frame; format: 44
```

EXPECTED RESULT
The recording should finish quicker and preferrably asynchronously because blocking the window loop doesn't seem like a good UX.

SOFTWARE/OS VERSIONS
Operating System: NixOS 25.05
KDE Plasma Version: 6.2.5
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.2
Kernel Version: 6.12.12 (64-bit)
Graphics Platform: Wayland
Processors: 12 ร— AMD Ryzen 5 2600 Six-Core Processor
Memory: 15.5 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1050 Ti/PCIe/SSE2

ADDITIONAL INFORMATION
I only received one coredump but this seems unrelated to the issue. Attached anyways.
Comment 1 John Kizer 2025-02-27 05:31:55 UTC
Hi - I can't personally reproduce (a 10 second recording saves in about 3-4 seconds), but I wonder if this is somehow related to https://bugs.kde.org/show_bug.cgi?id=488896 , which is in turn possibly related to https://bugs.kde.org/show_bug.cgi?id=492844

When the video does save, is the result a smooth recording, or one with lots of dropped frames?

Thanks!
Comment 2 Bug Janitor Service 2025-03-14 03:47:04 UTC
๐Ÿ›๐Ÿงน โš ๏ธ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!
Comment 3 Tom Oostveen 2025-03-16 11:28:43 UTC
Whoops, sorry for not responding for a while.

I was using the version from KDE Gear 24.12.2: https://kde.org/info/releases-24.12.2/

But now my distro (nixpkgs) ships the version that's included in KDE Plasma 6.3.3. Now it seems to be fixed. A 10 second video saves within a couple seconds and the video quality can be blocky but definitely cromulent to show what is going on.