Skip to content
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

Live Streams Freezing - Kodi support says its the Addon! #307

Open
Malkovexsur opened this issue May 19, 2017 · 41 comments
Open

Live Streams Freezing - Kodi support says its the Addon! #307

Malkovexsur opened this issue May 19, 2017 · 41 comments

Comments

@Malkovexsur
Copy link

Hello,
I am having the following issue:

Problem:
When watching a Live stream in Kodi via Twitch the stream will freeze up for a moment and then looks like it’s fast-forwarding to catch back up to live to play normally for a few seconds and repeat or just stop completely. This only happens with the live streams with Kodi as I can watch live streams fine via Chrome/Firefox/Edge. Any help would be greatly appreciated.

Kodi Version: 17.1 (Git:20170320-fc1619b)
Windows 10 Pro Version: 1607 (14393.1066)
CPU: AMD FX 8350 Eight-Core Processor 4.00 GHz
RAM: 16.0 GB
Video Card: GeForce GTX 1070
Video Driver: 376.53
Audio: HDMI NVidia High Definition Audio
Log: http://paste.ubuntu.com/24527462/
Speed Test: http://speedof.me/show.php?img=170507030715-7006.png

This seems like a playback issue but Team-Kodi Members are telling me it's an addon issue.
Thread: http://forum.kodi.tv/showthread.php?tid=313859

@anxdpanic
Copy link
Owner

Looks to be either ffmepg/kodi or connection related(browsers hide these better in my experience). You can enable component logging for ffmepg which may tell more of the story. It's out of my realm but if you post a log with that enabled I can take a look at least. It looks like the decoder is always playing catch up in this log.

@Malkovexsur
Copy link
Author

Hello Anxdpanic,

Thanks for your fast response! Here is the log with the requested logging.
(Hope I did it correctly)
Log: http://paste.ubuntu.com/24607450

Regards,
Malkovexsur

@untoreh
Copy link

untoreh commented May 20, 2017

this happens when there is not enough bandwidth, when the bottleneck happens you see this behavior where the stream tries to catch up indefinitely even after network conditions have improved, the fast forward only works for small hiccups, but if it lasts longer then it maybe goes into a loop where download segment->see not in sync->fast forward. To fix it should just close and re-establish the connection after like 10 seconds I think

@Malkovexsur
Copy link
Author

Hello Untoreh,

Ok here is my issue with the argument "It's your Bandwith" I can load up a stream in Kodi and via a browser and only Kodi will have issues, in fact, I can have 15+ different streams going in a browser before I see any buffering issues while the one stream in Kodi is fubar. Personally, think this is a Live Playback issue but as stated the "Team-Kodi Members" seem to think its addon related.

Regards,
Malkovexsur

@untoreh
Copy link

untoreh commented May 20, 2017

mmhh, reading a second time seems like it is indeed a different problem. If you have already disabled hw accel, try disabling kodi colour management

@anxdpanic
Copy link
Owner

It can still be connection outside of bandwidth, and a browser would still hide this better imo. Latency/jitter for example, the stream is segmented. It's not add-on related, and nothing in the logs jumps out at me regarding Kodi/ffmpeg itself either.

I've seen youtube users mention similar issues for live streams in going from v16.1 to v17 as well, so may be worth a shot in your case to try v16.1 to narrow things down.

Sorry I can't provide more help.

@MrSprigster
Copy link
Collaborator

MrSprigster commented May 20, 2017 via email

@Malkovexsur
Copy link
Author

Hello Everybody,

@untoreh I can not find the option to disable that.
@anxdpanic I will try that and report back.
@MrSprigster Seems for me peak times are 24/7...

Regards,
Malkovexsur

@Malkovexsur
Copy link
Author

Reverted back to Kodi 16.1 issue still persist.
Log: http://paste.ubuntu.com/24614351/

Regards,
Malkovexsur

@untoreh
Copy link

untoreh commented May 21, 2017

It is in kodi settings->system->display.

@MrSprigster high jitter with high bandwidth, mobile?

The in browser player skips aggressively, but I think its only possible with multithreaded segments, because you can't jump to the next segment if you don't have it :p , also it generally helps circumventing traffic shaping scenarios which the browser might elude

@MrSprigster
Copy link
Collaborator

@untoreh I'm in an over subscribed area and I suspect the ISPs hardware just maxes out every so often, resulting in latency spikes.

@rdruilhe
Copy link

Hello,

I am experiencing the same issue than @Malkovexsur. My stream is freezing every 10 seconds and then playback the stream. This problem occurs since around 2 weeks now, 24/7. Since the update of the plugin I guess. At first, I was on the version 15 of Kodi so I decided to move to the last version of Kodi but the problem remains.

I installed the Youtube addon and the TED Talk addon to see if there is problem regarding others video addons. Everything is fine, but those are not live streams, so it mights not be relevant.

