jellyfin / jellyfin

The Free Software Media System
https://jellyfin.org
GNU General Public License v2.0
33.06k stars 3.02k forks source link

[Issue]: 'Invalid argument' when transcoding some files #11107

Closed chazzawarner closed 5 months ago

chazzawarner commented 5 months ago

Please describe your bug

Whenever I try to play some files, I get the error: "Playback Error - This client isn't compatible with the media and the server isn't sending a compatible media format." I have two shows I have downloaded so far and I can't play any episodes in Jellyfin but I can in VLC media player. However, I can play Big Buck Bunny (which I downloaded to set up hardware-accelerated transcoding and now works well).

I've trawled through the logs when trying to play one of the affected episodes and at the end of the FFmpeg I find this:

file:/tv/For All Mankind (2019) [tvdbid-356202]/Season 04/For All Mankind (2019) - S04E01 - Glasnost [ATVP WEBDL-2160p Proper][HDR10Plus][EAC3 Atmos 5.1][h265]-NTb.mkv: Invalid argument

I have struggled to find anyone with the same issue which makes me think it is a simple permissions issue but upon troubleshooting they all seem fine? See, I've mounted my NAS to the LXC container in which Docker with the Jellyfin container runs and then mapped the relevant folders to Jellyfin. Inside the Jellyfin container terminal via Portainer I can add, remove, and edit files within the mapped mounted NAS directory. I have a sneaking suspicion that it could be due to the file itself as when I run mediainfo on the affected files it returns nothing but it does for Big Buck Bunny. However, if I right click on the episodes inside Jellyfin and click "Media Info", it returns everything as it should.

Am I missing something obvious from the logs? Does it look like a permissions issue or something file-related?

Thanks in advance!

Reproduction Steps

  1. Run Jellyfin in a Docker container in an unprivileged LXC that's running on Proxmox
  2. Access the web client
  3. Play an affected episode

Jellyfin Version

10.8.13

if other:

No response

Environment

- OS: Debian 12
- Linux Kernel: 6.5.11-7-pve
- Virtualization: Docker container inside LXC
- Clients: Browser
- Browser: Chrome 121
- FFmpeg Version: 5.1.4
- Playback Method: Transcode
- Hardware Acceleration: Intel QSV
- GPU Model: Intel® HD Graphics 630
- Plugins: Fanart
- Reverse Proxy: Traefik
- Base URL: none
- Networking: Host
- Storage: local

Jellyfin logs

