All series fail to play #183

Open
opened 2025-06-04 20:36:15 +00:00 by fast-asleep · 2 comments
fast-asleep commented 2025-06-04 20:36:15 +00:00 (Migrated from github.com)

Describe the bug
When trying to watch a series using the VOD feature, all episodes on every series instantly fails with "Playback failed due to a fatal player error."

The series are correctly displayed, and movies work fine.

Relevant Jellyfin logs:

[2025-06-04 16:22:44.012 -04:00] [INF] [116] Jellyfin.Api.Helpers.MediaInfoHelper: User policy for "username". EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True
[2025-06-04 16:22:44.093 -04:00] [INF] [116] Jellyfin.Api.Controllers.DynamicHlsController: Current HLS implementation doesn't support non-keyframe breaks but one is requested, ignoring that request
[2025-06-04 16:22:44.094 -04:00] [ERR] [116] Jellyfin.Api.Middleware.ExceptionMiddleware: Error processing request. URL "GET" "/videos/35ecda42-0acb-6da4-52d4-0801b8697c02/live.m3u8".
System.InvalidOperationException: Nullable object must have a value.
   at System.Nullable`1.get_Value()
   at MediaBrowser.Controller.MediaEncoding.EncodingHelper.GetHwScaleFilter(String hwScalePrefix, String hwScaleSuffix, String videoFormat, Boolean swapOutputWandH, Nullable`1 videoWidth, Nullable`1 videoHeight, Nullable`1 requestedWidth, Nullable`1 requestedHeight, Nullable`1 requestedMaxWidth, Nullable`1 requestedMaxHeight)
   at MediaBrowser.Controller.MediaEncoding.EncodingHelper.GetNvidiaVidFiltersPrefered(EncodingJobInfo state, EncodingOptions options, String vidDecoder, String vidEncoder)
   at MediaBrowser.Controller.MediaEncoding.EncodingHelper.GetNvidiaVidFilterChain(EncodingJobInfo state, EncodingOptions options, String vidEncoder)
   at MediaBrowser.Controller.MediaEncoding.EncodingHelper.GetVideoProcessingFilterParam(EncodingJobInfo state, EncodingOptions options, String outputVideoCodec)
   at Jellyfin.Api.Controllers.DynamicHlsController.GetVideoArguments(StreamState state, Int32 startNumber, Boolean isEventPlaylist, String segmentContainer)
   at Jellyfin.Api.Controllers.DynamicHlsController.GetCommandLineArguments(String outputPath, StreamState state, Boolean isEventPlaylist, Int32 startNumber)
   at Jellyfin.Api.Controllers.DynamicHlsController.GetLiveHlsStream(Guid itemId, String container, 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 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, Nullable`1 maxWidth, Nullable`1 maxHeight, Nullable`1 enableSubtitlesInManifest, Boolean enableAudioVbrEncoding, Boolean alwaysBurnInSubtitleWhenTranscoding)
   at lambda_method1489(Closure, Object)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Jellyfin.Api.Middleware.ServerStartupMessageMiddleware.Invoke(HttpContext httpContext, IServerApplicationHost serverApplicationHost, ILocalizationManager localizationManager)
   at Jellyfin.Api.Middleware.WebSocketHandlerMiddleware.Invoke(HttpContext httpContext, IWebSocketManager webSocketManager)
   at Jellyfin.Api.Middleware.IPBasedAccessValidationMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager)
   at Jellyfin.Api.Middleware.LanFilteringMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager, IServerConfigurationManager serverConfigurationManager)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Jellyfin.Api.Middleware.QueryStringDecodingMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.ReDoc.ReDocMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Jellyfin.Api.Middleware.RobotsRedirectionMiddleware.Invoke(HttpContext httpContext)
   at Jellyfin.Api.Middleware.LegacyEmbyRouteRewriteMiddleware.Invoke(HttpContext httpContext)
   at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context)
   at Jellyfin.Api.Middleware.ResponseTimeMiddleware.Invoke(HttpContext context, IServerConfigurationManager serverConfigurationManager)
   at Jellyfin.Api.Middleware.ExceptionMiddleware.Invoke(HttpContext context)

To Reproduce
Steps to reproduce the behavior:

  1. Go to Xtream Series
  2. Go to any series and season
  3. Click an episode
  4. See error

Expected behavior
I should be able to watch the series.

Software stack
Plugin version: 0.7.1.0
Server version: 10.10.7

Tested clients:

  • Web browser version: 10.10.7

Additional context
They work on Tivimate.

