Jellyfin Forum
Direct Play issues with certain films - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+--- Thread: Direct Play issues with certain films (/t-direct-play-issues-with-certain-films)



Direct Play issues with certain films - chimpfacts - 2024-02-26

I have been using my jellyfin server for a few months now, it has mostly worked quite well however there are a few films I have found that will always buffer at the same points when streaming, some refuse to play at all freezing at the same point each time.
None of these films are being transcoded, all playing via. direct play. I have tested each of them on google chrome as well as the jellyfin media player desktop app with the same results for both.

Below are two examples of films that buffer consistently:
Video
Title: English - 1080p - H264 - SDR
Codec: H264
AVC: Yes
Profile: High
Level: 41
Resolution: 1920x1080
Aspect ratio: 16:9
Interlaced: No
Framerate: 23.976025
Bitrate: 41633 kbps
Bit depth: 8 bit
Video range: SDR
Video range type: SDR
Pixel format: yuv420p
Ref frames: 1
NAL: 4

Video
Title: 1080p H264 SDR
Codec: H264
AVC: Yes
Profile: High
Level: 41
Resolution: 1920x800
Aspect ratio: 2.40:1
Interlaced: No
Framerate: 23.976025
Bitrate: 10381 kbps
Bit depth: 8 bit
Video range: SDR
Video range type: SDR
Pixel format: yuv420p
Ref frames: 1
NAL: 4

And this is for a film that never buffers:
Video
Title: 1080p H264 SDR
Codec: H264
Codec tag: avc1
AVC: Yes
Profile: High
Level: 41
Resolution: 1920x816
Aspect ratio: 2.35:1
Interlaced: No
Framerate: 23.976
Bitrate: 2499 kbps
Bit depth: 8 bit
Video range: SDR
Video range type: SDR
Pixel format: yuv420p
Ref frames: 1
NAL: 4

All seem to have near-identical encoding and the logs don't throw anything unusual during playback, I'm unsure what else to look for.


RE: Direct Play issues with certain films - toytown - 2024-02-26

Could be network related issues. The first video has an average bitrate of 41.6Mbit, which means it will be higher during certain parts of the movie (maybe closer to 80Mbit). Meanwhile the video that doesn't buffer only has a bitrate of 2.5Mbit.....nearly 20x less bandwidth. Is this running on a cable'd LAN/WIFI or are using the internet to stream?


RE: Direct Play issues with certain films - TheDreadPirate - 2024-02-26

What OS is the server running? Windows?


RE: Direct Play issues with certain films - chimpfacts - 2024-02-27

(2024-02-26, 05:47 PM)TheDreadPirate Wrote: What OS is the server running?  Windows?

I run Jellyfin on a Ubuntu VM that's hosted in Hyper-V on a Dell Poweredge Server running Windows Server 2012.

The content is stored on a Synology which is file shared with the server as an NFS file share.

(2024-02-26, 11:34 AM)toytown Wrote: Could be network related issues.  The first video has an average bitrate of 41.6Mbit, which means it will be higher during certain parts of the movie (maybe closer to 80Mbit).  Meanwhile the video that doesn't buffer only has a bitrate of 2.5Mbit.....nearly 20x less bandwidth.  Is this running on a cable'd LAN/WIFI or are using the internet to stream?

Server Host and NAS that holds the content are over LAN but none of my clients are over LAN, all on WiFi.

Also I could be wrong but if it was network related issues, would the buffering not occur at random points rather than the same spot in the movie every time?


RE: Direct Play issues with certain films - TheDreadPirate - 2024-02-27

If it is only happening on a few videos, and if these videos are in MKV containers, we can try repackaging the videos without reencoding them.

Code:
/usr/lib/jellyfin-ffmpeg/ffmpeg -fflags genpts -i "/path/to/video.mkv" -map 0:v -map 0:a -map 0:s -map_chapters 0 -c:v copy -c:a copy -c:s copy outputFile.mkv



RE: Direct Play issues with certain films - chimpfacts - 2024-02-27

(2024-02-27, 05:15 AM)TheDreadPirate Wrote: If it is only happening on a few videos, and if these videos are in MKV containers, we can try repackaging the videos without reencoding them.

Code:
/usr/lib/jellyfin-ffmpeg/ffmpeg -fflags genpts -i "/path/to/video.mkv" -map 0:v -map 0:a -map 0:s -map_chapters 0 -c:v copy -c:a copy -c:s copy outputFile.mkv

I tried this on one of the problematic movies, it is marginally better but still the same issue occurs, same timestamps are buffering on different clients.



