jellyfin / jellyfin-androidtv

Android TV Client for Jellyfin
https://jellyfin.org
GNU General Public License v2.0
2.74k stars 468 forks source link

[Google Chromecast Google TV 4K] h265/HEVC framerate 23.976216 issues #3233

Open KirovAir opened 9 months ago

KirovAir commented 9 months ago

Describe the bug

After a lot of testing I've found out that the HEVC support is very flaky on the 4K google tv. For all my test files 23.976216 fps is killing the playback. Transcoding fixes the issue instantly. High/low bitrates don't matter, the playback is simply juddery. With any other HEVC file it works perfectly fine. This issue is only present on Exoplayer. VLC works fine but will have desynced audio after a while (10mins).

Would it be possible to detect the google tv and simply transcode to H264 for those files? Or simply add an option on the client to always transcode h265/HEVC to h264 always.

Logs

No response

FFmpeg logs

No response

Media info of the file

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Man.on.Fire.(2004).Bluray-1080p.AAC.5.1.x265-Radarr.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    creation_time   : 2020-04-09T13:06:24.000000Z
    title           : Man.on.Fire.2004.1080p.BluRay.x265-RARBG
    encoder         : Lavf58.20.100
    comment         : Man.on.Fire.2004.1080p.BluRay.x265-RARBG
  Duration: 02:26:07.85, start: 0.000000, bitrate: 2230 kb/s
  Stream #0:0[0x1](und): Video: hevc (Main 10) (hev1 / 0x31766568), yuv420p10le(tv), 1920x804 [SAR 1:1 DAR 160:67], 1999 kb/s, 23.98 fps, 23.98 tbr, 1200k tbn (default)
    Metadata:
      creation_time   : 2020-04-09T13:06:24.000000Z
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 224 kb/s (default)
    Metadata:
      creation_time   : 2020-04-09T13:06:24.000000Z
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]

Application version

0.16.0

Device information

Google Chromecast Google TV 4K

Android version

Android 12

Jellyfin server version

10.8.13

zkhcohen commented 9 months ago

I also have a CCwGTV and a library almost entirely consisting of HEVC 23.976fps media, and I can't replicate this issue. Are you controlling for all of the other potential factors?

KirovAir commented 9 months ago

Thanks for the quick response!

I also have a CCwGTV and a library almost entirely consisting of HEVC 23.976fps media, and I can't replicate this issue. Are you controlling for all of the other potential factors?

  • What other devices do you have in the chain (TV/AVR)? Just the TV, direct connection.

  • Is refresh rate switching enabled? All is disabled. All audio output is set to stereo in CCwGTV settings. Would you mind sharing you chromecast refresh rate switching settings?

  • Can you replicate this if it's plugged into another device, after completely reinstalling Jellyfin, or even factory resetting your Chromecast? Yes, on another TV. The CCwGTV/Jellyfin setup was completely stock but I've done a lot of settings changes to optimize some performance (hopefully) as I was thinking that was the issue.

  • Does it affect the .mkv file container as well as .mp4? It seems to affect both.

zkhcohen commented 9 months ago

Thanks for the quick response!

Hardware:

CCwGTV -> Denon AVR-S970H receiver (configured as 5.1ch) -> Samsung KS8500 TV

Software:

Jellyfin Server: 10.8.13
Jellyfin for Android TV App: 0.16.0
Android TV OS Version: 12
Android TV OS Security Patch Level: October 1, 2023
Kernel Version: 4.9.296

Jellyfin Settings:

Preferred Media Player: Exoplayer
Max Streaming Bitrate: 120 Mbit/s
Refresh Rate Switching: Disabled
Audio Output: Direct
Bitstream Dolby Digital Audio: Yes
Bitstream DTS Audio: Yes

CCwGTV Settings:

HDMI-CEC: Enabled
Resolution: 4k 60Hz
Dynamic Range & Color Format: HDR / Always HDR / YCbCr 4:2:0 10-bit
Match Content Frame Rate: Seamless
Allow Game Mode: False
Video Formats: HDR10, HLG. / Disabled Formats: Dolby Vision, HDR10+.
Audio Formats: Dolby Digital, Dolby Digital Plus, Dolby Atmos with Dolby Digital Plus, DTS