[2024-03-04 15:12:19.139 +00:00] [DBG] [49] Jellyfin.Api.Controllers.MediaInfoController: GetPostedPlaybackInfo profile: DeviceProfile { Name: null, Id: null, Identification: null, FriendlyName: null, Manufacturer: null, ManufacturerUrl: null, ModelName: null, ModelDescription: null, ModelNumber: null, ModelUrl: null, SerialNumber: null, EnableAlbumArtInDidl: False, EnableSingleAlbumArtLimit: False, EnableSingleSubtitleLimit: False, SupportedMediaTypes: "Audio,Photo,Video", UserId: null, AlbumArtPn: null, MaxAlbumArtWidth: null, MaxAlbumArtHeight: null, MaxIconWidth: null, MaxIconHeight: null, MaxStreamingBitrate: 120000000, MaxStaticBitrate: 100000000, MusicStreamingTranscodingBitrate: 384000, MaxStaticMusicBitrate: 8000000, SonyAggregationFlags: null, ProtocolInfo: null, TimelineOffsetSeconds: 0, RequiresPlainVideoItems: False, RequiresPlainFolders: False, EnableMSMediaReceiverRegistrar: False, IgnoreTranscodeByteRangeRequests: False, XmlRootAttributes: [], DirectPlayProfiles: [DirectPlayProfile { Container: "webm", AudioCodec: "vorbis,opus", VideoCodec: "vp8,vp9,av1", Type: Video }, DirectPlayProfile { Container: "mp4,m4v", AudioCodec: "aac,mp3,opus,flac,vorbis", VideoCodec: "h264,hevc,vp9,av1", Type: Video }, DirectPlayProfile { Container: "mov", AudioCodec: "aac,mp3,opus,flac,vorbis", VideoCodec: "h264", Type: Video }, DirectPlayProfile { Container: "opus", AudioCodec: null, VideoCodec: null, Type: Audio }, DirectPlayProfile { Container: "webm", AudioCodec: "opus", VideoCodec: null, Type: Audio }, DirectPlayProfile { Container: "mp3", AudioCodec: null, VideoCodec: null, Type: Audio }, DirectPlayProfile { Container: "aac", AudioCodec: null, VideoCodec: null, Type: Audio }, DirectPlayProfile { Container: "m4a", AudioCodec: "aac", VideoCodec: null, Type: Audio }, DirectPlayProfile { Container: "m4b", AudioCodec: "aac", VideoCodec: null, Type: Audio }, DirectPlayProfile { Container: "flac", AudioCodec: null, VideoCodec: null, Type: Audio }, DirectPlayProfile { Container: "webma", AudioCodec: null, VideoCodec: null, Type: Audio }, DirectPlayProfile { Container: "webm", AudioCodec: "webma", VideoCodec: null, Type: Audio }, DirectPlayProfile { Container: "wav", AudioCodec: null, VideoCodec: null, Type: Audio }, DirectPlayProfile { Container: "ogg", AudioCodec: null, VideoCodec: null, Type: Audio }], TranscodingProfiles: [TranscodingProfile { Container: "ts", Type: Audio, VideoCodec: "", AudioCodec: "aac", Protocol: "hls", EstimateContentLength: False, EnableMpegtsM2TsMode: False, TranscodeSeekInfo: Auto, CopyTimestamps: False, Context: Streaming, EnableSubtitlesInManifest: False, MaxAudioChannels: "2", MinSegments: 2, SegmentLength: 0, BreakOnNonKeyFrames: True, Conditions: [] }, TranscodingProfile { Container: "aac", Type: Audio, VideoCodec: "", AudioCodec: "aac", Protocol: "http", EstimateContentLength: False, EnableMpegtsM2TsMode: False, TranscodeSeekInfo: Auto, CopyTimestamps: False, Context: Streaming, EnableSubtitlesInManifest: False, MaxAudioChannels: "2", MinSegments: 0, SegmentLength: 0, BreakOnNonKeyFrames: False, Conditions: [] }, TranscodingProfile { Container: "mp3", Type: Audio, VideoCodec: "", AudioCodec: "mp3", Protocol: "http", EstimateContentLength: False, EnableMpegtsM2TsMode: False, TranscodeSeekInfo: Auto, CopyTimestamps: False, Context: Streaming, EnableSubtitlesInManifest: False, MaxAudioChannels: "2", MinSegments: 0, SegmentLength: 0, BreakOnNonKeyFrames: False, Conditions: [] }, TranscodingProfile { Container: "opus", Type: Audio, VideoCodec: "", AudioCodec: "opus", Protocol: "http", EstimateContentLength: False, EnableMpegtsM2TsMode: False, TranscodeSeekInfo: Auto, CopyTimestamps: False, Context: Streaming, EnableSubtitlesInManifest: False, MaxAudioChannels: "2", MinSegments: 0, SegmentLength: 0, BreakOnNonKeyFrames: False, Conditions: [] }, TranscodingProfile { Container: "wav", Type: Audio, VideoCodec: "", AudioCodec: "wav", Protocol: "http", EstimateContentLength: False, EnableMpegtsM2TsMode: False, TranscodeSeekInfo: Auto, CopyTimestamps: False, Context: Streaming, EnableSubtitlesInManifest: False, MaxAudioChannels: "2", MinSegments: 0, SegmentLength: 0, BreakOnNonKeyFrames: False, Conditions: [] }, TranscodingProfile { Container: "opus", Type: Audio, VideoCodec: "", AudioCodec: "opus", Protocol: "http", EstimateContentLength: False, EnableMpegtsM2TsMode: False, TranscodeSeekInfo: Auto, CopyTimestamps: False, Context: Static, EnableSubtitlesInManifest: False, MaxAudioChannels: "2", MinSegments: 0, SegmentLength: 0, BreakOnNonKeyFrames: False, Conditions: [] }, TranscodingProfile { Container: "mp3", Type: Audio, VideoCodec: "", AudioCodec: "mp3", Protocol: "http", EstimateContentLength: False, EnableMpegtsM2TsMode: False, TranscodeSeekInfo: Auto, CopyTimestamps: False, Context: Static, EnableSubtitlesInManifest: False, MaxAudioChannels: "2", MinSegments: 0, SegmentLength: 0, BreakOnNonKeyFrames: False, Conditions: [] }, TranscodingProfile { Container: "aac", Type: Audio, VideoCodec: "", AudioCodec: "aac", Protocol: "http", EstimateContentLength: False, EnableMpegtsM2TsMode: False, TranscodeSeekInfo: Auto, CopyTimestamps: False, Context: Static, EnableSubtitlesInManifest: False, MaxAudioChannels: "2", MinSegments: 0, SegmentLength: 0, BreakOnNonKeyFrames: False, Conditions: [] }, TranscodingProfile { Container: "wav", Type: Audio, VideoCodec: "", AudioCodec: "wav", Protocol: "http", EstimateContentLength: False, EnableMpegtsM2TsMode: False, TranscodeSeekInfo: Auto, CopyTimestamps: False, Context: Static, EnableSubtitlesInManifest: False, MaxAudioChannels: "2", MinSegments: 0, SegmentLength: 0, BreakOnNonKeyFrames: False, Conditions: [] }, TranscodingProfile { Container: "ts", Type: Video, VideoCodec: "h264", AudioCodec: "aac,mp3", Protocol: "hls", EstimateContentLength: False, EnableMpegtsM2TsMode: False, TranscodeSeekInfo: Auto, CopyTimestamps: False, Context: Streaming, EnableSubtitlesInManifest: False, MaxAudioChannels: "2", MinSegments: 2, SegmentLength: 0, BreakOnNonKeyFrames: True, Conditions: [] }], ContainerProfiles: [], CodecProfiles: [CodecProfile { Type: VideoAudio, Conditions: [ProfileCondition { Condition: Equals, Property: IsSecondaryAudio, Value: "false", IsRequired: False }], ApplyConditions: [], Codec: "aac", Container: null }, CodecProfile { Type: VideoAudio, Conditions: [ProfileCondition { Condition: Equals, Property: IsSecondaryAudio, Value: "false", IsRequired: False }], ApplyConditions: [], Codec: null, Container: null }, CodecProfile { Type: Video, Conditions: [ProfileCondition { Condition: NotEquals, Property: IsAnamorphic, Value: "true", IsRequired: False }, ProfileCondition { Condition: EqualsAny, Property: VideoProfile, Value: "high|main|baseline|constrained baseline|high 10", IsRequired: False }, ProfileCondition { Condition: EqualsAny, Property: VideoRangeType, Value: "SDR", IsRequired: False }, ProfileCondition { Condition: LessThanEqual, Property: VideoLevel, Value: "52", IsRequired: False }, ProfileCondition { Condition: NotEquals, Property: IsInterlaced, Value: "true", IsRequired: False }], ApplyConditions: [], Codec: "h264", Container: null }, CodecProfile { Type: Video, Conditions: [ProfileCondition { Condition: NotEquals, Property: IsAnamorphic, Value: "true", IsRequired: False }, ProfileCondition { Condition: EqualsAny, Property: VideoProfile, Value: "main|main 10", IsRequired: False }, ProfileCondition { Condition: EqualsAny, Property: VideoRangeType, Value: "SDR", IsRequired: False }, ProfileCondition { Condition: LessThanEqual, Property: VideoLevel, Value: "183", IsRequired: False }, ProfileCondition { Condition: NotEquals, Property: IsInterlaced, Value: "true", IsRequired: False }], ApplyConditions: [], Codec: "hevc", Container: null }, CodecProfile { Type: Video, Conditions: [ProfileCondition { Condition: EqualsAny, Property: VideoRangeType, Value: "SDR|HDR10|HLG", IsRequired: False }], ApplyConditions: [], Codec: "vp9", Container: null }, CodecProfile { Type: Video, Conditions: [ProfileCondition { Condition: EqualsAny, Property: VideoRangeType, Value: "SDR|HDR10|HLG", IsRequired: False }], ApplyConditions: [], Codec: "av1", Container: null }], ResponseProfiles: [ResponseProfile { Container: "m4v", AudioCodec: null, VideoCodec: null, Type: Video, OrgPn: null, MimeType: "video/mp4", Conditions: [] }], SubtitleProfiles: [SubtitleProfile { Format: "vtt", Method: External, DidlMode: null, Language: null, Container: null }, SubtitleProfile { Format: "ass", Method: External, DidlMode: null, Language: null, Container: null }, SubtitleProfile { Format: "ssa", Method: External, DidlMode: null, Language: null, Container: null }] }
[2024-03-04 15:12:19.140 +00:00] [INF] [49] Jellyfin.Api.Helpers.MediaInfoHelper: User policy for "admin". EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True
[2024-03-04 15:12:19.141 +00:00] [DBG] [49] Jellyfin.Api.Helpers.MediaInfoHelper: Bitrate exceeds DirectPlay limit: media bitrate: 25650628, max bitrate: 6000000
[2024-03-04 15:12:19.141 +00:00] [DBG] [49] Jellyfin.Api.Helpers.MediaInfoHelper: Bitrate exceeds DirectStream limit: media bitrate: 25650628, max bitrate: 6000000
[2024-03-04 15:12:19.141 +00:00] [DBG] [49] Jellyfin.Api.Helpers.MediaInfoHelper: Profile: "Unknown Profile", Path: "/tv/For All Mankind (2019) [tvdbid-356202]/Season 04/For All Mankind (2019) - S04E01 - Glasnost [ATVP WEBDL-2160p Proper][HDR10Plus][EAC3 Atmos 5.1][h265]-NTb.mkv", isEligibleForDirectPlay: False, isEligibleForDirectStream: False
[2024-03-04 15:12:19.141 +00:00] [DBG] [49] Jellyfin.Api.Helpers.MediaInfoHelper: Transcode Result for Profile: "Anonymous Profile", Path: "/tv/For All Mankind (2019) [tvdbid-356202]/Season 04/For All Mankind (2019) - S04E01 - Glasnost [ATVP WEBDL-2160p Proper][HDR10Plus][EAC3 Atmos 5.1][h265]-NTb.mkv", PlayMethod: Transcode, AudioStreamIndex: 1, SubtitleStreamIndex: 2, Reasons: ContainerBitrateExceedsLimit
[2024-03-04 15:12:19.141 +00:00] [INF] [49] Jellyfin.Api.Helpers.MediaInfoHelper: StreamBuilder.BuildVideoItem( Profile="Anonymous Profile", Path="/tv/For All Mankind (2019) [tvdbid-356202]/Season 04/For All Mankind (2019) - S04E01 - Glasnost [ATVP WEBDL-2160p Proper][HDR10Plus][EAC3 Atmos 5.1][h265]-NTb.mkv", AudioStreamIndex=null, SubtitleStreamIndex=null ) => ( PlayMethod=Transcode, TranscodeReason=ContainerBitrateExceedsLimit ) "media:/videos/344c2183-ebc4-9aaa-1b51-853986ea740f/master.m3u8?MediaSourceId=344c2183ebc49aaa1b51853986ea740f&VideoCodec=h264&AudioCodec=aac,mp3&AudioStreamIndex=1&VideoBitrate=5616000&AudioBitrate=384000&MaxFramerate=23.976025&api_key=<token>&TranscodingMaxAudioChannels=2&RequireAvc=false&Tag=39318074ce5194161ea68dc2053d636e&SegmentContainer=ts&MinSegments=2&BreakOnNonKeyFrames=True&hevc-level=150&hevc-videobitdepth=10&hevc-profile=main10&TranscodeReasons=ContainerBitrateExceedsLimit"
[2024-03-04 15:12:19.779 +00:00] [DBG] [53] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: "CustomAuthentication" was successfully authenticated.
[2024-03-04 15:12:19.779 +00:00] [DBG] [53] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: "CustomAuthentication" was successfully authenticated.
[2024-03-04 15:12:19.808 +00:00] [DBG] [52] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: "CustomAuthentication" was successfully authenticated.
[2024-03-04 15:12:19.808 +00:00] [DBG] [52] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: "CustomAuthentication" was successfully authenticated.
[2024-03-04 15:12:19.989 +00:00] [DBG] [55] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: "CustomAuthentication" was successfully authenticated.
[2024-03-04 15:12:19.989 +00:00] [DBG] [55] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: "CustomAuthentication" was successfully authenticated.
[2024-03-04 15:12:19.990 +00:00] [DBG] [55] Jellyfin.Api.Controllers.DynamicHlsController: Starting transcoding because currentTranscodingIndex=null
[2024-03-04 15:12:19.990 +00:00] [INF] [55] Jellyfin.Api.Controllers.DynamicHlsController: Current HLS implementation doesn't support non-keyframe breaks but one is requested, ignoring that request
[2024-03-04 15:12:19.991 +00:00] [INF] [55] Jellyfin.Api.Helpers.TranscodingJobHelper: "/usr/lib/jellyfin-ffmpeg/ffmpeg" "-analyzeduration 200M -init_hw_device vaapi=va:,kernel_driver=i915,driver=iHD -init_hw_device qsv=qs@va -filter_hw_device qs -hwaccel vaapi -hwaccel_output_format vaapi -autorotate 0 -i file:\"/tv/For All Mankind (2019) [tvdbid-356202]/Season 04/For All Mankind (2019) - S04E01 - Glasnost [ATVP WEBDL-2160p Proper][HDR10Plus][EAC3 Atmos 5.1][h265]-NTb.mkv\" -autoscale 0 -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_qsv -preset 7 -look_ahead 0 -b:v 5616000 -maxrate 5616000 -bufsize 11232000 -g:v:0 72 -keyint_min:v:0 72 -vf \"setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale_vaapi=w=1920:h=960:format=nv12:extra_hw_frames=24,hwmap=derive_device=qsv,format=qsv\" -codec:a:0 libfdk_aac -ac 2 -ab 384000 -af \"volume=2\" -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 3 -hls_segment_type mpegts -start_number 0 -hls_segment_filename \"/config/transcodes/cf050224e3b6d964d69b79f0f999569f%d.ts\" -hls_playlist_type vod -hls_list_size 0 -y \"/config/transcodes/cf050224e3b6d964d69b79f0f999569f.m3u8\""
[2024-03-04 15:12:19.993 +00:00] [DBG] [53] Jellyfin.Api.Helpers.TranscodingJobHelper: Launched FFmpeg process
[2024-03-04 15:12:20.026 +00:00] [DBG] [53] Jellyfin.Api.Helpers.TranscodingJobHelper: Waiting for the creation of "/config/transcodes/cf050224e3b6d964d69b79f0f999569f0.ts"
[2024-03-04 15:12:20.035 +00:00] [DBG] [49] Jellyfin.Api.Helpers.TranscodingJobHelper: Disposing stream resources
[2024-03-04 15:12:20.036 +00:00] [ERR] [49] Jellyfin.Api.Helpers.TranscodingJobHelper: FFmpeg exited with code 1
[2024-03-04 15:12:20.128 +00:00] [DBG] [49] Jellyfin.Api.Helpers.TranscodingJobHelper: File "/config/transcodes/cf050224e3b6d964d69b79f0f999569f0.ts" created or transcoding has finished
[2024-03-04 15:12:20.129 +00:00] [ERR] [49] Jellyfin.Server.Middleware.ExceptionMiddleware: Error processing request. URL "GET" "/videos/344c2183-ebc4-9aaa-1b51-853986ea740f/hls1/main/0.ts".
MediaBrowser.Common.FfmpegException: FFmpeg exited with code 1
   at Jellyfin.Api.Helpers.TranscodingJobHelper.StartFfMpeg(StreamState state, String outputPath, String commandLineArguments, HttpRequest request, TranscodingJobType transcodingJobType, CancellationTokenSource cancellationTokenSource, String workingDirectory)
   at Jellyfin.Api.Controllers.DynamicHlsController.GetDynamicSegment(StreamingRequestDto streamingRequest, Int32 segmentId)
   at 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)
   at lambda_method1353(Closure , Object )
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(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>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   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>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   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 Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Jellyfin.Server.Middleware.ServerStartupMessageMiddleware.Invoke(HttpContext httpContext, IServerApplicationHost serverApplicationHost, ILocalizationManager localizationManager)
   at Jellyfin.Server.Middleware.WebSocketHandlerMiddleware.Invoke(HttpContext httpContext, IWebSocketManager webSocketManager)
   at Jellyfin.Server.Middleware.IpBasedAccessValidationMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager)
   at Jellyfin.Server.Middleware.LanFilteringMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager, IServerConfigurationManager serverConfigurationManager)
   at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Jellyfin.Server.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.Server.Middleware.RobotsRedirectionMiddleware.Invoke(HttpContext httpContext)
   at Jellyfin.Server.Middleware.LegacyEmbyRouteRewriteMiddleware.Invoke(HttpContext httpContext)
   at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context)
   at Jellyfin.Server.Middleware.ResponseTimeMiddleware.Invoke(HttpContext context, IServerConfigurationManager serverConfigurationManager)
   at Jellyfin.Server.Middleware.ExceptionMiddleware.Invoke(HttpContext context)
