Yesterday, 07:40 PM
(This post was last modified: Yesterday, 07:51 PM by bbradley. Edited 2 times in total.)
Hi,
I am working on migrating away from Plex, and in the process of testing my setup. One hangup I have is that Jellyfin seems to need about twice the CPU resources when transcoding compared to Plex, and I am wondering if there is something I am missing.
Maybe I am missing some setting to tweak the performance. Any thoughts? Any logs that would be useful?
Here are the logs from a random playback session
I am working on migrating away from Plex, and in the process of testing my setup. One hangup I have is that Jellyfin seems to need about twice the CPU resources when transcoding compared to Plex, and I am wondering if there is something I am missing.
- I am using the linuxserver docker image for both services. I have installed the linuxserver dockermod to support OpenCL for HDR tone mapping.
- I have enabled hardware transcoding of course, and enabled all relevant settings (I believe) for my CPU (Intel i5 13500 (Alder Lake))
- I am testing by forcing transcoding on a 4k video (4K HDR10 HEVC Main 10 down to 720kbps for the test) with HDR tone mapping
- Jellyfin is using 15-20% CPU to do it (uses 60% when software decoding, so hardware acceleration definitely working), and Plex barely uses more than idle (5-7%)
- Both are transcoding audio (direct streaming)
- I am not including subtitles
- Both are played on web player in Chrome
Maybe I am missing some setting to tweak the performance. Any thoughts? Any logs that would be useful?
Here are the logs from a random playback session
Code:
[14:15:23] [INF] [21] Jellyfin.Api.Controllers.DynamicHlsController: Current HLS implementation doesn't support non-keyframe breaks but one is requested, ignoring that request
[14:15:23] [INF] [21] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: /usr/lib/jellyfin-ffmpeg/ffmpeg -analyzeduration 200M -probesize 1G -f matroska -init_hw_device vaapi=va:/dev/dri/renderD128,driver=iHD -init_hw_device qsv=qs@va -init_hw_device opencl=ocl@va -filter_hw_device qs -hwaccel vaapi -hwaccel_output_format vaapi -noautorotate -i file:"/data/movies/Oppenheimer (2023) {imdb-tt15398776}/Oppenheimer (2023) {imdb-tt15398776} [Remux-2160p][PQ][DTS-HD MA 5.1][HEVC]-GHD.mkv" -noautoscale -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 hevc_qsv -tag:v:0 hvc1 -low_power 1 -preset veryfast -b:v 336000 -maxrate 336000 -bufsize 672000 -profile:v:0 main -level 50 -g:v:0 72 -keyint_min:v:0 72 -vf "setparams=color_primaries=bt2020:color_trc=smpte2084:colorspace=bt2020nc,scale_vaapi=w=960:h=540:extra_hw_frames=24,hwmap=derive_device=opencl:mode=read,tonemap_opencl=format=nv12:p=bt709:t=bt709:m=bt709:tonemap=bt2390:peak=100:desat=0,hwmap=derive_device=qsv:mode=write:reverse=1:extra_hw_frames=16,format=qsv" -codec:a:0 libfdk_aac -ac 2 -ab 256000 -af "volume=2" -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 3 -hls_segment_type fmp4 -hls_fmp4_init_filename "54cf77258ba7d5b94255a7b409edb8ac-1.mp4" -start_number 0 -hls_segment_filename "/config/cache/transcodes/54cf77258ba7d5b94255a7b409edb8ac%d.mp4" -hls_playlist_type vod -hls_list_size 0 -y "/config/cache/transcodes/54cf77258ba7d5b94255a7b409edb8ac.m3u8"
[14:15:32] [INF] [20] MediaBrowser.Controller.MediaEncoding.TranscodingJob: Stopping ffmpeg process with q command for /config/cache/transcodes/54cf77258ba7d5b94255a7b409edb8ac.m3u8
[14:15:32] [INF] [20] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: FFmpeg exited with code 0
[14:15:32] [INF] [20] Jellyfin.Api.Controllers.DynamicHlsController: Current HLS implementation doesn't support non-keyframe breaks but one is requested, ignoring that request
[14:15:32] [INF] [20] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: /usr/lib/jellyfin-ffmpeg/ffmpeg -analyzeduration 200M -probesize 1G -ss 00:21:27.000 -noaccurate_seek -f matroska -init_hw_device vaapi=va:/dev/dri/renderD128,driver=iHD -init_hw_device qsv=qs@va -init_hw_device opencl=ocl@va -filter_hw_device qs -hwaccel vaapi -hwaccel_output_format vaapi -noautorotate -i file:"/data/movies/Oppenheimer (2023) {imdb-tt15398776}/Oppenheimer (2023) {imdb-tt15398776} [Remux-2160p][PQ][DTS-HD MA 5.1][HEVC]-GHD.mkv" -noautoscale -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 hevc_qsv -tag:v:0 hvc1 -low_power 1 -preset veryfast -b:v 336000 -maxrate 336000 -bufsize 672000 -profile:v:0 main -level 50 -g:v:0 72 -keyint_min:v:0 72 -vf "setparams=color_primaries=bt2020:color_trc=smpte2084:colorspace=bt2020nc,scale_vaapi=w=960:h=540:extra_hw_frames=24,hwmap=derive_device=opencl:mode=read,tonemap_opencl=format=nv12:p=bt709:t=bt709:m=bt709:tonemap=bt2390:peak=100:desat=0,hwmap=derive_device=qsv:mode=write:reverse=1:extra_hw_frames=16,format=qsv" -codec:a:0 libfdk_aac -ac 2 -ab 256000 -af "volume=2" -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 3 -hls_segment_type fmp4 -hls_fmp4_init_filename "54cf77258ba7d5b94255a7b409edb8ac-1.mp4" -start_number 429 -hls_segment_filename "/config/cache/transcodes/54cf77258ba7d5b94255a7b409edb8ac%d.mp4" -hls_playlist_type vod -hls_list_size 0 -y "/config/cache/transcodes/54cf77258ba7d5b94255a7b409edb8ac.m3u8"
[14:17:22] [INF] [19] MediaBrowser.Controller.MediaEncoding.TranscodingJob: Stopping ffmpeg process with q command for /config/cache/transcodes/54cf77258ba7d5b94255a7b409edb8ac.m3u8
[14:17:22] [INF] [19] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: FFmpeg exited with code 0
[14:17:22] [INF] [19] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: Deleting partial stream file(s) /config/cache/transcodes/54cf77258ba7d5b94255a7b409edb8ac.m3u8
[14:17:23] [INF] [24] Emby.Server.Implementations.Session.SessionManager: Playback stopped reported by app Jellyfin Web 10.10.3 playing Oppenheimer. Stopped at 1397760 ms