Spectacle not recording windows (inconsistent)

I just realized spectacle isn’t working right. When I try to record a window, it works the first time after I login, and fails every other time. Same for recording the entire screen. But, I can record a rectangular region consistently.

(I just notice that, if I turn off karousel, it works once again, by which I mean one time again. When I re-enable karousel, it again works one time.)

The output from both successful and failed recording attempts starts with a bunch of errors. On successful attempts, I then see the recording taking place, and a couple more errors. On an unsuccessful attempt, it just closes.

Here’s a successful attempt:

spectacle: Unable to load Tesseract candidate "tesseract" : "Cannot load library tesseract: tesseract: cannot open shared object file: No such file or directory"
spectacle: Unable to locate a suitable Tesseract shared library
spectacle: Tesseract runtime library not available
qmlRegisterType requires absolute URLs.
qmlRegisterType requires absolute URLs.
qmlRegisterType requires absolute URLs.
(...)
qmlRegisterType requires absolute URLs.
libva info: VA-API version 1.23.0
libva info: Trying to open /run/opengl-driver/lib/dri/iHD_drv_video.so
libva info: Trying to open /usr/lib/dri/iHD_drv_video.so
libva info: Trying to open /usr/lib32/dri/iHD_drv_video.so
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Trying to open /usr/lib/i386-linux-gnu/dri/iHD_drv_video.so
libva info: va_openDriver() returns -1
libva info: Trying to open /run/opengl-driver/lib/dri/i965_drv_video.so
libva info: Trying to open /usr/lib/dri/i965_drv_video.so
libva info: Trying to open /usr/lib32/dri/i965_drv_video.so
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Trying to open /usr/lib/i386-linux-gnu/dri/i965_drv_video.so
libva info: va_openDriver() returns -1
kpipewire_vaapi_logging: VAAPI: Failed to initialize display
kpipewire_vaapi_logging: DRM device not found
kpipewire_record_logging: Hardware encoding is not supported on this device.
[libx264 @ 0x7faf60067c00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 AVX512
[libx264 @ 0x7faf60067c00] profile Main, level 5.2, 4:2:0, 8-bit
kpipewire_dmabuf_logging: eglChooseConfig returned this many configs: 1
[libx264 @ 0x7faf60067c00] frame I:1     Avg QP:26.42  size: 12198
[libx264 @ 0x7faf60067c00] frame P:7     Avg QP:25.01  size:   120
[libx264 @ 0x7faf60067c00] mb I  I16..4: 74.8%  0.0% 25.2%
[libx264 @ 0x7faf60067c00] mb P  I16..4:  0.7%  0.0%  0.0%  P16..4:  1.0%  0.0%  0.0%  0.0%  0.0%    skip:98.3%
[libx264 @ 0x7faf60067c00] coded y,uvDC,uvAC intra: 21.9% 2.9% 1.9% inter: 0.3% 0.1% 0.0%
[libx264 @ 0x7faf60067c00] i16 v,h,dc,p: 42% 50%  6%  2%
[libx264 @ 0x7faf60067c00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 34% 20% 25%  2%  3%  4%  4%  4%  3%
[libx264 @ 0x7faf60067c00] i8c dc,h,v,p: 92%  4%  4%  0%
[libx264 @ 0x7faf60067c00] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x7faf60067c00] kb/s:11.43
qt.multimedia.ffmpeg: Using Qt multimedia with FFmpeg version 8.0.1 GPL version 3 or later
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/biscotty/Screen/Screencasts/Screencast_20260414_100344.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf62.3.100
  Duration: 00:00:04.65, start: 0.070000, bitrate: 24 kb/s
  Stream #0:0[0x1](und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(progressive), 606x534, 22 kb/s, 1.72 fps, 1.33 tbr, 90k tbn, start 0.070000 (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
[h264 @ 0x55748adba540] Device does not support the VK_KHR_video_decode_queue extension!
[h264 @ 0x55748adba540] Failed setup for format vulkan: hwaccel initialisation returned error.

While a failed attempt, ending in an immediate closure of the program, seems to be the same until it just stops.

❮ spectacle       
spectacle: Unable to load Tesseract candidate "tesseract" : "Cannot load library tesseract: tesseract: cannot open shared object file: No such file or directory"
spectacle: Unable to locate a suitable Tesseract shared library
spectacle: Tesseract runtime library not available
qmlRegisterType requires absolute URLs.
qmlRegisterType requires absolute URLs.
(...)

qmlRegisterType requires absolute URLs.
qmlRegisterType requires absolute URLs.
qmlRegisterType requires absolute URLs.
libva info: VA-API version 1.23.0
libva info: Trying to open /run/opengl-driver/lib/dri/iHD_drv_video.so
libva info: Trying to open /usr/lib/dri/iHD_drv_video.so
libva info: Trying to open /usr/lib32/dri/iHD_drv_video.so
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Trying to open /usr/lib/i386-linux-gnu/dri/iHD_drv_video.so
libva info: va_openDriver() returns -1
libva info: Trying to open /run/opengl-driver/lib/dri/i965_drv_video.so
libva info: Trying to open /usr/lib/dri/i965_drv_video.so
libva info: Trying to open /usr/lib32/dri/i965_drv_video.so
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Trying to open /usr/lib/i386-linux-gnu/dri/i965_drv_video.so
libva info: va_openDriver() returns -1
kpipewire_vaapi_logging: VAAPI: Failed to initialize display
kpipewire_vaapi_logging: DRM device not found

Thanks in advance for any ideas here.

1 Like

Adding pkgs.libva seems to have fixed it, or today’s kde upgrade.

Unfortunately, this is still a problem, though I thought it was working. I seem to be missing some video drivers. Where can I find the drivers it is looking for? This is my graphics config

{ config, lib, pkgs, ... }:
{

  environment.systemPackages = with pkgs; [
    libva
    libva-utils
  ];

  hardware.graphics = {
    enable = true;
  };

  services.xserver.videoDrivers = ["nvidia"];

  hardware.nvidia = {
    modesetting.enable = true;
    open = false;

    nvidiaSettings = true;

    prime = {
      sync.enable = true;
      intelBusId = "PCI:0:2:0";
      nvidiaBusId = "PCI:1:0:0";
    };

  };
}

But the drivers needed aren’t installed.

❯ nix shell nixpkgs#libva-utils -c vainfo
Trying display: wayland
libva info: VA-API version 1.23.0
libva info: Trying to open /run/opengl-driver/lib/dri/iHD_drv_video.so
libva info: Trying to open /usr/lib/dri/iHD_drv_video.so
libva info: Trying to open /usr/lib32/dri/iHD_drv_video.so
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Trying to open /usr/lib/i386-linux-gnu/dri/iHD_drv_video.so
libva info: va_openDriver() returns -1
libva info: Trying to open /run/opengl-driver/lib/dri/i965_drv_video.so
libva info: Trying to open /usr/lib/dri/i965_drv_video.so
libva info: Trying to open /usr/lib32/dri/i965_drv_video.so
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Trying to open /usr/lib/i386-linux-gnu/dri/i965_drv_video.so
libva info: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit
❯ ls /run/opengl-driver/lib/dri          
 apple_dri.so         kms_swrast_dri.so       rcar-du_dri.so
 armada-drm_dri.so    komeda_dri.so           repaper_dri.so
 asahi_dri.so         libdril_dri.so          rockchip_dri.so
 crocus_dri.so        lima_dri.so             rzg2l-du_dri.so
 d3d12_dri.so         mali-dp_dri.so          ssd130x_dri.so
 d3d12_drv_video.so   mcde_dri.so             st7586_dri.so
 etnaviv_dri.so       mediatek_dri.so         st7735r_dri.so
 exynos_dri.so        meson_dri.so            sti_dri.so
 gm12u320_dri.so      mi0283qt_dri.so         stm_dri.so
 hdlcd_dri.so         msm_dri.so              sun4i-drm_dri.so
 hx8357d_dri.so       mxsfb-drm_dri.so        swrast_dri.so
 i915_dri.so          nouveau_dri.so          tegra_dri.so
 ili9163_dri.so       nouveau_drv_video.so    udl_dri.so
 ili9225_dri.so       nvidia_drv_video.so     v3d_dri.so
 ili9341_dri.so       panel-mipi-dbi_dri.so   vc4_dri.so
 ili9486_dri.so       panfrost_dri.so         virtio_gpu_dri.so
 imx-dcss_dri.so      panthor_dri.so          virtio_gpu_drv_video.so
 imx-drm_dri.so       pl111_dri.so            vkms_dri.so
 imx-lcdif_dri.so     r300_dri.so             vmwgfx_dri.so
 ingenic-drm_dri.so   r600_dri.so             zink_dri.so
 iris_dri.so          r600_drv_video.so       zynqmp-dpsub_dri.so
 kgsl_dri.so          radeonsi_dri.so        
 kirin_dri.so         radeonsi_drv_video.so

Thanks in advance.

nvidia doesn’t support va-api, but this doesn’t appear to be the underlying issue.

In theory amdgpu should be being used, which has va-api support baked into the driver, it cannot be disabled. As for nvidia, even the elfarto thing that NixOS for some reason installs by default doesn’t support encoding. Perhaps it’s getting in the way though, and there’s no reason to have it anyway if you have an iGPU. Try:

hardware.nvidia = {
  open = true; # Assuming your GPU isn't 10 years old
  videoAcceleration = false;
};

Yes, you can delete that offload config, you’re using a wayland compositor. Those don’t support X11 configuration, and all the nvidia prime stuff is X11 config - if you want to control KDE’s rendering GPU you need to use KDE configuration.

That said, the combination of it working for a bit and then not makes me believe that this isn’t driver-related at all.

1 Like

Thanks, I’ll try without the video acceleration. The open driver wasn’t working for me a year or so ago, but I realized that it works now, and have switched. I don’t understand what you are referring to here, however:

Cheers

Edit: disabling the video acceleration made no difference :frowning:

Those settings literally do nothing.

Ok, thanks. I got that from the Nixos wiki. Is it irrelevant because I’m using wayland, or because I’m using the free driver?

As to the original issue, I’m going to let it drop for now. Out of curiosity, I tried with kazam, and it froze my computer when I tried to capture a window, and produced a video of a black screen when I tried entire screen capture. OBS, on the other hand, handles everything fine, so I’ll just use that.

I appreciate your help.

Cheers

Wayland. All the prime features are X11 config options.

Yeah, screen capture isn’t very well implemented by many applications. What you’re describing sounds like the telltale result of an X11 application trying to capture wayland.

OBS kinda is the gold standard for capturing video, so, well, if you can just use it, yeah, stick to that.

1 Like

@biscotty, I’ve experienced very similar, too:

1 Like