Jellyfin: Difference between revisions

From NixOS Wiki
imported>Justinas
No edit summary
imported>Makefu
add remark for 22.05
Line 32: Line 32:


   # 2. allow jellyfin user to access the graphics card
   # 2. allow jellyfin user to access the graphics card
   users.users.${config.services.jellyfin.user}.extraGroups = [ "video" "render" ];
   systemd.services.jellyfin.serviceConfig.PrivateDevices = lib.mkForce false;
  systemd.services.jellyfin.serviceConfig.SupplementaryGroups = [ "video" "render" ];


   # 3. override default hardening measure from NixOS
   # 3. override default hardening measure from NixOS - this is default since 22.05
   systemd.services.jellyfin.serviceConfig.PrivateDevices = lib.mkForce false;
   systemd.services.jellyfin.serviceConfig.PrivateDevices = lib.mkForce false;
  systemd.services.jellyfin.serviceConfig.DeviceAllow = lib.mkForce [ "/dev/dri/renderD128" ];


   # 4. do not forget to enable jellyfin
   # 4. do not forget to enable jellyfin

Revision as of 21:07, 17 June 2022

Jellyfin is the volunteer-built media solution that puts you in control of your media. Stream to any device from your own server, with no strings attached.

Usage

services.jellyfin.enable = true;

Hardware Transcoding

In most cases you want to make most of your hardware. Modern boards often come with Hardware Accelerators, all you need to do is enable it!

Source: https://jellyfin.org/docs/general/administration/hardware-acceleration.html

VAAPI

VAAPI is often available on intel boards (Intel HD).

{ pkgs, lib,config, ... }:
{
  # 1. enable vaapi on OS-level
  nixpkgs.config.packageOverrides = pkgs: {
    vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
  };
  hardware.opengl = {
    enable = true;
    extraPackages = with pkgs; [
      intel-media-driver
      vaapiIntel
      vaapiVdpau
      libvdpau-va-gl
      intel-compute-runtime # OpenCL filter support (hardware tonemapping and subtitle burn-in)
    ];
  };

  # 2. allow jellyfin user to access the graphics card
  systemd.services.jellyfin.serviceConfig.PrivateDevices = lib.mkForce false;
  systemd.services.jellyfin.serviceConfig.SupplementaryGroups = [ "video" "render" ];

  # 3. override default hardening measure from NixOS - this is default since 22.05
  systemd.services.jellyfin.serviceConfig.PrivateDevices = lib.mkForce false;

  # 4. do not forget to enable jellyfin
  services.jellyfin.enable = true;
}

Related: Accelerated_Video_Playback