Score:3

Screen capture is glitchy on all types of applications

in flag

I was trying to record my screen using the default screen capture app of Ubuntu 22.04 but the captured video is glitchy with many dropped frames to the point that it is unusable.

I tried using OBS Studio but it throws this error after I hit record:

Failed to open NVENC codec: Unknown error occurred

Please check your video drivers are up to date.

I then used Peek which records short GIFs but even this has dropped frames!

I suspect this has to do with Nvidia driver. Last week I disabled secure boot to enable using the driver without signing.

I am currently using the recommended driver: enter image description here

Question: how can I troubleshoot this problem?

Here are my system specs:

        `:+ssssssssssssssssss+:`           ---------------- 
      -+ssssssssssssssssssyyssss+-         OS: Ubuntu 22.04.1 LTS x86_64 
    .ossssssssssssssssssdMMMNysssso.       Host: Nitro AN515-43 V1.12 
   /ssssssssssshdmmNNmmyNMMMMhssssss/      Kernel: 5.15.0-52-generic 
  +ssssssssshmydMMMMMMMNddddyssssssss+     Uptime: 11 mins 
 /sssssssshNMMMyhhyyyyhmNMMMNhssssssss/    Packages: 2219 (dpkg), 7 (flatpak), 24 (snap) 
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   Shell: fish 3.5.1 
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   Resolution: 1920x1080 
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   DE: GNOME 42.5 
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   WM: Mutter 
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   WM Theme: Adwaita 
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   Theme: Yaru-blue-dark [GTK2/3] 
 /sssssssshNMMMyhhyyyyhdNMMMNhssssssss/    Icons: Yaru-blue [GTK2/3] 
  +sssssssssdmydMMMMMMMMddddyssssssss+     Terminal: gnome-terminal 
   /ssssssssssshdmNNNNmyNMMMMhssssss/      CPU: AMD Ryzen 7 3750H with Radeon Vega Mobile Gfx (8) @ 2.300GHz 
    .ossssssssssssssssssdMMMNysssso.       GPU: NVIDIA GeForce GTX 1650 Mobile / Max-Q 
      -+sssssssssssssssssyyyssss+-         GPU: AMD ATI Radeon Vega Series / Radeon Vega Mobile Series 
        `:+ssssssssssssssssss+:`           Memory: 3604MiB / 13920MiB 

UPDATE #1: the problem seems related to the size of the capture window, smaller windows capture smooth video. I believe this further confirms the GPU as the source of the problem.

UPDATE #2: The system is not using the Nvidia GPU. I used nvidia-smi to log GPU stats several times while recording and it is stuck at 2MiB / 4096MiB :

+---------------------------------------------+
| NVIDIA-SMI 520.56.06    Driver Version: 520.56.06    CUDA Version: 11.8     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   50C    P8     1W /  N/A |      2MiB /  4096MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+---------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      2232      G   /usr/bin/gnome-shell                1MiB |
+---------------------------------------------+
Score:2
fo flag

TLDR: I believe this is a gstreamer buffer issue affecting Wayland and GNOME: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5585

Updating gstreamer might fix it if you can't wait for the bug fix to flow through your distro's updates.

More Context: I'm having the same problem. Built in video screen recorder is dropping/not recording entire segments of activity. It is not so much that it is dropping content, but that it seems to stop recording as soon as a dialog box comes up. Doesn't matter if the dialog box is in the same window, another window, etc. Could also be a red-herring. But in general entire segments of content is not recording.

Also reproduced this in Peek as well trying to record to gif.

I have a Lenovo X1 Carbon Gen7 with core i7 and built in Intel HD graphics (no additional drivers needed) so I think its a core Ubuntu issue not necessarily a driver.

vanilla built in drivers on my intel HD system

my system config

Hasan Ali avatar
in flag
What you describe is very similar to what I have. May I ask how can I update gstreamer? I tried installing it but it made no impact.
SherlockHomie avatar
fo flag
Sorry, didn't get back to this but I believe I found a better workaround. I'm not sure if the bug is related to the gstreamer buffer anymore since I got around it with the "Auto-Hide" dock setting. I will plan on filing a bug to highlight this issue.
Hasan Ali avatar
in flag
I can't remember exactly what I did but tinkering with gstreamer solved the problem for me. so gstreamer is responsible for the problem.
Score:2
fo flag

Another workaround option I just ran into via a lucky Google Search. If you disable "Auto-Hide" the dock the screen recording seems to work.

disable "Auto-hide the Dock" for now

How I got here:

  1. I noticed my recording would have these quick "flashes" when I interacted with the dock on playback even though it had stopped recording new action
  2. I google searched for "ubuntu screen record glitchy 22.04" and limited it to results indexed in the last month. This was the first result: https://forums.unrealengine.com/t/unreal-engine-4-editor-viewport-mouse-capture-glitches-with-left-side-auto-hide-dock-on-ubuntu-22-04/682331

So went with some intuition, and low and behold disabling auto-hiding the dock worked!

unreal forum similar issue

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.