The below logs were what showed during the stream from the start, The "slow HTTP response" error shows even during streams with no issues so I didn't think that would be a problem.:
Code:
[19:47:22] [INF] [44] Jellyfin.Api.Helpers.MediaInfoHelper: User policy for sc-jellyfin. EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True
[19:48:33] [DBG] [44] Emby.Server.Implementations.Session.SessionWebSocketListener: Watching 1 WebSockets.
[19:48:21] [DBG] [44] Emby.Server.Implementations.Session.SessionWebSocketListener: Watching 1 WebSockets.
[19:48:32] [DBG] [26] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: CustomAuthentication was not authenticated.
[19:48:23] [DBG] [41] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: CustomAuthentication was successfully authenticated.
[19:48:09] [DBG] [3] Emby.Server.Implementations.Session.SessionWebSocketListener: Watching 1 WebSockets.
[19:48:31] [WRN] [38] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://tdgserv-docker:8096/Sessions/Playing/Progress to 192.168.0.231 in 0:00:00.7197194 with Status Code 204
[19:48:30] [DBG] [38] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: CustomAuthentication was successfully authenticated.
[19:48:23] [WRN] [41] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://tdgserv-docker:8096/Sessions/Playing/Progress to 192.168.0.231 in 0:00:00.8785513 with Status Code 204
[19:48:13] [DBG] [45] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: CustomAuthentication was successfully authenticated.
[19:48:13] [WRN] [45] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://tdgserv-docker:8096/Sessions/Playing/Progress to 192.168.0.231 in 0:00:00.7269776 with Status Code 204
[19:48:09] [DBG] [45] Emby.Server.Implementations.HttpServer.WebSocketConnection: WS 192.168.0.231 received message: {"MessageType": "KeepAlive", "MessageId": "00000000-0000-0000-0000-000000000000", "ServerId": null, "Data": null, "$type": "WebSocketMessage`1"}
[19:48:03] [DBG] [3] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: CustomAuthentication was successfully authenticated.
[19:48:03] [WRN] [3] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://tdgserv-docker:8096/Sessions/Playing/Progress to 192.168.0.231 in 0:00:00.6462296 with Status Code 204
[19:48:02] [DBG] [25] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: CustomAuthentication was not authenticated.
[19:47:57] [DBG] [41] Emby.Server.Implementations.Session.SessionWebSocketListener: Watching 1 WebSockets.
[19:47:53] [WRN] [25] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://tdgserv-docker:8096/Sessions/Playing/Progress to 192.168.0.231 in 0:00:00.6636813 with Status Code 204
[19:47:52] [DBG] [25] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: CustomAuthentication was successfully authenticated.
[19:47:45] [DBG] [25] Emby.Server.Implementations.Session.SessionWebSocketListener: Watching 1 WebSockets.
[19:47:43] [WRN] [26] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://tdgserv-docker:8096/Sessions/Playing/Progress to 192.168.0.231 in 0:00:00.7044537 with Status Code 204
[19:47:42] [DBG] [26] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: CustomAuthentication was successfully authenticated.
[19:47:39] [DBG] [38] Emby.Server.Implementations.HttpServer.WebSocketConnection: WS 192.168.0.231 received message: {"MessageType": "KeepAlive", "MessageId": "00000000-0000-0000-0000-000000000000", "ServerId": null, "Data": null, "$type": "WebSocketMessage`1"}
[19:47:33] [WRN] [22] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://tdgserv-docker:8096/Sessions/Playing/Progress to 192.168.0.231 in 0:00:00.7506389 with Status Code 204
[19:47:32] [DBG] [22] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: CustomAuthentication was successfully authenticated.
[19:47:33] [DBG] [3] Emby.Server.Implementations.Session.SessionWebSocketListener: Watching 1 WebSockets.
[19:47:24] [WRN] [39] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://tdgserv-docker:8096/Sessions/Playing/Progress to 192.168.0.231 in 0:00:01.1178951 with Status Code 204
[19:47:32] [DBG] [22] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: CustomAuthentication was not authenticated.
[19:47:24] [DBG] [3] Emby.Server.Implementations.Data.SqliteItemRepository: GetItemList query time (slow): 426.1208ms. Query: select type,data,StartDate,EndDate,ChannelId,IsMovie,IsSeries,EpisodeTitle,IsRepeat,CommunityRating,CustomRating,IndexNumber,IsLocked,PreferredMetadataLanguage,PreferredMetadataCountryCode,Width,Height,DateLastRefreshed,Name,Path,PremiereDate,Overview,ParentIndexNumber,ProductionYear,OfficialRating,ForcedSortName,RunTimeTicks,Size,DateCreated,DateModified,guid,Genres,ParentId,Audio,ExternalServiceId,IsInMixedFolder,DateLastSaved,LockedFields,Studios,Tags,TrailerTypes,OriginalTitle,PrimaryVersionId,DateLastMediaAdded,Album,CriticRating,IsVirtualItem,SeriesName,SeasonName,SeasonId,SeriesId,PresentationUniqueKey,InheritedParentalRatingValue,ExternalSeriesId,Tagline,ProviderIds,Images,ProductionLocations,ExtraIds,TotalBitrate,ExtraType,Artists,AlbumArtists,ExternalId,SeriesPresentationUniqueKey,ShowId,OwnerId from TypedBaseItems A where (Guid = @IncludeId0)
[19:47:23] [WRN] [44] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://tdgserv-docker:8096/Sessions/Playing to 192.168.0.231 in 0:00:00.9173265 with Status Code 204
[19:47:23] [DBG] [44] InfuseSync.EntryPoints.UserSyncManager: InfuseSync will save user data for item 2f9fe21a-3e81-3a76-fd8c-de3997c5e407 user ef7992a0-598f-42a7-88bc-0a5c58ff0bcf
[19:47:23] [DBG] [44] InfuseSync.EntryPoints.UserSyncManager: InfuseSync received user data for item 'Wonka' of type 'Movie' Guid '2f9fe21a-3e81-3a76-fd8c-de3997c5e407'
[19:47:22] [DBG] [39] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: CustomAuthentication was successfully authenticated.
[19:47:22] [DBG] [25] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: CustomAuthentication was not authenticated.
[19:47:22] [DBG] [44] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: CustomAuthentication was successfully authenticated.
[19:47:22] [WRN] [44] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://tdgserv-docker:8096/Items/2f9fe21a3e813a76fd8cde3997c5e407/PlaybackInfo?UserId=ef7992a0598f42a788bc0a5c58ff0bcf&StartTimeTicks=0&IsPlayback=true&AutoOpenLiveStream=true&AudioStreamIndex=1&SubtitleStreamIndex=7&MediaSourceId=2f9fe21a3e813a76fd8cde3997c5e407&MaxStreamingBitrate=140000000 to 192.168.0.231 in 0:00:00.606381 with Status Code 200
[19:47:22] [INF] [44] Jellyfin.Api.Helpers.MediaInfoHelper: StreamBuilder.BuildVideoItem( Profile=Jellyfin Media Player, Path=/media/Existing_Media/Movies/Wonka (2023)/Wonka.mkv, AudioStreamIndex=1, SubtitleStreamIndex=7 ) => ( PlayMethod=DirectPlay, TranscodeReason=0 ) media:/videos/2f9fe21a-3e81-3a76-fd8c-de3997c5e407/stream.mkv?MediaSourceId=2f9fe21a3e813a76fd8cde3997c5e407&Static=true&VideoCodec=h264&AudioCodec=truehd&AudioStreamIndex=1&SubtitleStreamIndex=7&api_key=<token>&SubtitleMethod=Embed&Tag=b04071adde95ee31ed5e5832d362aa16
[19:47:22] [DBG] [44] Jellyfin.Api.Helpers.MediaInfoHelper: DirectPlay Result for Profile: Jellyfin Media Player, Path: /media/Existing_Media/Movies/Wonka (2023)/Wonka.mkv, PlayMethod: DirectPlay, AudioStreamIndex: 1, SubtitleStreamIndex: 7, Reasons: 0
[19:47:22] [DBG] [44] Jellyfin.Api.Helpers.MediaInfoHelper: Profile: Jellyfin Media Player, Path: /media/Existing_Media/Movies/Wonka (2023)/Wonka.mkv, isEligibleForDirectPlay: True, isEligibleForDirectStream: False



RE: Direct Play issues with certain films - TheDreadPirate - 2024-02-27

The slow response messages are pointless. There is a check box to disable them, which I recommend you do.

Otherwise your log looks fine.

It is possible then that the actual video/audio streams are corrupt in some way. Get another copy/re-rip the affected movies/shows.


RE: Direct Play issues with certain films - chimpfacts - 2024-02-28

(2024-02-27, 06:36 PM)TheDreadPirate Wrote: The slow response messages are pointless.  There is a check box to disable them, which I recommend you do.

Otherwise your log looks fine.

It is possible then that the actual video/audio streams are corrupt in some way.  Get another copy/re-rip the affected movies/shows.

Have had some progress in troubleshooting, happened to get a new laptop today and tested the same videos and they work much better.

Seems to be specifically on my desktop that the issues are occurring.

Wifi on my desktop is far worse than on other devices so I guess that will be the problem.

On the brightside, I have now ststarted looking to automated transcoding to make these files easier to play, so I think that will help with these issues.