Jellyfin Forum
Hardware acceleration on freebsd host - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: General Questions (https://forum.jellyfin.org/f-general-questions)
+--- Thread: Hardware acceleration on freebsd host (/t-hardware-acceleration-on-freebsd-host)



Hardware acceleration on freebsd host - ryannathans - 2023-07-12

I am running jellyfin in a jail on freebsd via truenas core plugin.

Just curious on how to enable hardware acceleration?

The wiki only mentions linux/docker/windows https://jellyfin.org/docs/general/administration/hardware-acceleration/

Cheers


RE: Hardware acceleration on freebsd host - slimyshow - 2023-12-09

So I was recently digging around to find out if that was the case myself.

Cavet: This answer will be incomplete, I was unable to verify. I don't currently have hardware transcoding support. I had motherboard problems awhile had to swap out my Supermicro X9/Intel E3-1225 v2 hardware for one I could get my hands on quickly, a Supermicro X10/Intel E3-1220 v3. This series does not have Quick Sync. If memory serves, I think this can be quickly checked by running dmesg | grep QSV for the processor Features= flags line. Otherwise, check Intel Ark for your specific processor.

System:
  - FreeBSD 13.2 (amd64)
  - multimedia/jellyfin 10.8.10_1
  - multimedia/ffmpeg 6.1_1,1

I found the FreeBSD package drops the custom jellyfin-ffmpeg client the wiki refers to in favor of the one in ports.

From what I can tell, that version is compiled with a few hardware transcoding options:


$ ffmpeg -encoders | grep h264
...
V....D libx264              libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (codec h264)
V....D libx264rgb          libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 RGB (codec h264)
V....D h264_nvenc          NVIDIA NVENC H.264 encoder (codec h264)
V..... h264_v4l2m2m        V4L2 mem2mem H.264 encoder wrapper (codec h264)
V....D h264_vaapi          H.264/AVC (VAAPI) (codec h264)



$ ffmpeg -encoders | grep hevc
V....D libx265              libx265 H.265 / HEVC (codec hevc)
V....D hevc_nvenc          NVIDIA NVENC hevc encoder (codec hevc)
V..... hevc_v4l2m2m        V4L2 mem2mem HEVC encoder wrapper (codec hevc)
V....D hevc_vaapi          H.265/HEVC (VAAPI) (codec hevc)


However, Intel Quick Sync is not listed. It appears to be disabled in the build flags as VPL=off in the ports info. Probably worth mentioning MFX=off is also off, but it looks like Intel Media SDK is a dead project so that seems fair. Someone more enterprising than me will need to try rebuilding with VPL=on and adding the necessary dependency on multimedia/onevpl.

When I'm able to upgrade my MOBO, I'll probably come back and update this. But it won't be anytime soon.

I hope this helps!

References:
  - https://stackoverflow.com/a/50703794
  - https://stackoverflow.com/a/73238755
  - https://github.com/kern2011/Freenas-Quicksync
  - https://www.freshports.org/multimedia/ffmpeg/


RE: Hardware acceleration on freebsd host - ascl - 2023-12-13

I've been digging into this, and it should be possible without too much pain -- although I haven't tried it with JellyFin. I'm using TrueNAS core, but still, same should more or less apply, at least for QuickSync.
From a test jail, I see this:

$ ffmpeg -hide_banner -encoders | grep vaapi
V....D h264_vaapi H.264/AVC (VAAPI) (codec h264)
V....D hevc_vaapi H.265/HEVC (VAAPI) (codec hevc)
V....D mjpeg_vaapi MJPEG (VAAPI) (codec mjpeg)
V....D mpeg2_vaapi MPEG-2 (VAAPI) (codec mpeg2video)
V....D vp8_vaapi VP8 (VAAPI) (codec vpNerd-face
V....D vp9_vaapi VP9 (VAAPI) (codec vp9)


which if you follow the instructions here: https://github.com/kern2011/Freenas-Quicksync should get you pretty close. I don't know what needs to happen on the jellyfin side.