Jellyfin Forum
SOLVED: Jellyfin in Container - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+--- Thread: SOLVED: Jellyfin in Container (/t-solved-jellyfin-in-container)



Jellyfin in Container - fcs001fcs - 2023-09-18

I have a Terramaster F4-423 NAS that is an Intel Celeron N5095 CPU with integrated GPU (i915) and Terramaster GUI version 5.1.41 which I read is a version of RHEL ("uname -r" results in "5.15.59", which I believe is the Linux Kernal) 

Jellyfin works great but I just cannot get the Hardware Acceleration IntelQuickSync (QSV) working.

I run Jellyfin under a Portainer container and have the Docker Mod "DOCKER_MODS=linuxserver/mods:jellyfin-opencl-intel" included and after extensive google searches, still cannot get the HW Acceleration to work.

It seems the Intel drivers and linked files are setup correctly and running, as far as I can tell, so it should work.

I think I narrowed it down to some permission issues with the "/dev/dri" directory on the host but cannot figure how to get the Jellyfin container set up to allow access to that directory.

Note that Terramaster does not allow a root user but only a "Superuser" with full admin permissions.

The output of "ls -la /dev/dri" is:

Code:
total 0
drwxr-xr-x  3 KJM_SuperUser KJM_SuperUser      100 Sep 17 16:13 .
drwxr-xr-x 17 KJM_SuperUser KJM_SuperUser    4000 Sep 17 16:13 ..
drwxr-xr-x  2 KJM_SuperUser KJM_SuperUser      80 Sep 17 16:13 by-path
crw-rw----  1 KJM_SuperUser video        226,  0 Sep 17 16:13 card0
crw-rw----  1 KJM_SuperUser video        226, 128 Sep 17 16:13 renderD128

How do I allow Jellyfin in a container to use the "video" Group for access to the "renderD128" on the host or is there something else I messed up?

As you can probably tell, I am a beginner with Linux and containers, etc... so any help would be appreciated.

BTW I love Jellyfin, it works fantastic, many thanks to the developers.


RE: Jellyfin in Container - nooobieee - 2023-09-18

Notice the device is 'rw' for group "video". Just map your container user to the same group to give that user permissions.

I use docker and also declare the device to the container in my docker-compose.yml file as such:

devices:
- /dev/dri/renderD128Confused-facedev/dri/renderD128

I just use the stock docker hub image, so don't know anything about DOCKER_MODS


RE: Jellyfin in Container - bitmap - 2023-09-18

Gotta make that declaration a code block or it just thinks you're very meh about your iGPU...