**Describe the bug** When trying to watch a series using the VOD feature, all episodes on every series instantly fails with "Playback failed due to a fatal player error." The series are correctly displayed, and movies work fine. <details> <summary>Relevant Jellyfin logs:</summary> <pre><code> [2025-06-04 16:22:44.012 -04:00] [INF] [116] Jellyfin.Api.Helpers.MediaInfoHelper: User policy for "username". EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True [2025-06-04 16:22:44.093 -04:00] [INF] [116] Jellyfin.Api.Controllers.DynamicHlsController: Current HLS implementation doesn't support non-keyframe breaks but one is requested, ignoring that request [2025-06-04 16:22:44.094 -04:00] [ERR] [116] Jellyfin.Api.Middleware.ExceptionMiddleware: Error processing request. URL "GET" "/videos/35ecda42-0acb-6da4-52d4-0801b8697c02/live.m3u8". System.InvalidOperationException: Nullable object must have a value. at System.Nullable`1.get_Value() at MediaBrowser.Controller.MediaEncoding.EncodingHelper.GetHwScaleFilter(String hwScalePrefix, String hwScaleSuffix, String videoFormat, Boolean swapOutputWandH, Nullable`1 videoWidth, Nullable`1 videoHeight, Nullable`1 requestedWidth, Nullable`1 requestedHeight, Nullable`1 requestedMaxWidth, Nullable`1 requestedMaxHeight) at MediaBrowser.Controller.MediaEncoding.EncodingHelper.GetNvidiaVidFiltersPrefered(EncodingJobInfo state, EncodingOptions options, String vidDecoder, String vidEncoder) at MediaBrowser.Controller.MediaEncoding.EncodingHelper.GetNvidiaVidFilterChain(EncodingJobInfo state, EncodingOptions options, String vidEncoder) at MediaBrowser.Controller.MediaEncoding.EncodingHelper.GetVideoProcessingFilterParam(EncodingJobInfo state, EncodingOptions options, String outputVideoCodec) at Jellyfin.Api.Controllers.DynamicHlsController.GetVideoArguments(StreamState state, Int32 startNumber, Boolean isEventPlaylist, String segmentContainer) at Jellyfin.Api.Controllers.DynamicHlsController.GetCommandLineArguments(String outputPath, StreamState state, Boolean isEventPlaylist, Int32 startNumber) at Jellyfin.Api.Controllers.DynamicHlsController.GetLiveHlsStream(Guid itemId, String container, 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 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, Nullable`1 maxWidth, Nullable`1 maxHeight, Nullable`1 enableSubtitlesInManifest, Boolean enableAudioVbrEncoding, Boolean alwaysBurnInSubtitleWhenTranscoding) at lambda_method1489(Closure, Object) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) at Jellyfin.Api.Middleware.ServerStartupMessageMiddleware.Invoke(HttpContext httpContext, IServerApplicationHost serverApplicationHost, ILocalizationManager localizationManager) at Jellyfin.Api.Middleware.WebSocketHandlerMiddleware.Invoke(HttpContext httpContext, IWebSocketManager webSocketManager) at Jellyfin.Api.Middleware.IPBasedAccessValidationMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager) at Jellyfin.Api.Middleware.LanFilteringMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager, IServerConfigurationManager serverConfigurationManager) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Jellyfin.Api.Middleware.QueryStringDecodingMiddleware.Invoke(HttpContext httpContext) at Swashbuckle.AspNetCore.ReDoc.ReDocMiddleware.Invoke(HttpContext httpContext) at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext) at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Jellyfin.Api.Middleware.RobotsRedirectionMiddleware.Invoke(HttpContext httpContext) at Jellyfin.Api.Middleware.LegacyEmbyRouteRewriteMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context) at Jellyfin.Api.Middleware.ResponseTimeMiddleware.Invoke(HttpContext context, IServerConfigurationManager serverConfigurationManager) at Jellyfin.Api.Middleware.ExceptionMiddleware.Invoke(HttpContext context) </pre></code> </details> **To Reproduce** Steps to reproduce the behavior: 1. Go to Xtream Series 2. Go to any series and season 3. Click an episode 4. See error **Expected behavior** I should be able to watch the series. **Software stack** Plugin version: 0.7.1.0 Server version: 10.10.7 Tested clients: - [x] Web browser version: 10.10.7 **Additional context** They work on Tivimate.
Kevinjil commented 2025-06-09 12:41:26 +00:00 (Migrated from github.com)

This seems to be a NVIDIA-specific transcoding error. Does transcoding work with other content and/or does streaming working when you disable the NVIDIA HW transcoding?

This seems to be a NVIDIA-specific transcoding error. Does transcoding work with other content and/or does streaming working when you disable the NVIDIA HW transcoding?
binaryninja commented 2025-07-08 14:57:43 +00:00 (Migrated from github.com)

I'll provide a little extra context that may help push this along. This issue only occurs when NVIDIA HW trans-coding is enabled.

