jellyfin / jellyfin-media-player

Jellyfin Desktop Client
GNU General Public License v2.0
3.07k stars 308 forks source link

Intermittent semi-hangs when starting to play video files #728

Open mahriman opened 1 month ago

mahriman commented 1 month ago

Describe the bug Intermittently when playing a video file from the home page, the player will hang at what seems to be the first frame of that media file (or maybe the splash image). This behavior has started sometime since Jellyfin 10.9.0 release and corresponding JMP releases. Whenever this happens, the player becomes unresponsive and it's impossible to 'back out' of the playing media that has hung, so closing JMP and re-opening it is the only solution. After restarting the client, the very same media file works again (even though the logs points to the media file having an incompatible codec when there's an issue playing the media file).

I do not have a way to reproduce this error. Media files are almost always h264 rating when this happens.

Since I cannot reproduce this problem, I have a hard time saying when it happens. I want to say it only happens after JMP have been idle for some time (1+ day), but I have nothing to support that. I will try to update this issue if/when new symptoms arise.

Expected behavior Media should be playable, and at the very least if there's some kind of issue, that should be displayed and the interface should continue working.

Desktop (please complete the following information):

Additional context Log file when it happens. Do note that the application as such doesn't seem to hang and saves window geometry upon exiting.

jellyfin-mediaplayer-hang-at-playing-video-file-log.txt

mahriman commented 1 month ago

Okay, the issue has happened once again, but I wasn't smart enough to screen record prior to it happening.

The entire application does not hang, I'm still able to right click and get the context menu and using actions there (IIRC back does nothing and reload takes me back to the previous page, trying to play the same media file again will result in same behavior until JMP is restarted).

NathanAdhitya commented 1 month ago

The symptoms look similar to #727. The player is no longer MPV and turned to htmlvideoplayer. Can you test whether the issue only happens after trying to reload manually? I can confirm that my player spits out similar errors trying to reproduce #727.

2024-07-18 13:00:06.310 [info] unknown @ 0 - JS: Requesting url without automatic networking: http://192.168.20.49:8096/Items/d35d8cad7802bc4bb4b14bf7a851c28e/PlaybackInfo?UserId=2a01ba9e126d4387821cd78a00cd0dd0&StartTimeTicks=2710630000&IsPlayback=true&AutoOpenLiveStream=true&MaxStreamingBitrate=629961175
2024-07-18 13:00:06.606 [info] unknown @ 0 - JS: playing url: http://192.168.20.49:8096/Videos/d35d8cad7802bc4bb4b14bf7a851c28e/stream.mkv?Static=true&mediaSourceId=d35d8cad7802bc4bb4b14bf7a851c28e&deviceId=SmVsbHlmaW5NZWRpYVBsYXllciAxLjExLjEgKHdpbmRvd3MteDg2XzY0IDEwKXwxNzIwNjczNjg1NTA3&api_key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&Tag=1fada2c9b66fabdb2c934714a0027136
2024-07-18 13:00:06.633 [info] unknown @ 0 - JS: Active player: {"name":"Html Video Player","id":"htmlvideoplayer","playerName":"Html Video Player","playableMediaTypes":[false,true,false,false],"isLocalPlayer":true,"supportedCommands":["GoHome","GoToSettings","VolumeUp","VolumeDown","Mute","Unmute","ToggleMute","SetVolume","SetAudioStreamIndex","SetSubtitleStreamIndex","SetMaxStreamingBitrate","DisplayContent","GoToSearch","DisplayMessage","SetRepeatMode","SetShuffleQueue","PlayMediaSource","PlayTrailers","ToggleFullscreen","PictureInPicture","SetBrightness","SetAspectRatio","PlaybackRate"]}
2024-07-18 13:00:06.634 [info] unknown @ 0 - JS: nowplaying event: playbackstart
2024-07-18 13:00:06.635 [info] unknown @ 0 - JS: [nowPlayingBar:onStateChanged] event: playbackstart
2024-07-18 13:00:06.635 [info] unknown @ 0 - JS: Requesting url without automatic networking: http://192.168.20.49:8096/Sessions/Playing
2024-07-18 13:00:06.639 [info] unknown @ 0 - JS: Requesting url without automatic networking: http://192.168.20.49:8096/Sessions/Playing/Progress
2024-07-18 13:00:06.737 [info] unknown @ 0 - JS: [playbackmanager] onPlaybackError: [object DOMException] [object Object]
2024-07-18 13:00:06.738 [info] unknown @ 0 - JS: Requesting url without automatic networking: http://192.168.20.49:8096/Items/d35d8cad7802bc4bb4b14bf7a851c28e/PlaybackInfo?UserId=2a01ba9e126d4387821cd78a00cd0dd0&StartTimeTicks=2710630000&IsPlayback=true&AutoOpenLiveStream=true&AudioStreamIndex=1&SubtitleStreamIndex=2&EnableDirectPlay=false&EnableDirectStream=false&AllowVideoStreamCopy=false&MediaSourceId=d35d8cad7802bc4bb4b14bf7a851c28e&MaxStreamingBitrate=629961175
2024-07-18 13:00:06.748 [info] unknown @ 0 - JS: playing url: http://192.168.20.49:8096/videos/d35d8cad-7802-bc4b-b4b1-4bf7a851c28e/master.m3u8?DeviceId=SmVsbHlmaW5NZWRpYVBsYXllciAxLjExLjEgKHdpbmRvd3MteDg2XzY0IDEwKXwxNzIwNjczNjg1NTA3&MediaSourceId=d35d8cad7802bc4bb4b14bf7a851c28e&VideoCodec=h264,hevc,hevc&AudioCodec=aac&AudioStreamIndex=1&VideoBitrate=629769175&AudioBitrate=192000&AudioSampleRate=48000&MaxFramerate=23.976025&PlaySessionId=aed4ab2056c2493d87d882c1b75fb868&api_key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&TranscodingMaxAudioChannels=2&RequireAvc=false&Tag=1fada2c9b66fabdb2c934714a0027136&SegmentContainer=ts&BreakOnNonKeyFrames=False&hevc-level=123&hevc-videobitdepth=10&hevc-profile=main10&hevc-audiochannels=2&aac-profile=lc&TranscodeReasons=DirectPlayError&allowVideoStreamCopy=false
2024-07-18 13:00:06.799 [info] unknown @ 0 - JS: HLS Error: Type: mediaError Details: manifestIncompatibleCodecsError Fatal: true
2024-07-18 13:00:06.799 [info] unknown @ 0 - JS: fatal media error encountered, try to recover
2024-07-18 13:00:06.799 [info] unknown @ 0 - JS: try to recover media Error ...
mahriman commented 1 month ago

Can you test whether the issue only happens after trying to reload manually?

I can't say for sure it doesn't happen without reload, but I am more often than I'd like reloading so that might be tied to this, yes.