Jellyfin: Difference between revisions

VAAPI and Intel QSV: add Arc GPU instructions
Klinger (talk | contribs)
m Link, intro now changed from commercial to information, added category Web Applications
 
(8 intermediate revisions by 5 users not shown)
Line 1: Line 1:
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.
[https://jellyfin.org/ Jellyfin] is an open source media server (Jellyfin Server) with several clients (Jellyfin Media Player and web client).


== Installation and configuration ==
== Installation and configuration ==
Line 54: Line 54:
</syntaxhighlight>
</syntaxhighlight>


If you have changed the user option after you have already installed Jellyfin, you have to change the ownership of the folder /var/lib/jellyfin to the user you set it to by doing this:
If you have changed the user option after you have already installed Jellyfin, you have to change the ownership of the folder `/var/lib/jellyfin` to the user you set it to by doing this:
<syntaxhighlight lang="nix">
 
   sudo chown -R /var/lib/jellyfin  
<syntaxhighlight lang="bash">
   sudo chown -R yourusername:yourusername /var/lib/jellyfin
</syntaxhighlight>
 
Additionally, you should also change the ownership of the cache directory to avoid transcoding issues:
 
<syntaxhighlight lang="bash">
  sudo chown -R yourusername:yourusername /var/cache/jellyfin
</syntaxhighlight>
 
Finally, restart Jellyfin for the changes to take effect:
 
<syntaxhighlight lang="bash">
  systemctl restart jellyfin
</syntaxhighlight>
</syntaxhighlight>


Line 96: Line 109:
VAAPI and QSV is often available on platforms with Intel GPUs but need their corresponding packages in <code>hardware.graphics.extraPackages</code>.
VAAPI and QSV is often available on platforms with Intel GPUs but need their corresponding packages in <code>hardware.graphics.extraPackages</code>.


<syntaxHighlight lang=nix>
You have to choose between <code>intel-vaapi-driver</code> (old driver for pre-Broadwell CPUs) and <code>intel-media-driver</code> depending of your CPU.
 
<syntaxhighlight lang="nix">
{ pkgs, lib,config, ... }:
{ pkgs, lib,config, ... }:
{
{
   # 1. enable vaapi on OS-level
   # 1. enable vaapi on OS-level
   nixpkgs.config.packageOverrides = pkgs: {
   nixpkgs.config.packageOverrides = pkgs: {
     vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
     # Only set this if using intel-vaapi-driver
    intel-vaapi-driver = pkgs.intel-vaapi-driver.override { enableHybridCodec = true; };
   };
   };
  systemd.services.jellyfin.environment.LIBVA_DRIVER_NAME = "iHD"; # Or "i965" if using older driver
  environment.sessionVariables = { LIBVA_DRIVER_NAME = "iHD"; };      # Same here
   hardware.graphics = {
   hardware.graphics = {
     enable = true;
     enable = true;
     extraPackages = with pkgs; [
     extraPackages = with pkgs; [
       intel-media-driver
       intel-media-driver # For Broadwell (2014) or newer processors. LIBVA_DRIVER_NAME=iHD
       intel-vaapi-driver
       intel-vaapi-driver # For older processors. LIBVA_DRIVER_NAME=i965
       vaapiVdpau
       libva-vdpau-driver # Previously vaapiVdpau
       intel-compute-runtime # OpenCL filter support (hardware tonemapping and subtitle burn-in)
       intel-compute-runtime # OpenCL filter support (hardware tonemapping and subtitle burn-in)
      # OpenCL support for intel CPUs before 12th gen
      # see: https://github.com/NixOS/nixpkgs/issues/356535
      intel-compute-runtime-legacy1
       vpl-gpu-rt # QSV on 11th gen or newer
       vpl-gpu-rt # QSV on 11th gen or newer
       intel-media-sdk # QSV up to 11th gen
       intel-media-sdk # QSV up to 11th gen
      intel-ocl # OpenCL support
     ];
     ];
   };
   };
Line 118: Line 140:
   services.jellyfin.enable = true;
   services.jellyfin.enable = true;
}
}
</syntaxHighlight>
</syntaxhighlight>
 
==== Troubleshooting VAAPI and Intel QSV ====
You can check supported vaapi profile supported by your CPU / driver with : <code>nix-shell -p libva-utils --run vainfo</code>. If
 
You can check the OpenCL properties and devices available on the system with : <code>nix-shell -p clinfo --run clinfo</code>. If clinfo shows <code>Number of platforms 0</code> on the first line, OpenCL is not enabled or available.
 
The command <code>intel_gpu_top</code>, provided by the <code>intel-gpu-tools</code> package is also useful to check the status of your intel GPU: <code>nix-shell -p intel-gpu-tools --run intel_gpu_top</code>.
 
At least on Intel N100 CPU, you will need the option <code>hardware.enableAllFirmware = true;</code> otherwise GuC formware will not load properly. Here is the type of error you will get without it : <syntaxhighlight lang="dmesg">
[    4.174843] i915 0000:00:10.0: [drm] *ERROR* GT0: GuC firmware i915/tgl_guc_70.bin: fetch failed -ENOENT
[    4.175621] i915 0000:00:10.0: [drm] GT0: GuC firmware(s) can be downloaded from https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/i915
[    4.176286] i915 0000:00:10.0: [drm] GT0: GuC firmware i915/tgl_guc_70.bin version 0.0.0
[    4.176350] i915 0000:00:10.0: [drm] *ERROR* GT0: GuC initialization failed -ENOENT
[    4.176977] i915 0000:00:10.0: [drm] *ERROR* GT0: Enabling uc failed (-5)
[    4.177502] i915 0000:00:10.0: [drm] *ERROR* GT0: Failed to initialize GPU, declaring it wedged!
</syntaxhighlight>
 
==== VAAPI and Intel QSV on Arc GPU ====
 


If you want to use an Arc GPU for transcoding, you may need to override the ffmpeg version used by jellyfin to ensure that it is compiled with <code>vpl</code> and, potentially, <code>unfree</code>. An example to achieve this through [[Overlays|an overlay]]:<syntaxhighlight lang="nix">
If you want to use an Arc GPU for transcoding, you may need to override the ffmpeg version used by jellyfin to ensure that it is compiled with <code>vpl</code> and, potentially, <code>unfree</code>. An example to achieve this through [[Overlays|an overlay]]:<syntaxhighlight lang="nix">
Line 149: Line 190:
[[Category:Server]]
[[Category:Server]]
[[Category:Applications]]
[[Category:Applications]]
[[Category:Web Applications]]