SeaDve / Kooha

Elegantly record your screen
GNU General Public License v3.0
2.61k stars 70 forks source link

Screen recording freezes once entering a full-screen program #270

Open Raxelgrande opened 9 months ago

Raxelgrande commented 9 months ago

Affected version

I was using Matroska and recording at 30 FPS.

Bug summary Screen recording freezes once you enter a full-screen program. It also tries to sporadically work again, as it manages to record like half a second of footage before freezing again. I tried to record Minecraft and Touhou, both failed. But recording Celluloid on full screen and windowed programs (including those two games) worked perfectly. It might be related to XWayland and full-screen, as both games were running under it and Celluloid was running natively on Wayland. I checked using "xwininfo" to know that Minecraft and Touhou were running on XWayland

Steps to reproduce Launch Minecraft 1.8.9 or Touhou 6 to 19 and try to record in full-screen.

Expected behavior That everything is captured perfectly

Relevant logs, screenshots, screencasts, etc. Video encoded using Handbrake as GitHub doesn't support MKV. Debug text is the one produced by the video attached. Kooha-Debug-Pepi.txt

https://github.com/SeaDve/Kooha/assets/93939943/fed4210b-3d15-4dd1-a687-b5ee83736a9c

SeaDve commented 8 months ago

Thanks for reporting! I actually can reproduce this too. As a workaround, I record the window of the app directly, instead of the monitor. I am not sure if the bug is coming from pipewire or mutter.

SeaDve commented 8 months ago

This is one of the hardest bugs to fix, it is like a schrodinger bug: it is there until you observe it. Specifically, it is only reproducible when recording the video directly to a file, replacing filesink with decodebin ! xvimagesink makes the bug cease to exist.

SeaDve commented 8 months ago

Here are two videos recorded with exactly the same pipeline (the muxer output from the main pipeline is tee-d to a decoder + xvimagesink and the other end is to a filesink whose output is these videos).

The first video is where the xvimagesink window is visible. Everything is smooth, no freezes.

xvimagesink-visible.webm

But if the xvimagesink window is not visible. The game in fullscreen freezes.

xvimagesink-not-visible.webm

maaarghk commented 7 months ago

I just experienced this whilst ironically trying to take a video to demonstrate another bug (in Kicad). It is not full screen but it uses accelerated graphics, so maybe your issue is more to do with that. I previously had the same issue when trying to take a screen recording of virt-manager displaying a SPICE session. that said I believe this screen recording stops before kicad displays any accelerated graphics and before I even mouse over into it (see the location of the text cursor on the last recorded frame)

Hyprland v0.38

output_comp.webm

matytyma commented 6 months ago

I experience the same, although it's not related to just full-screen apps, all seem to be affected. The timer keeps going, everything looks OK but when I view the video it's stuck since then. Running Arch Linux.

JerryDELUXE commented 4 months ago

Happened to me twice when I tried to record footage of Half-Life. Both times it recorded the first frame and then it froze the recording. I lost an hour worth of footage.

JerryDELUXE commented 3 months ago

I just experienced this whilst ironically trying to take a video to demonstrate another bug (in Kicad). It is not full screen but it uses accelerated graphics, so maybe your issue is more to do with that. I previously had the same issue when trying to take a screen recording of virt-manager displaying a SPICE session. that said I believe this screen recording stops before kicad displays any accelerated graphics and before I even mouse over into it (see the location of the text cursor on the last recorded frame)

Hyprland v0.38 output_comp.webm

I'm pretty sure it's not related to graphics acceleration, at least not completely. Since both times when I recorded the gameplay in Half-Life I used software rendering instead of OpenGL, which doesn't utilize any GPU, integrated or not. Although note that I'm no programming expert, so this information could very well be wrong.