-
-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some Transcoded Videos Only Play for a few Seconds #591
Comments
Here are some more logs from different videos. The result is consistent per source file. WorkingFreezing |
I do see that the bitrate for all of the good videos are lower than the bitrate for all of the bad videos.
|
It does seem highly correlated to the bitrate. But I don't think it is the full story. I went through my library and it does seem that there is a pivot point. There is only one exception. I have one video with 9707kbps that doesn't play and one with 9846kbps that does play. But other than those two being "flipped" there is a cutoff point where the videos stopped working. However I noticed that a lot of the videos that were failing used to work. I had watched them in the past. I also noticed that despite having "Allow encoding in HEVC format" enabled all of the videos are being transcoded to h264. Often despite the original being in h265. I also found https://developers.google.com/cast/docs/media#chromecast_ultra which doesn't have specific bitrate numbers but it does indicate that the Chromecast Ultra supports "H.264 High Profile up to level 4.2 (1080p/60fps)" and "HEVC / H.265 Main and Main10 Profiles up to level 5.1 (4K/60fps)". So it seems like the h265 decoder for that device can handle a lot more data than the h264 one. So my theory is that something changed that stopped Jellyfin from direct playing h265 and/or stopped it from transcoding to h265. This results in high bitrate videos causing issues on the Chromecast Ultra h264 encoder. So I guess the questions are:
Either of these should resolve my issue. But really both should be solved. I also don't know if the problem is in the Jellyfin server or jellyfin-chromecast. |
Even weirder hardware decoding seems to affect the result. Even doing hardware decoding and software encoding causes it not to play. While software decoding and software encoding works. |
Ah, the difference may be the colour space! Hardware acceleration enabled: nv12 Also a slight bitrate change, but I doubt that is the problem: Hardware accelerated: 35342000 In fact it doesn't even seem like it is ever hardware decoding. Only some scaling is done in hardware. Hardware accelerated: |
I feel like I'm going crazy. Even with the same settings the result can be different. For example these are all with no hardware acceleration at all. It worked three times in a row. Then I togged on "Allow encoding in HEVC format" and it failed. Then I turned it back off and it still failed! Then I played again and it worked again. I checked the logs and it seems that for some reason different resolution and bitrate is being requested.
So sometimes it is deciding to scale to 1080p which works. IDK why this isn't consistent. I also don't know why this isn't using h265. It seems like the bitrate test is giving varying results. (Despite being a wired connection to the server) so if you get lucky it plays. I can see various different values passed to It also seems that this wouldn't be an issue if h265 was used. |
So the root of the problem seems to be that HLS is now preferred, and HLS is hardcoded to be h264 only. jellyfin-chromecast/src/components/codecSupportHelper.ts Lines 245 to 249 in be87b4e
This results in a high bitrate h264 file that the Chromecast Ultra can't play and somehow locks up. So possible fixes may be:
|
I just wanted to say that I've been having this issue for months and this is the first mention of my exact issue. Frustrating since I recorded all my media to 265 and then this happens 🤷 |
The comment on the linked code snippet is not correct now as fMP4-HLS is supported by the server. However, it's behind a flag and I understand is disabled by default. In theory Chromecast could declare support for HEVC (and AV1) on HLS and server would support direct stream/play to Chromecast if "Prefer fMP4-HLS Media Container" is enabled in Playback settings and the hardware supports it, falling back to h264 transcode if not. |
Is there any update or idea for a workaround regarding this issue? Ever since I upgraded to the latest jellyfin version a few months ago I'm experiencing the same issue. Everything with a low bitrate works fine on chromcast, high bitrates get the spinning wheel of eternity. All other devices work fine, regardless of bitrate. |
Has anyone tested recently using the unstable Chromecast client? There have been a few changes here which hopefully improve reliability (changing the video player used by the client, and also forcing the use of MP4 containers). I use a Chromecast gen 2 which doesn't support HEVC or AV1 natively. I had a bad experience with the stable client but the changes I've submitted that are available on the unstable client have improved things a lot. |
I'll try to do some tests later today. Would you mind linking some changes that you think may be relevant? It would be helpful for debugging and just for reference. |
I removed my bitrate limit and played a bunch of random videos and didn't hit any issues. Unfortunately I no longer have the only video that I remember for sure from the original test set. But give the wide sampling it seems that this issue is no longer present on the beta channel. |
Great news! Would you consider closing this issue then? I would push for promotion of the unstable client to stable, but there are some subtitle issues that I'd like to look into first. |
No harm in closing. If the other commenters are still seeing issues we can reopen or they can file issues with more details about their setup. |
Describe the bug
When starting some videos that require transcoding the video plays for a few seconds (8?) then stutters for under a second, then after another second or two of playback pauses with a spinner forever. This is consistent by video. However when it stutters you can seek and it will play for a bit again as described before freezing again. So it doesn't seem to be any particular part of the video, just the video itself.
To Reproduce
Cast a video.
Expected behavior
Logs
Here are some example HTTP logs. Notice that the client stops requesting new chunks. There are no failed requests.
HTTP Logs:
Server logs:
Transcode log:
System (please complete the following information):
The text was updated successfully, but these errors were encountered: