Gpu-screen-recorder: Difference between revisions

From NixOS Wiki
(I created this page as a documentation for one of the best Linux recording software. As a beginner, I encountered an issue with the `libvndiai-fbc.so` library being missing, so I provided some troubleshooting steps to fix it.)
 
(→‎Troubleshooting: Typo 'the')
Line 29: Line 29:


# Make sure your [[Nvidia|drivers]] are installed.
# Make sure your [[Nvidia|drivers]] are installed.
# Install missing the NVENC patch for your card.  [https://github.com/icewind1991/nvidia-patch-nixos nvidia-patch] is a great overlay which you can use  
# Install the missing the NVENC patch for your card.  [https://github.com/icewind1991/nvidia-patch-nixos nvidia-patch] is a great overlay which you can use  
# Override the package build inputs and add the library to the wrapper.<syntaxhighlight lang="nix">
# Override the package build inputs and add the library to the wrapper.<syntaxhighlight lang="nix">
     (gpu-screen-recorder.overrideAttrs (oldAttrs: rec {
     (gpu-screen-recorder.overrideAttrs (oldAttrs: rec {

Revision as of 22:08, 16 April 2024

gpu-screen-recorder is a screen recorder that has minimal impact on system performance by recording your monitor using the GPU only, similar to shadowplay on windows. It is the fastest screen recording tool for Linux.

Supported codecs

Video
  • H264 (default on Intel)
  • HEVC (default on AMD and NVIDIA)
  • AV1
Audio
  • Opus (default)
  • AAC
  • FLAC

Installation

  environment.systemPackages = with pkgs; [
    gpu-screen-recorder # CLI
    gpu-screen-recorder-gtk # GUI
  ];

Troubleshooting

libnvidia-fbc.so.1: cannot open shared object file: No such file or directory

The possibility of this error arising exists if you possess an NVIDIA graphics card, as the package does not include the NVIDIA X11 libraries in its wrapper by default.

  1. Make sure your drivers are installed.
  2. Install the missing the NVENC patch for your card. nvidia-patch is a great overlay which you can use
  3. Override the package build inputs and add the library to the wrapper.
        (gpu-screen-recorder.overrideAttrs (oldAttrs: rec {
          buildInputs = with pkgs; [
            xorg.libXcomposite
            libpulseaudio
            ffmpeg
            wayland
            libdrm
            libva
            xorg.libXrandr
            linuxKernel.packages.linux_xanmod_stable.nvidia_x11
          ];
          postInstall = ''
            install -Dt $out/bin gpu-screen-recorder gsr-kms-server
            mkdir $out/bin/.wrapped
            mv $out/bin/gpu-screen-recorder $out/bin/.wrapped/
            makeWrapper "$out/bin/.wrapped/gpu-screen-recorder" "$out/bin/gpu-screen-recorder" \
            --prefix LD_LIBRARY_PATH : ${pkgs.libglvnd}/lib \
            --prefix LD_LIBRARY_PATH : ${pkgs.linuxKernel.packages.linux_xanmod_stable.nvidia_x11}/lib \
            --prefix PATH : $out/bin
          '';
        }))