jellyfin / jellyfin-webos

WebOS Client for Jellyfin
https://jellyfin.org
Mozilla Public License 2.0
623 stars 60 forks source link

Stuttering playback on jellyfin-webos app, but perfect playback on LG browser web player #170

Open Cobra-Firefly opened 10 months ago

Cobra-Firefly commented 10 months ago

As the title suggests, I am having trouble playing video smoothly on the jellyfin-webos app on an LG C2 tv. Even though the app indicates that it's Direct Play, every couple frames the video stutters. It's unwatchable. The same content plays perfectly fine in the LG built in browser through jellyfin web player. Unfortunately, the interface in the browser is less than ideal. The fonts are serif and ugly and it would be great to be able to play things properly in the app.

I understand that the jellyfin-webos is just a wrapper for the web player, so what could possibly be going wrong? Given that everything is smooth in the LG browser, it would suggest the problem lies with jellyfin-webos.

Any help in troubleshooting would be appreciated.

dmitrylyzo commented 10 months ago

App and browser use different web engines. Moreover, we can't reliably detect webOS version in the browser, so the device profile is more restrictive.

Does it play Direct in the built-in browser?

Also, please provide the media info of the file you are having problems with (wrap it with a code block).

Cobra-Firefly commented 10 months ago

Thank you for the response @dmitrylyzo

Ah, I see. To answer your question: yes, it's Direct Play in the built-in browser as well. The same stuttering behavior happens with Direct Stream too. If it helps, the files in question are rather large (30GB +), but as I said they play fine in the built-in browser. They are a mix of h264 and h265. As for settings, all Audio and Video Quality settings are set to "Auto" in the app and the browser web player. I've tried enabling and disabling "Prefer fMP4-HLS Media Container" - doesn't seem to make a difference. The TrueNas Scale system the server runs on is never taxed to 100% or anything like that during playback. Resource usage looks pretty normal.

Hopefully some of the above explanation helps. I will try to get a more detailed media info for you. Most content is likely 3840 x 2160, mkv, HEVC Main 10.

jasondaigo commented 10 months ago

Just want to mention that some settings,at least in the past doesn't take effect on the webos app for me immediately. Especially the hls option or audio channels. I had to quit the app and start it again. As I mentioned in another issue half of my anime shows are stuttering as well. However im using a c2 aswell and 4K with hdr or dv works nice. In general movies and tv shows usually works excellent.

Cobra-Firefly commented 10 months ago

I tried loading and quitting the app, restarting the jellyfin server on TrueNas, and for the time being the webos app seems to be working as well as the browser player. Logically, nothing has changed, so I have no idea what's going on. But the important thing is that, for the time being, the playback on the webos app is working properly.

Thanks for the responses guys.

MichaelSWT commented 10 months ago

I’m experiencing similar issues using the following setup: TV-Set: LG 50UP75009LF webOS TV version: 6.3.3-439 (kisscurl-kinglake) Jellyfin app version: latest

Server System: Raspberry Pi 4B, 2 GB RAM, latest Debian Bullseye (headless) Jellyfin Server 10.8.10 running in Docker container The Raspberry Pi’s stays at 47 to 52 °C, even when I call three streams from different devices.

other clients: MacBook Air 13" 2015, Mac OS Monterey 12.6.8 iPhone X, iOS 16.6, Jellyfin Mobile app 1.5.0 (5.5.0.0)

all devices connected via Wifi

Two movie files on the server:

1 is 39 MB, AAC/H264, 960x540, 2324 kbps, 30 fps, 2 minutes

2 is 561 MB, AAC/H264, 1280x720, 11918 kbps, 30 fps, 7 minutes

1 plays flawlessly on all devices

2 plays fine on laptop (Safari web browser) and iPhone (both in app and web browser).

Nevertheless, there are issues on the telly with the video stopping every 20 seconds or so for about 10 seconds. There is no difference whether I use the Jellyfin webOS app, DLNA streaming or the webOS web browser. I’ve also tried to forward the video to the telly from both laptop or iPhone using LG’s built-in AirPlay capabilities. I have indeed experienced this before with AirPay’ing local high res videos from any of the Apple devices.

Taking all this into account, I don’t think the stuttering has anything to do with either the Jellyfin server nor the client app on the LG telly. Having a closer look at the the playback bar at the bottom, the buffer builds up very slowly and with little room ahead. So it often gets “eaten up” by the replay “pacman”, then the movie stops until there’s enough buffered data again. To me it seems that the TV set’s Wifi interface simply isn’t capable of enough throughput to ensure sufficient buffering, causing the playback stutter problems. Another thing is that I can address the server as “raspberry.local:8096” from both Macbook and iPhone, the webOS web browser won’t solve the name, I have to enter the IP address. Could it be that the whole Wifi thingy is a bit flawed on the LG?

Do you have the tellies on a wired ethernet (preferably 100MBit or Gbit) connection? If the buffering issues are also present under these circumstances, it might be that the LG CPU is simply too slow to handle bit rates of 12,000 kbps. Which would make the LG devices unfit for purpose from my needs.

Smirra commented 10 months ago

Okey I have had so much troubleshooting with an issue like this, i.e. that the stream just starts to stall after some minutes and then never really recovers, with the jellyfin gui / RBpi acting very sluggish/overworked in period following the stall.

In my case it was that jellyfin was writing the ffmpeg-buffering to the SD-card disk / runtime disk. This kind of buffering jellyfin... always does? The movie which I was troubleshooting this with it honestly just remuxed it and sent the stream in that fMP4-HLS Media Container. This constant buffer-writing just killed the OS speed slowly when streaming a big movie, leaving no room for the RBpi to do something else. It constantly writes buffer split over hundreds of files. Somewhere along my weeks of trial and error I read that it was recommended to perhaps move this to a solid state drive. In my case i just tried to write the buffer to my external hard drive, which also seems to work fine.

So to be more precise of what I did to make it work, in for example a docker-compose.yml

  volumes:
    - ./config:/config
    - ./cache:/cache
    - /your-favorite/fast-writing-mount-point-here:/config/transcodes

I use a RBpi 4 with 8gb of RAM with a 32 gb microSDHC UHS-I card

Poltergeisen commented 4 months ago

I have the same problem. It seems to happen when more music starts to play, like during ED and OPs. I'm direct playing through the app, but subtitles do exist. Not sure if that's a factor at all.

Playing the same file on Kodi there is no issues with stuttering

aiac commented 2 months ago

Do you running Jellyfin behind proxy? After a lot of testing I found out, that when I expose port to Jellyfin directly I can play 30GB+ files without freezing. For me it happens while using traefik domain (with SSL cert), even that this is the same local network.

And even with proxy my PC and phone manage to play file smoothly, it freeze every minute on WebOS TV (each device in direct play mode, no transcoding).

Poltergeisen commented 2 months ago

Do you running Jellyfin behind proxy? After a lot of testing I found out, that when I expose port to Jellyfin directly I can play 30GB+ files without freezing. For me it happens while using traefik domain (with SSL cert), even that this is the same local network.

And even with proxy my PC and phone manage to play file smoothly, it freeze every minute on WebOS TV (each device in direct play mode, no transcoding).

Yes I also use traefik as a proxy.

akmail commented 1 month ago

not sure my issue relates to this. but my LG TV freezes from time to time for 10-30 seconds... I have no idea why. even during direct-playing. was there any actions taken based on this thread? how can I debug where's the issue?

akmail commented 1 month ago

just in case anyone is facing something similar. I might have found the root cause: my wifi router, that is acting as a switch, was causing network problems. restarting it seems to bring ping response time back to normal. I'll monitor how jellyfin behaves and let you know. After a lot of searching on Google, it seems that it might be a problem of rather the network than Jellyfin itself. allthough I don't understand why it doesn't give the memory back to the system. Maybe it's a .NET thing. another reason for me to hate Microsoft. (I don't use windows at home, hence no microsoft products). it's a pity that someone decided to choose a framework from them (but this is my personal opinion, not related to this topic actually)

JosVerheij commented 3 weeks ago

As the title suggests, I am having trouble playing video smoothly on the jellyfin-webos app on an LG C2 tv. Even though the app indicates that it's Direct Play, every couple frames the video stutters. It's unwatchable. The same content plays perfectly fine in the LG built in browser through jellyfin web player.

Facing the same issue. Very frequent, but irregular frame drops when playing (high bitrate) content through the WebOS app. Smooth playback through the WebOS browser.