Jellyfin NVIDIA Hardware Decoding issues on TrueNAS Scale 24.10.2. - mmatt - 2025-02-10
Okay… I’ve installed Jellyfin through the TrueNAS community app, I’ve edited my user_config.yml to include the right UUID for the GPU. And I’ve enabled hardware decoding in the Jellyfin dashboard. But when it tries to transcode to a lower bitrate, it crashes the player and spits out a generic ffmpeg error. I’ve looked at literally everything and I still have no clue.
Code: 2025-02-10 19:47:38.391578+00:00[13:47:38] [INF] [30] Jellyfin.Api.Helpers.MediaInfoHelper: User policy for matt2. EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True
2025-02-10 19:47:38.417877+00:00[13:47:38] [INF] [29] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: Deleting partial stream file(s) /cache/transcodes/2e065d0d545eff6ea99357c006406a54.m3u8
2025-02-10 19:47:38.834765+00:00[13:47:38] [INF] [34] Jellyfin.Api.Controllers.DynamicHlsController: Current HLS implementation doesn't support non-keyframe breaks but one is requested, ignoring that request
2025-02-10 19:47:38.835465+00:00[13:47:38] [INF] [34] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: /usr/lib/jellyfin-ffmpeg/ffmpeg -analyzeduration 200M -probesize 1G -f matroska -init_hw_device cuda=cu:0 -filter_hw_device cu -hwaccel cuda -hwaccel_output_format cuda -noautorotate -hwaccel_flags +unsafe_output -threads 1 -i file:"/mnt/media/Movies/Queer (2024)/Queer.2024.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR.H.265-FLUX.mkv" -noautoscale -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 hevc_nvenc -tag:v:0 hvc1 -preset p1 -b:v 7616000 -maxrate 7616000 -bufsize 15232000 -profile:v:0 main -g:v:0 72 -keyint_min:v:0 72 -vf "setparams=color_primaries=bt2020:color_trc=smpte2084:colorspace=bt2020nc,scale_cuda=w=2560:h=1382,tonemap_cuda=format=yuv420p:p=bt709:t=bt709:m=bt709:tonemap=bt2390:peak=100:desat=0" -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 "689f9da97b8441b5e26b4d01cd1287a8-1.mp4" -start_number 0 -hls_segment_filename "/cache/transcodes/689f9da97b8441b5e26b4d01cd1287a8%d.mp4" -hls_playlist_type vod -hls_list_size 0 -y "/cache/transcodes/689f9da97b8441b5e26b4d01cd1287a8.m3u8"
2025-02-10 19:47:38.888950+00:00[13:47:38] [ERR] [29] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: FFmpeg exited with code 255
2025-02-10 19:47:38.988660+00:00[13:47:38] [ERR] [29] Jellyfin.Api.Middleware.ExceptionMiddleware: Error processing request. URL GET /videos/5bca925e-bc02-51cb-ae70-d9a4ce220bc1/hls1/main/-1.mp4.
2025-02-10 19:47:38.988768+00:00MediaBrowser.Common.FfmpegException: FFmpeg exited with code 255
2025-02-10 19:47:38.988829+00:00at MediaBrowser.MediaEncoding.Transcoding.TranscodeManager.StartFfMpeg(StreamState state, String outputPath, String commandLineArguments, Guid userId, TranscodingJobType transcodingJobType, CancellationTokenSource cancellationTokenSource, String workingDirectory)
2025-02-10 19:47:38.988883+00:00at Jellyfin.Api.Controllers.DynamicHlsController.GetDynamicSegment(StreamingRequestDto streamingRequest, Int32 segmentId)
2025-02-10 19:47:38.988938+00:00at Jellyfin.Api.Controllers.DynamicHlsController.GetHlsVideoSegment(Guid itemId, String playlistId, Int32 segmentId, String container, Int64 runtimeTicks, Int64 actualSegmentLengthTicks, Nullable`1 static, String params, String tag, String deviceProfileId, String playSessionId, String segmentContainer, Nullable`1 segmentLength, Nullable`1 minSegments, String mediaSourceId, String deviceId, String audioCodec, Nullable`1 enableAutoStreamCopy, Nullable`1 allowVideoStreamCopy, Nullable`1 allowAudioStreamCopy, Nullable`1 breakOnNonKeyFrames, Nullable`1 audioSampleRate, Nullable`1 maxAudioBitDepth, Nullable`1 audioBitRate, Nullable`1 audioChannels, Nullable`1 maxAudioChannels, String profile, String level, Nullable`1 framerate, Nullable`1 maxFramerate, Nullable`1 copyTimestamps, Nullable`1 startTimeTicks, Nullable`1 width, Nullable`1 height, Nullable`1 maxWidth, Nullable`1 maxHeight, Nullable`1 videoBitRate, Nullable`1 subtitleStreamIndex, Nullable`1 subtitleMethod, Nullable`1 maxRefFrames, Nullable`1 maxVideoBitDepth, Nullable`1 requireAvc, Nullable`1 deInterlace, Nullable`1 requireNonAnamorphic, Nullable`1 transcodingMaxAudioChannels, Nullable`1 cpuCoreLimit, String liveStreamId, Nullable`1 enableMpegtsM2TsMode, String videoCodec, String subtitleCodec, String transcodeReasons, Nullable`1 audioStreamIndex, Nullable`1 videoStreamIndex, Nullable`1 context, Dictionary`2 streamOptions, Boolean enableAudioVbrEncoding, Boolean alwaysBurnInSubtitleWhenTranscoding)
2025-02-10 19:47:38.989023+00:00at lambda_method1029(Closure, Object)
2025-02-10 19:47:38.989073+00:00at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
2025-02-10 19:47:38.989146+00:00at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
2025-02-10 19:47:38.989172+00:00at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
2025-02-10 19:47:38.989197+00:00at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
2025-02-10 19:47:38.989209+00:00at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
2025-02-10 19:47:38.989221+00:00at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
2025-02-10 19:47:38.989233+00:00at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
2025-02-10 19:47:38.989246+00:00at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
2025-02-10 19:47:38.989258+00:00at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
2025-02-10 19:47:38.989269+00:00at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
2025-02-10 19:47:38.989279+00:00at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
2025-02-10 19:47:38.989300+00:00at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
2025-02-10 19:47:38.989307+00:00at Jellyfin.Api.Middleware.ServerStartupMessageMiddleware.Invoke(HttpContext httpContext, IServerApplicationHost serverApplicationHost, ILocalizationManager localizationManager)
2025-02-10 19:47:38.989314+00:00at Jellyfin.Api.Middleware.WebSocketHandlerMiddleware.Invoke(HttpContext httpContext, IWebSocketManager webSocketManager)
2025-02-10 19:47:38.989320+00:00at Jellyfin.Api.Middleware.IPBasedAccessValidationMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager)
2025-02-10 19:47:38.989327+00:00at Jellyfin.Api.Middleware.LanFilteringMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager, IServerConfigurationManager serverConfigurationManager)
2025-02-10 19:47:38.989333+00:00at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
2025-02-10 19:47:38.989339+00:00at Jellyfin.Api.Middleware.QueryStringDecodingMiddleware.Invoke(HttpContext httpContext)
2025-02-10 19:47:38.989346+00:00at Swashbuckle.AspNetCore.ReDoc.ReDocMiddleware.Invoke(HttpContext httpContext)
2025-02-10 19:47:38.989352+00:00at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
2025-02-10 19:47:38.989358+00:00at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
2025-02-10 19:47:38.989365+00:00at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
2025-02-10 19:47:38.989371+00:00at Jellyfin.Api.Middleware.RobotsRedirectionMiddleware.Invoke(HttpContext httpContext)
2025-02-10 19:47:38.989390+00:00at Jellyfin.Api.Middleware.LegacyEmbyRouteRewriteMiddleware.Invoke(HttpContext httpContext)
2025-02-10 19:47:38.989397+00:00at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context)
2025-02-10 19:47:38.989417+00:00at Jellyfin.Api.Middleware.ResponseTimeMiddleware.Invoke(HttpContext context, IServerConfigurationManager serverConfigurationManager)
2025-02-10 19:47:38.989424+00:00at Jellyfin.Api.Middleware.ExceptionMiddleware.Invoke(HttpContext context)
2025-02-10 19:47:39.077551+00:00[13:47:39] [INF] [34] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: Deleting partial stream file(s) /cache/transcodes/689f9da97b8441b5e26b4d01cd1287a8.m3u8
2025-02-10 19:47:40.576082+00:00[13:47:40] [INF] [29] Emby.Server.Implementations.Session.SessionManager: Playback stopped reported by app Jellyfin Web 10.10.5 playing Queer. Stopped at 0 ms
RE: Jellyfin NVIDIA Hardware Decoding issues on TrueNAS Scale 24.10.2. - Efficient_Good_5784 - 2025-02-10
Can you please share the jellyfin ffmpeg logs generated after the crash?
Please share them using a site like pastebin.com
Would you also be able to share the yaml file you used just in case?
As for using an Nvidia GPU on Truenas Scale, read this too: https://jellyfin.org/docs/general/installation/truenas#nvidia-gpus-on-scale-v2410
RE: Jellyfin NVIDIA Hardware Decoding issues on TrueNAS Scale 24.10.2. - mmatt - 2025-02-10
(2025-02-10, 08:12 PM)Efficient_Good_5784 Wrote: Can you please share the jellyfin ffmpeg logs generated after the crash?
Please share them using a site like pastebin.com
Where can I find these logs. The only logs I can access (as far as I'm aware) is Jellyfin's container logs.
(2025-02-10, 08:12 PM)Efficient_Good_5784 Wrote: Would you also be able to share the yaml file you used just in case?
Do you mean the docker compose yaml? I don't have that, but its whatever is included in the community app on TrueNAS scale.
Here's my environment variables:
Code: DEBIAN_FRONTEND noninteractive
GID 568
GROUP_ID 568
HEALTHCHECK_URL http://localhost:8096/health
JELLYFIN_CACHE_DIR /cache
JELLYFIN_CONFIG_DIR /config/config
JELLYFIN_DATA_DIR /config
JELLYFIN_FFMPEG /usr/lib/jellyfin-ffmpeg/ffmpeg
JELLYFIN_LOG_DIR /config/log
JELLYFIN_WEB_DIR /jellyfin/jellyfin-web
LANG en_US.UTF-8
LANGUAGE en_US:en
LC_ALL en_US.UTF-8
MALLOC_TRIM_THRESHOLD_ 131072
NVIDIA_DRIVER_CAPABILITIES compute,video,utility
NVIDIA_VISIBLE_DEVICES void
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PGID 568
PUID 568
TZ America/Chicago
UID 568
UMASK 002
UMASK_SET 002
USER_ID 568
XDG_CACHE_HOME /cache
And the image: Code: jellyfin/jellyfin:10.10.5@sha256:633bf191731d77354e329a67704409bdecefb7397d99fc30d4a814c0720a1271
(2025-02-10, 08:12 PM)Efficient_Good_5784 Wrote: As for using an Nvidia GPU on Truenas Scale, read this too: https://jellyfin.org/docs/general/installation/truenas#nvidia-gpus-on-scale-v2410
I have already read this, and it is not related.
RE: Jellyfin NVIDIA Hardware Decoding issues on TrueNAS Scale 24.10.2. - Efficient_Good_5784 - 2025-02-11
You would find the ffmpeg logs located in the Jellyfin dashboard under the log section.
You can click on any of the logs and it will open on a new browser window.
Just copy the ffmpeg logs of the failed stream and share them with us.
RE: Jellyfin NVIDIA Hardware Decoding issues on TrueNAS Scale 24.10.2. - mmatt - 2025-02-11
(2025-02-11, 01:01 AM)Efficient_Good_5784 Wrote: You would find the ffmpeg logs located in the Jellyfin dashboard under the log section.
You can click on any of the logs and it will open on a new browser window.
Just copy the ffmpeg logs of the failed stream and share them with us.
Thanks, here you are: https://matt.paste.lol/ffmpeg.transcode-2025-02-10_13-47-38_5bca925ebc0251cbae70d9a4ce220bc1_22a5c019.log/raw
RE: Jellyfin NVIDIA Hardware Decoding issues on TrueNAS Scale 24.10.2. - Efficient_Good_5784 - 2025-02-11
The issue is that the container doesn't have access to the Nvidia GPU drivers.
Code: [AVHWDeviceContext @ 0x55ac4704b180] Cannot load libcuda.so.1
[AVHWDeviceContext @ 0x55ac4704b180] Could not dynamically load CUDA
Device creation failed: -1.
Failed to set value 'cuda=cu:0' for option 'init_hw_device': Operation not permitted
Error parsing global options: Operation not permitted
You need to figure out how to pass that into the container.
You also need to double check if you did the steps outlined in the Truenas release notes to install the Nvidia drivers (as they are not included by default anymore).
If you can't figure that out, you need to go ask for help on how to do so on the Truenas forums: https://forums.truenas.com/
RE: Jellyfin NVIDIA Hardware Decoding issues on TrueNAS Scale 24.10.2. - mmatt - 2025-02-11
Okay... I just had to reinstall the app. I feel silly now.
Basically I had installed Jellyfin before I installed the NVIDIA drivers. I installed the NVIDIA drivers and restarted the App Service. And yeah, the old app couldn't access the drivers I suppose.
|