I also looked at my network flow on my gateway and it seems my bandwidth is very low for the Twitch addon compared to the others addons of Kodi. Could it comes from the CDN of Twitch? I found this problem on Twitter but it seems it has been resolved.

Thanks,

Regards.

@cmsimike
Copy link

cmsimike commented May 22, 2017

I have had the same issue (#301) for a few weeks, and as myseroiusly as it started, it has ended. All through this time, my pings were fine and I was always able to stream video from other live sources (YouTube).

The only thing I was able to figure out was there seemed to be a bad server on Twitch's (or AWS') side. I was able to verify my physical/tcp/IP connection was completely OK to twitch, but the issue came when I tried to connect via openssl to twitch's servers. Every so often, the HTTPs connection would stall issuing the command (I would send data out but never got any data back).

I don't know why Kodi is really bad at dealing with this issue vs a browser, but I was able to confirm my browser had a similar issue (I would see API calls to kodi (getting my friends list for instance) stalling) but the twitch player would see the stalled HTTPs connection as regular network lag, then try to get a lower quality video which would initiate a new HTTPs request and basically get around the first stalled request. Kodi must not try to fallback to lower-bandwidth URLs on stall.

Here are the command I'd run:
openssl s_client -connect api.twitch.tv:443 -debug

(Sorry for linking the tweets but this is all the record I have for my test runs):
Here is a request that successfully creates the HTTPs handshake:
https://pbs.twimg.com/media/C_udO4HUMAAK1KO.jpg:large
and here is one that stalled:
https://pbs.twimg.com/media/C_udXQ_UQAAEb6i.jpg:large

I was also able to confirm this exact problem at two locations that shared my ISP, but a third location that had a different ISP didn't have the problem that I could tell.

@cmsimike
Copy link

I would like to note that I saw the issue basically 24/7 for 2 weeks. I don't believe it was a bandwidth issue on either side.

@cmsimike
Copy link

Also, all through this time, my Apple TV's Twitch app (Twitchy) was fine. I did notice significant video degradation every so often but this is probably what the browser does - it notices a network stall and instantly tries the lower-bandwidth version of the video

@untoreh
Copy link

untoreh commented May 23, 2017

@MrSprigster could it be that on congestion hours your ISP starts doing some traffic shaping? Are you sure that the downstream bitrate from twitch is constant during the spikes? It might be that just the twitch connection gets throttled.

@MrSprigster
Copy link
Collaborator

MrSprigster commented May 23, 2017 via email

@L2501
Copy link

L2501 commented May 31, 2017

main problem here is that ffmpeg hls client is garbage and doesn't even support basic stuff like http keep-alive, then there is the problem with kodi 17 cache fast forwarding on buffer fill. don't expect this to get fixed because everyone thinks internet streaming is evil piracy. use streamlink or pay someone to write a proper HLS inputstream.

@richhard1
Copy link

richhard1 commented Aug 11, 2017

Been getting random micro freezes using twitch. I'm on 17.3 on a VU Duo 2. There's no fast catch-up, just an audio and visual micro freeze, I'd say once every 40 seconds or so then returning back to live . I use twitch everyday, it starts to happen after around 45 minutes, I have to stop and restart the stream to help clear the freezing.

@DarkDefender
Copy link

I would just like to chime in and say that I have the same problem as @Malkovexsur described. This has been going on for quite a while now and has made watching twitch via kodi impossible for me.

As others has pointed out it works fine via Chrome/Firefox.

However, it also works flawlessly with mpv: https://github.com/mpv-player/mpv
And IIRC, mpv also uses ffmpeg do decode the stream. I'm running gentoo and I compiled kodi myself and forced kodi to use my systems ffmpeg. So I think we can rule out ffmpeg version being a problem.

I think mpv is using youtube-dl to stream from twitch: https://github.com/rg3/youtube-dl/
Maybe using that for this plugin would solve this problem?

@anxdpanic
Copy link
Owner

v2.1.0-alpha includes inputstream.adaptive support (>=2.0.10) and may help with this issue.
https://github.com/MrSprigster/Twitch-on-Kodi/releases/tag/2.1.0-alpha

@cmsimike
Copy link

Excellent, thank you @anxdpanic !

@richhard1
Copy link

richhard1 commented Sep 29, 2017 via email

@anxdpanic
Copy link
Owner

anxdpanic commented Sep 29, 2017

Not quite sure what you mean. But to install twitch 2.1.0 alpha you need to install script.module.python.twitch 2.0.0 alpha first. The zip for both is included in that release link.
edit: And to use inputstream.adaptive requires inputstream.adaptive greater or equal to 2.0.10 (included in Kodi 17.4+)

@anxdpanic
Copy link
Owner

Sorry, that was my fault. I've updated the plugin.video.twitch zip on that release page. Should install now.

@richhard1
Copy link

richhard1 commented Sep 29, 2017 via email

@anxdpanic
Copy link
Owner

Re-download the same plugin.video.twitch zip(had a quick ghost change). The dependency issue should be resolved now.