Symptom:

  • Any HLS request that forces the NVENC/VA-API/QSV “scale” filter can trigger the condition
    System.InvalidOperationException: Nullable object must have a value
    at MediaBrowser.Controller.MediaEncoding.EncodingHelper.GetHwScaleFilter(...)

Repro recipe

  1. Add / play a source whose videoWidth/videoHeight are NULL in VideoStream.
  • IPTV / Xtream VOD where the first segment probe times out/
  • Corrupt / exotic / custom container with no width–height in header
  1. Make sure hardware transcoding is enabled and the profile requests scaling, e.g.browser limits to 720 p
    “Max width” set in client profile

  2. Hit play → server throws above InvalidOperationException, client sees “Playback error”.


The issue is in the GetHwScaleFilter method in /jellyfin-packaging/jellyfin-server/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs.

Root Cause Analysis

  1. Line 2947-2949: The problematic code is:
var isSizeFixed = !videoWidth.HasValue
    || outWidth.Value != videoWidth.Value
    || !videoHeight.HasValue
    || outHeight.Value != videoHeight.Value;
  1. Line 2951: Then this result is used in:
var arg1 = isSizeFixed ? ("=w=" + outWidth.Value + ":h=" + outHeight.Value) : string.Empty;

The Problem

The bug occurs when:

  • videoWidth and/or videoHeight are null
  • GetFixedOutputSize returns (null, null) when both videoWidth and requestedWidth are null
  • The code then tries to access outWidth.Value or outHeight.Value on line 2951, which throws InvalidOperationException when the nullable has no value

Possible Fix

The method should check if outWidth and outHeight have values before accessing them:

if (!outWidth.HasValue || !outHeight.HasValue)
{
    return string.Empty;
}
var arg1 = isSizeFixed ? ("=w=" + outWidth.Value + ":h=" + outHeight.Value) : string.Empty;

6 · Temporary work-arounds for users

  • Disable “Hardware encoding" (Confirmed working but I hope you've got mad cores!)
  • Pre-scan files (or patch Xtream plugin) so VideoStream.Width/Height are non-null (possibly easier than setting up a jellyfin build env and patching...)

If this doesn't get picked up and solved and other people are having the same issues I may come back to this when I have time.

I'll provide a little extra context that may help push this along. This issue only occurs when NVIDIA HW trans-coding is enabled. Symptom: - Any HLS request that forces the NVENC/VA-API/QSV “scale” filter can trigger the condition System.InvalidOperationException: Nullable object must have a value at MediaBrowser.Controller.MediaEncoding.EncodingHelper.GetHwScaleFilter(...) Repro recipe 1. Add / play a source whose videoWidth/videoHeight are NULL in VideoStream. - IPTV / Xtream VOD where the first segment probe times out/ - Corrupt / exotic / custom container with no width–height in header 2. Make sure hardware transcoding is enabled and the profile requests scaling, e.g.browser limits to 720 p “Max width” set in client profile 3. Hit play → server throws above InvalidOperationException, client sees “Playback error”. -------- The issue is in the `GetHwScaleFilter` method in `/jellyfin-packaging/jellyfin-server/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs`. ### **Root Cause Analysis** 1. **Line 2947-2949**: The problematic code is: ```jellyfin-packaging/jellyfin-server/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs#L2947-2949 var isSizeFixed = !videoWidth.HasValue || outWidth.Value != videoWidth.Value || !videoHeight.HasValue || outHeight.Value != videoHeight.Value; ``` 2. **Line 2951**: Then this result is used in: ```jellyfin-packaging/jellyfin-server/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs#L2951 var arg1 = isSizeFixed ? ("=w=" + outWidth.Value + ":h=" + outHeight.Value) : string.Empty; ``` ### **The Problem** The bug occurs when: - `videoWidth` and/or `videoHeight` are null - `GetFixedOutputSize` returns `(null, null)` when both `videoWidth` and `requestedWidth` are null - The code then tries to access `outWidth.Value` or `outHeight.Value` on line 2951, which throws `InvalidOperationException` when the nullable has no value ### **Possible Fix** The method should check if `outWidth` and `outHeight` have values before accessing them: ```jellyfin-packaging/jellyfin-server/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs#L2951 if (!outWidth.HasValue || !outHeight.HasValue) { return string.Empty; } var arg1 = isSizeFixed ? ("=w=" + outWidth.Value + ":h=" + outHeight.Value) : string.Empty; ``` 6 · Temporary work-arounds for users - Disable “Hardware encoding" (Confirmed working but I hope you've got mad cores!) - Pre-scan files (or patch Xtream plugin) so VideoStream.Width/Height are non-null (possibly easier than setting up a jellyfin build env and patching...) If this doesn't get picked up and solved and other people are having the same issues I may come back to this when I have time.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Sirherobrine23/Jellyfin_Xtream#183
No description provided.