[2024-03-04 15:12:20.158 +00:00] [DBG] [49] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: "CustomAuthentication" was successfully authenticated.
[2024-03-04 15:12:20.158 +00:00] [DBG] [49] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: "CustomAuthentication" was successfully authenticated.
[2024-03-04 15:12:20.170 +00:00] [DBG] [53] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: "CustomAuthentication" was successfully authenticated.
[2024-03-04 15:12:20.171 +00:00] [DBG] [53] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: "CustomAuthentication" was successfully authenticated.
[2024-03-04 15:12:20.187 +00:00] [DBG] [53] Jellyfin.Api.Helpers.TranscodingJobHelper: PingTranscodingJob PlaySessionId="8689363b3a2e433c9e34b4ce2c2feb9b" isUsedPaused: True
[2024-03-04 15:12:20.187 +00:00] [DBG] [53] Jellyfin.Api.Helpers.TranscodingJobHelper: Setting job.IsUserPaused to True. jobId: "bc4d97a25ebc49b887131e4c8332d659"
[2024-03-04 15:12:20.235 +00:00] [DBG] [53] Jellyfin.Api.Helpers.TranscodingJobHelper: PingTranscodingJob PlaySessionId="8689363b3a2e433c9e34b4ce2c2feb9b" isUsedPaused: False
[2024-03-04 15:12:20.235 +00:00] [DBG] [53] Jellyfin.Api.Helpers.TranscodingJobHelper: Setting job.IsUserPaused to False. jobId: "bc4d97a25ebc49b887131e4c8332d659"
[2024-03-04 15:12:20.264 +00:00] [DBG] [52] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: "CustomAuthentication" was successfully authenticated.
[2024-03-04 15:12:20.264 +00:00] [DBG] [52] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: "CustomAuthentication" was successfully authenticated.

FFmpeg logs

/videos/344c2183-ebc4-9aaa-1b51-853986ea740f/hls1/main/0.ts

{"Protocol":0,"Id":"344c2183ebc49aaa1b51853986ea740f","Path":"/tv/For All Mankind (2019) [tvdbid-356202]/Season 04/For All Mankind (2019) - S04E01 - Glasnost [ATVP WEBDL-2160p Proper][HDR10Plus][EAC3 Atmos 5.1][h265]-NTb.mkv","EncoderPath":null,"EncoderProtocol":null,"Type":0,"Container":"mkv,webm","Size":12250084352,"Name":"For All Mankind (2019) - S04E01 - Glasnost [ATVP WEBDL-2160p Proper][HDR10Plus][EAC3 Atmos 5.1][h265]-NTb","IsRemote":false,"ETag":"39318074ce5194161ea68dc2053d636e","RunTimeTicks":39385178112,"ReadAtNativeFramerate":false,"IgnoreDts":false,"IgnoreIndex":false,"GenPtsInput":false,"SupportsTranscoding":true,"SupportsDirectStream":true,"SupportsDirectPlay":true,"IsInfiniteStream":false,"RequiresOpening":false,"OpenToken":null,"RequiresClosing":false,"LiveStreamId":null,"BufferMs":null,"RequiresLooping":false,"SupportsProbing":true,"VideoType":0,"IsoType":null,"Video3DFormat":null,"MediaStreams":[{"Codec":"hevc","CodecTag":null,"Language":null,"ColorRange":null,"ColorSpace":"bt2020nc","ColorTransfer":"smpte2084","ColorPrimaries":"bt2020","DvVersionMajor":null,"DvVersionMinor":null,"DvProfile":null,"DvLevel":null,"RpuPresentFlag":null,"ElPresentFlag":null,"BlPresentFlag":null,"DvBlSignalCompatibilityId":null,"Comment":null,"TimeBase":"1/1000","CodecTimeBase":null,"Title":null,"VideoRange":"HDR","VideoRangeType":"HDR10","VideoDoViTitle":null,"LocalizedUndefined":null,"LocalizedDefault":null,"LocalizedForced":null,"LocalizedExternal":null,"DisplayTitle":"4K HEVC HDR","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":null,"BitRate":24882628,"BitDepth":10,"RefFrames":1,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":true,"IsForced":false,

... (Very long file Github won't let me add it all)

"RealFrameRate":null,"Profile":null,"Type":2,"AspectRatio":null,"Index":44,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":true,"SupportsExternalStream":true,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null}],"MediaAttachments":[],"Formats":[],"Bitrate":25650628,"Timestamp":null,"RequiredHttpHeaders":{},"TranscodingUrl":null,"TranscodingSubProtocol":null,"TranscodingContainer":null,"AnalyzeDurationMs":null,"DefaultAudioStreamIndex":null,"DefaultSubtitleStreamIndex":null}

/usr/lib/jellyfin-ffmpeg/ffmpeg -analyzeduration 200M -init_hw_device vaapi=va:,kernel_driver=i915,driver=iHD -init_hw_device qsv=qs@va -filter_hw_device qs -hwaccel vaapi -hwaccel_output_format vaapi -autorotate 0 -i file:"/tv/For All Mankind (2019) [tvdbid-356202]/Season 04/For All Mankind (2019) - S04E01 - Glasnost [ATVP WEBDL-2160p Proper][HDR10Plus][EAC3 Atmos 5.1][h265]-NTb.mkv" -autoscale 0 -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_qsv -preset 7 -look_ahead 0 -b:v 5616000 -maxrate 5616000 -bufsize 11232000 -g:v:0 72 -keyint_min:v:0 72 -vf "setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale_vaapi=w=1920:h=960:format=nv12:extra_hw_frames=24,hwmap=derive_device=qsv,format=qsv" -codec:a:0 libfdk_aac -ac 2 -ab 384000 -af "volume=2" -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 3 -hls_segment_type mpegts -start_number 0 -hls_segment_filename "/config/transcodes/a31be837809e057ded3704b5066b3e90%d.ts" -hls_playlist_type vod -hls_list_size 0 -y "/config/transcodes/a31be837809e057ded3704b5066b3e90.m3u8"

ffmpeg version 5.1.4-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 10 (Debian 10.2.1-6)
  configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-libs=-lfftw3f --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-libdrm --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libsvtav1 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-opencl --enable-vaapi --enable-amf --enable-libmfx --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
file:/tv/For All Mankind (2019) [tvdbid-356202]/Season 04/For All Mankind (2019) - S04E01 - Glasnost [ATVP WEBDL-2160p Proper][HDR10Plus][EAC3 Atmos 5.1][h265]-NTb.mkv: Invalid argument

Please attach any browser or client logs here

No response

Please attach any screenshots here

No response

Code of Conduct

OnlyC0RE commented 5 months ago

Hi, I appear to be having the same/similar issue: I can't play anything after a while - seems to be working for a while after restart - sometimes, not always) FFmpeg transcode log: https://pastebin.com/kc234ibk Jellyfin server log: https://pastebin.com/1Cs8sDGD

One key information could be this also happens with Plex. Can't tell you when it started but it was a reason I switched to Jellyfin but the same issue is here as well.

I can create a separate issue with more details if you want.

nyanmisaka commented 5 months ago

It should be a file system permissions issue but the error message provided by ffmpeg is too generic. You can manually use ffmpeg or any other media info prober to read this file in the same environment. If the problem persists then it proves my point.

OnlyC0RE commented 5 months ago

It should be a file system permissions issue but the error message provided by ffmpeg is too generic. You can manually use ffmpeg or any other media info prober to read this file in the same environment. If the problem persists then it proves my point.

ffmpeg -i The\ Hobbit\ An\ Unexpected\ Journey\ \(2012\)\ \(Remux-2160p\).mkv
ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.2.0-19ubuntu1)
  configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
The Hobbit An Unexpected Journey (2012) (Remux-2160p).mkv: Invalid argument

Invalid argument again

Fstab:

//192.168.0.101/data /mnt/data cifs credentials=/home/core/.smbcredentials,iocharset=utf8,uid=1000,>,gid=1000,file_mode=0777,dir_mode=0777,noauto,x-systemd.automount 0 0

Any idea what is wrong? I don't think it's a permissions issue since after a restart it works for a few minutes. Even ffmpeg probe outputs correct info without an error

OnlyC0RE commented 5 months ago

Found the reason: If the file is being seeded in qbittorrent it cannot be played in Plex/Jellyfin. I find this weird and I'm not sure about a fix. I've never used hardlinks before so I never had this issue and from what I read online it shouldn't be a problem.

kingp0dd commented 5 months ago

Found the reason: If the file is being seeded in qbittorrent it cannot be played in Plex/Jellyfin. I find this weird and I'm not sure about a fix. I've never used hardlinks before so I never had this issue and from what I read online it shouldn't be a problem.

That is weird. I was having the same issue, and when I tried to pause the torrent in qbittorrent (it was seeding), then i was able to play in Jellyfin. I manually hard linked the file because it got corrupted, but it should still work. or so i thought.

have you ever found a fix?

edit: may I ask which part of the log said that it was a file access issue?

nyanmisaka commented 5 months ago

Perhaps look in qbittorrent's settings to see if there is an option to prevent it from taking over the downloaded file and preventing other programs from accessing it.

kingp0dd commented 5 months ago

Even if it's hard linked? I thought that's the purpose of hard links

On Sun, Mar 17, 2024, 6:04 PM Nyanmisaka @.***> wrote:

Perhaps look in qbittorrent's settings to see if there is an option to prevent it from taking over the downloaded file and preventing other programs from accessing it.

— Reply to this email directly, view it on GitHub https://github.com/jellyfin/jellyfin/issues/11107#issuecomment-2002390369, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACGD6KUGBFQP5LY7PJZKDNTYYVTEDAVCNFSM6AAAAABEFNDOPKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBSGM4TAMZWHE . You are receiving this because you commented.Message ID: @.***>

ACR-Jeff commented 5 months ago

I have this same issue, Yet mine has nothing to do with qbittorrent's or any torrent at all, I don't do torrents, Although I've encoded my videos to 264 formats. My players support this format, Yet there seems to be an issue with this format on my end, I have 265 formats that play just fine. I have been unable to play some videos through the web interface as well, Following: This client isn't compatible with the media and the server isn't sending a compatible media format.

1 thing I did notice with a new video I recently added after encoding and scanning my library to add the new metadata to my library is the fact it didn't show a format under the title, Unlike all the other videos in my library.

Mysteriously while writing this, I decided to go check permissions on my server, While doing so I didn't see anything out of the ordinary, So the server was left without changes, Yet came back into my desktop and opened up another web browser 'Firefox' Logged into my jellyfin web interface and tried to play one of the videos that were giving me a problem, Low and behold it worked, Ever since doing so it played on all other web browsers and as well as my android tv box, Without issues. I even noticed after refreshing the browsers as well as the android tv box the format is now showing under the title. I have tested multiple videos after the fact and I have yet to see the error message. I will continue to monitor this issue along with videos in my library.

Here are some logs FFmpeg.Transcode-2024-03-21.log jellyfin20240321.log

ACR-Jeff commented 5 months ago

Appears to have been a problem with an app I was using to edit metadata, Which resulted in causing permission issues on the files.

alguatte commented 5 months ago

I have the same issue : when the file is being seeded by qBittorrent, Jellyfin can't play it (hardlinks are set up). I've noticed this issue since I set up my new NAS. I'm not sure if it's a coincidence or if there's a connection.

felix920506 commented 5 months ago

This is likely a qbittorrent issue. Please file an issue with them. https://github.com/qbittorrent/qBittorrent

MCMXD commented 4 months ago

Found the reason: If the file is being seeded in qbittorrent it cannot be played in Plex/Jellyfin. I find this weird and I'm not sure about a fix. I've never used hardlinks before so I never had this issue and from what I read online it shouldn't be a problem.

FIXED for me. So strange, that has not happened before.

neygen88 commented 3 months ago

I'm facing the same issue. Jellyfin + qBitorrent + hardlinks. Jellyfin fails to play content as it says "Playback failed due to a fatal player error." Looking deep in the log file i saw this error: "file:/mnt/.../xyz.mkv: Invalid argument".

Jellyfin

Server version 10.9.2 Web version 10.9.2 Build version 10.9.2

ffmpeg version 6.0.1-Jellyfin

qbittorrent-nox v4.6.4

@MCMXD how did you manage to fix it?

kingp0dd commented 3 months ago

Maybe he paused the seed, that's what worked for me. But that's not the permanent solution

Another thing that I tried, that i think temporarily fixed it.

so what I did was, unset the delete and remove files in qBit, save radarr/sonarr settings, then set the delete and remove files settings in qBit again. This has worked so far, but i'm not sure until when or if it was just a fluke

neygen88 commented 3 months ago

Thank you @kingp0dd.

I was looking for a more permanent solution because from my TV I haven't full control of the torrent client. In addition, I'm eager to see the video as soon as it's downloaded (I think you understand!).

So far I've tried with different clients: qBittorrent, Transmission, Deluge. All have the same behavior/issue: can't play the video in Jellyfin if it's seeding (with hardlinks setting on).

What I'm trying to implement next is a "temporary" Hard Drive to download the torrent files in and then have Sonarr/Radarr to copy the movie in the "main" storage location where Jellyfin's libraries are.