Jellyfin

From NixOS Wiki
Revision as of 21:13, 29 May 2022 by imported>Makefu (init)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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
    ];
  };

  # 2. allow jellyfin user to access the graphics card
  users.users.${config.services.jellyfin.user}.extraGroups = [ "video" "render" ];

  # 3. override default hardening measure from NixOS
  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
  services.jellyfin.enable = true;
}

Related: Accelerated_Video_Playback