I also tend to add the associated card device (which is card0 if you're using the Intel device and do not have a dGPU on the device...doubtful in a NAS box).

Code:
devices:
    - /dev/dri/renderD128:/dev/dri/renderD128
    - /dev/dri/card0:/dev/dri/card0

Also I'd take a look at the user running Jellyfin and see what groups they're part of, as @nooobieee suggested. Then you can:

Code:
usermod -aG [group1],[group2] [user]

This is important because differernt distros use different groups for device perms. Ubuntu uses video and render. So it would look like this for me (requires sudo, but you'll never copy sudo from me):

Code:
usermod -aG video,render bitmap

You can figure out exactly which version of Linux you're running by using a few different commands, but try:

Code:
cat /etc/os-release

Or:

Code:
lsb_release -a



RE: Jellyfin in Container - fcs001fcs - 2023-09-19

Unfortunately, Terramaster seems to lockdown its version of RHEL a bit and those commands for Linux Version do not work. See result below:

Code:
Using username "KJM_SuperUser".
Authenticating with public key "rsa-key-xxxxxxxx"
Welcome to Tnas!
[KJM_SuperUser@xxxxxxxx ~]# cat /etc/os-release
cat: /etc/os-release: No such file or directory
[KJM_SuperUser@xxxxxxxx~]# lsb_release -a
-bash: lsb_release: command not found

I will try the other suggestions tonight. Thanks.


RE: Jellyfin in Container - fcs001fcs - 2023-09-19

I used the command "usermod -aG [group1],[group2] [user]" to get what I think is the correct user into the "video" group, user is listed in the video group, but no improvement. Transcoding a 4K video to a windows browser causes the CPU to go to approx 50%. I think that is wrong. The steam info is attached.
   

How do I confirm the user for Jellyfin when it is running as a Portainer container; as I suspect that I may be referencing the wrong user. I am using the PUID of the container to determine the user, that may be the wrong thing to do.


RE: Jellyfin in Container - TheDreadPirate - 2023-09-19

50% CPU usage on a N5095 during transcoding sounds about right. Even if you are using the iGPU to do the actual encoding, the CPU still has to compose and feed the iGPU. I can tell you right now that 4K, 50FPS is NOT happening with a CPU transcode on a N5095. Heck, a 1080P transcode is not happening on a N5095. That is definitely an iGPU transcode.


RE: Jellyfin in Container - fcs001fcs - 2023-09-19

@TheDreadPirate

Many Thanks for the education. I did not realize that 4K transcoding took so much CPU even with HWA from the iGPU setup and working. 

I was chasing a ghost, I guess. 

Thanks


RE: Jellyfin in Container - fire_jellyfin - 2023-09-19

To verify HW transcoding is working properly you can open the Jellyfin dashboard in the Jellyfin menu. Go to the advanced section and log-files "logboeken" in Dutch.

If you did wacht a file that needed transcoding you will see log files starting with ffmpeg.transcode-...
Search for the part where it shows what ffmpeg is doing. See my example below. If it states h264_vaapi the HW transcoding is working correctly.

Stream mapping:
  Stream #0:0 -> #0:0 (vp9 (native) -> h264 (h264_vaapi))
  Stream #0:1 -> #0:1 (vorbis (native) -> ac3 (native))


RE: Jellyfin in Container - fcs001fcs - 2023-09-20

(2023-09-19, 08:01 PM)fire_jellyfin Wrote: To verify HW transcoding is working properly you can open the Jellyfin dashboard in the Jellyfin menu. Go to the advanced section and log-files "logboeken" in Dutch.

If you did wacht a file that needed transcoding you will see log files starting with ffmpeg.transcode-...
Search for the part where it shows what ffmpeg is doing. See my example below. If it states h264_vaapi the HW transcoding is working correctly.

Stream mapping:
  Stream #0:0 -> #0:0 (vp9 (native) -> h264 (h264_vaapi))
  Stream #0:1 -> #0:1 (vorbis (native) -> ac3 (native))

Thanks for the advice to confirm, I still had doubts, but it does seem to be working. Below is a 4k video streamed to a Win 11 machine in an Edge video player.

Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> h264 (h264_qsv))
  Stream #0:2 -> #0:1 (eac3 (native) -> aac (libfdk_aac))

Video info from Jellyfin:

Video
Title: 4K HEVC HDR
Codec: HEVC
Profile: Main 10
Level: 150
Resolution: 3840x2160
Aspect ratio: 16:9
Interlaced: No
Framerate: 23.976025
Bitrate: 25603 kbps
Bit depth: 10 bit
Video range: HDR
Video range type: HDR10
Color space: bt2020nc
Color transfer: smpte2084
Color primaries: bt2020
Pixel format: yuv420p10le
Ref frames: 1


RE: Jellyfin in Container - TheDreadPirate - 2023-09-20

(2023-09-20, 07:19 PM)fcs001fcs Wrote: Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> h264 (h264_qsv))
  Stream #0:2 -> #0:1 (eac3 (native) -> aac (libfdk_aac))

Definitely hardware accelerated.  What I highlighted would say "libx264" if it was software transcoding.  But the audio is software transcoding so that contributes to your CPU usage.