Self-hosted Jellyfin CPU or GPU for 4K HDR transcoding?
Hey everyone, I'm building a new server to run Jellyfin (with a few other services like Pi-hole) and I'm stuck on GPU or CPU transcoding.
My main concern is smooth 4K HDR transcoding for 1 stream. I've been reading mixed advice online – some people say a strong CPU with good single-core performance can handle it, while others recommend a dedicated GPU.
Should I focus my budget (~$1000AUD/$658USD) on a good CPU, or spend some of it on a dedicated GPU?
You can easily do smooth 4K HDR transcoding with any modern Intel CPU with integrated graphics.
I have an Intel N100 and it can probably handle 2-3 4K HDR transcodes at once. Definitely more if they're being transcoded down to lower resolutions. Encoding is the most intensive part of the process.
While de N100 is a great value and low energy processor for a jellyfin server (especially if you direct play everything as is my case), I think if the objective is 4k hdr 10bit it will fall short as in my experience it usually transcodes at 8-9fps.
I use QSV hardware acceleration with Low Power h264 and HEVC encoders enabled, plus VPP tonemapping on Jellyfin. I have Prefer OS Native DXVA or VA-API decoders checked (apparently this is needed for VPP tonemapping) and also Enable Tone mapping checked so it can fallback onto OpenCL if VPP doesn't work. Thread count set to Auto. Preset is set to medium. h265 encoding CRF of 25, h264 encoding CRF of 23 and I have Throttle transcodes enabled, which seems to increase the number of videos I can have transcoding at once due to not transcoding more than necessary whenever a player has enough buffer for the moment.
This is on the latest Jellyfin linuxserver.io container with the OpenCL-Intel docker mod.
Also, not sure if this is a factor but I've got 16 GB of single channel RAM on it and I use a USB-mounted SSD for my cache and transcode folders. In the past I ran into bandwidth issues by having my transcodes be on the same drive as my media.
I get 4K HDR to 4K SDR tonemapping plus 7.1 Dolby TrueHD to 2.0 AAC transcoding at 70-75fps with my setup.
Transcoding of 4K down to lower resolutions is even faster. 4K HDR to 480p SDR runs at 191fps.
I took a look at the benchmark script those results are from and compared them to the ffmpeg commands auto-generated by my Jellyfin server for actual transcodes.
Here's how the command to transcode a 4K HDR 10 bit HEVC with 7.1 AAC audio to 4K SDR h264 with 2.0 AAC audio looks on my machine:
So I'm gonna go out on a limb and say there's a major difference in configuration between the two. Setting global_quality to 18 is kind of absurdly high quality for hardware h265 encoding. You can easily get away with 28 for "good enough". My setting of 25 for the CRF of h265 encoding is already edging into placebo territory for most videos. That's all without considering the impact of low power mode, extra_hw_frames, etc.
Yeah after seeing this and another very detail answer it looks line my settings are too demanding and that is causing a slowdown. Since i do direct playing on everything i might just turn them down for the one friend who seems to be always on the weirdest player that needs transcoding. Thanks all!!