Denon Settings:

ARC: Off
Video/4K/8K Signal Format: Enhanced
Video/HDCP Setup: Auto

Are the TVs from the same vendor? Since my setup is through an AVR, that could very well have to do with it. I had a bunch of issues when directly connecting to my TV.

KirovAir commented 9 months ago

Sorry for the late response. The TV's are from different vendors, one is an LGC8, the other one is an ancient Sony.

I could not make it work, even with your settings and a lot of other tweaking. It seems the chipset can not handle certain 265 files, even with low bitrates. (Or maybe my device is faulty?) For now, I compiled a Jellyfin version with h265 capabilities disabled so transcoding will always be forced which works wonderfully. Since my server has quicksync capabilities I don't mind the transcoding and compatibility is 100% now which is a must for my parents where the device is placed. :p

Thanks for the help anyway and merry X-mas. :)

KirovAir commented 9 months ago

A small update: First of all Plex has the exact same playback issues using the video files as Jellyfin has. It wants to directplay them but the playback is choppy/stuttery. The files are not 'huge' in bandwidth, I'd say way below average (2GB for a HEVC movie) and there is plenty of network speed available. Not sure what mediaplayer Plex is using under the hood but probably ExoPlayer. I've tried several other external media players and they all struggle with the problematic files. (The files play fine when directly played on my LG C8 using Jellyfin)

I've found out that another brand of TV has the same issue with Jellyfin installed directly on the TV. The exact same video files give these problems when playing using ExoPlayer. The TCL QLED 43C643.

So my best guess is that the framerate or compression rate is giving some hard times to the chips used in the TCL and CCwGTV. In all cases external subs (SRT) are loaded and displayed. In all cases there is no external receiver for the audio present so 2.0 audio is used. Could that be an issue as well when needing to downmix 5.1 or 7.1 audio for the client? The choppyness is not 100% consistent which makes me think it's a CPU decoding limitation. But it might be the framerate as well as I'm not experienced enough in video.

If I have another moment I'll try to get some more detailed results. Just putting it out here for other people that might encounter the same.

tsiktsiris commented 8 months ago

My CCwGTV (Sabrina) has also framedrops/microstuttering every 2-10 seconds when directly playing 4K HEVC.

No signs of thermal throttling on the Chromecast (according to logcat temperatures reported by ThermalService). I noticed that it gets worse after opening other apps (such as youtube) and switching.

This issue happens also with the previous versions of jellyfin and androidtv client using the CCwGTV on a Samsung S95B paired with HW-Q800. I cannot reproduce it on a Sony X95J.

best-74 commented 7 months ago

I'm having major issues with my ccwgtv also. I don't think this has anything to do with jellyfin. More likely Google who have broken something with the last update.

AKK9 commented 6 months ago

Enabling Developer Options and enabling the Disable HW Overlay option fixes these issues in Jellyfin and Plex for me. I don't know why or how.

Unfortunately, this setting does not survive a reboot so you need to check that it's enabled occasionally.

brianjmurrell commented 4 months ago

I have done the Developer Options -> Disable HW Overlay option as I read about it elsewhere and it does not resolve the issue with my CCwGTV 4K also plugged into a Denon receiver -> LG TV.

jellyfin-bot commented 6 days ago

This issue has gone 120 days without comment. To avoid abandoned issues, it will be closed in 21 days if there are no new comments.

If you're the original submitter of this issue, please comment confirming if this issue still affects you in the latest release or master branch, or close the issue if it has been fixed. If you're another user also affected by this bug, please comment confirming so. Either action will remove the stale label.

This bot exists to prevent issues from becoming stale and forgotten. Jellyfin is always moving forward, and bugs are often fixed as side effects of other changes. We therefore ask that bug report authors remain vigilant about their issues to ensure they are closed if fixed, or re-confirmed - perhaps with fresh logs or reproduction examples - regularly. If you have any questions you can reach us on Matrix or Social Media.