@richhard1
Copy link

richhard1 commented Sep 29, 2017 via email

@richhard1
Copy link

richhard1 commented Sep 29, 2017 via email

@MrSprigster
Copy link
Collaborator

Since installing the 2.1.0 alpha and enabling inputstream.adaptive, I haven't seen any stuttering or stream freeze/buffering. Nice work @anxdpanic for implementing this functionality into the add-on.

@richhard1
Copy link

richhard1 commented Oct 1, 2017 via email

@anxdpanic
Copy link
Owner

Use inputstream.adaptive will be greyed out if you don't have the the inputstream.adaptive add-on (Kodi 17.4+ is required for version 2.0.10). If you are sure you have it, try restarting Kodi. If you feel it's greyed out in error provide a debug log please.

So far only encountered 1 stutter that quickly resolved itself since using it myself.

@Giacom
Copy link
Contributor

Giacom commented Oct 16, 2017

I'll still get stuttering if my connection becomes unstable for just a second. If I was watching through the website, it would lengthen the buffer so that it has enough room to wait for a stable feed. Is there something that can be done like here on Kodi?

@richhard1
Copy link

richhard1 commented Oct 16, 2017 via email

@anxdpanic
Copy link
Owner

@Giacom Not currently

@richhard1 being a linux based install, I don't believe inputstream.adaptive is usually installed by default. You can check if you have it by going to Addons - My Addons - VideoPlayer Inputstream - Inputstream Adaptive. If you don't see that, you'll have to install the appropriate package. Looks like common package names are kodi-inputstream-adaptive and kodi-addon-inputstream-adaptive not sure for openvix

@richhard1
Copy link

richhard1 commented Oct 17, 2017 via email

@untoreh
Copy link

untoreh commented Oct 17, 2017

for ubuntu it is in the official ppa unstable branch, direct link for amd64
https://launchpad.net/~team-xbmc/+archive/ubuntu/unstable/+files/kodi-inputstream-adaptive_2.0.18-3~artful_amd64.deb

@richhard1
Copy link

richhard1 commented Oct 17, 2017 via email

@joelpurra
Copy link
Contributor

joelpurra commented May 27, 2018

Installing and enabling inputstream.adaptive fixed a lot of twitch live streaming problems for me!

Fiddling with kodi's advanced video cache settings is a common suggestion for fixing stream buffering issues, but it seems to be a dead end for live twitch streams (on systems where other streamed HD contents plays smoothly). I propose that Twitch-on-Kodi adds a note in the main readme about making sure adaptive streams are enabled, perhaps with a suitable link on how to install it for different systems. See small patch in #379.


Installing the kodi-inputstream-adaptive package using apt-get on Raspberry Pi 3 Model B+ running Raspbian (stretch) is easy.

sudo apt-get install kodi-inputstream-adaptive

uname --all

Linux raspbian 4.14.34-v7+ #1110 SMP Mon Apr 16 15:18:51 BST 2018 armv7l GNU/Linux

kodi --version

17.6 Git:20171115-d69a54a Media Center Kodi
Copyright (C) 2005-2013 Team Kodi - http://kodi.tv

apt show kodi-inputstream-adaptive

Package: kodi-inputstream-adaptive
Version: 2.0.10-1~stretch
Priority: extra
Section: libs
Maintainer: peak3d info@peak3d.de
Installed-Size: 1,598 kB
Depends: libc6 (>= 2.17), libexpat1 (>= 2.0.1), libgcc1 (>= 1:3.5), libp8-platform2, libstdc++6 (>= 6)
Conflicts: kodi-inputstream-mpd, kodi-inputstream-smoothstream
Replaces: kodi-inputstream-mpd, kodi-inputstream-smoothstream
Homepage: http://www.peak3d.de
Download-Size: 369 kB
APT-Manual-Installed: yes
APT-Sources: http://archive.raspberrypi.org/debian stretch/main armhf Packages
Description: adaptive inputstream addon for Kodi
DASH/smoothstream inputstream addon for Kodi

@richhard1
Copy link

richhard1 commented May 31, 2018 via email

@Serg86
Copy link

Serg86 commented Oct 3, 2020

I've had this issue for over a year now, didn't bother with it up until now, but have looked into it now and I narrowed it down and have a temporary fix at least.

I changed some of the refresh rate settings in Kodi (Raspberry Pi 2 - LibreELEC 9.x) and it started working. I changed all the settings back and it still worked, so I have no idea what the problem was exactly but I at least isolated it to this. I use it as an always on device so Kodi needs to be restarted every couple of days, or it will run like crap until it crashes. I run a restart script via cron job every 2 days and after Kodi restarts, it started to freeze again. I changed one refresh setting In Settings > Player > Videos > Sync playback to display to OFF and it started working again, been watching a live stream for over an hour without issues, previously, it started acting up after only a few minutes.

I hope this gives the devs at least something to go on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests