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

Buffering Bug #163

Closed
neo-neo1 opened this issue Jun 24, 2021 · 213 comments
Closed

Buffering Bug #163

neo-neo1 opened this issue Jun 24, 2021 · 213 comments
Labels
bug Something isn't working resolved in alpha/beta

Comments

@neo-neo1
Copy link

neo-neo1 commented Jun 24, 2021

  • Add-on Version: 6.8.15
  • Kodi Version: 18.9
  • Kodi GUI Language: English
  • Operating System: CoreELEC 9.2.7
  • Hardware: ODROID-C2 (Amlogic S905 SoC)
  • Operating System Language: English

Several people have all recently reported this same issue at Kodi forums - YouTube Addon (last page). This is a reproducible problem. When playing videos from a playlist after 2-3 videos the next video that starts will buffer every several seconds.

I’m able to open a new video that won’t buffer but If I go back to the previous video which had buffering issues it will always have buffering issues unless I restart Kodi device or delete cache and database from YouTube addon settings.

This is not a network or device issue.

Edit: (Additional detail) It doesn’t only happen to videos in a playlist. Usually after watching several videos at random as well. After a Kodi restart I haven’t had the first video I opened buffer, usually after watching several.

In this YouTube Add-on settings I changed the cache size and video settings to every available option yielding the same result.

Been using this Addon since 1.0.

@neo-neo1 neo-neo1 added the bug Something isn't working label Jun 24, 2021
@wagnerch
Copy link
Contributor

wagnerch commented Jun 24, 2021

Also affects:

  • Add-on Version: 6.8.15
  • Kodi Version: 19.1
  • Kodi GUI Language: English
  • Operating System: LibreELEC 9.95.5
  • Operating System Language: English
  • Hardware: Raspberry Pi 4B 2G

With or without MPEG-DASH, same effect.

@pbo10
Copy link

pbo10 commented Jun 25, 2021

I have what sounds like the same issue on an NVidia Shield running Kodi 19.1.

It seems fairly random and I'm not using playlists, but every couple of videos I try to play buffers to the point of being unwatchable. If I stop the video and start again a few times eventually it runs fine.

@asavah
Copy link

asavah commented Jun 26, 2021

Can confirm this too.
Happens randomly with some videos, I don't usually use playlists.
Youtube addon is configured to prefer vp9/webm.
Stopping the video and starting it again usually solves the issue.

@wagnerch
Copy link
Contributor

Also affects:

Add-on Version: 6.8.15
Kodi Version: 19.1-ish
Kodi GUI Language: English
Operating System: CoreELEC 19.2rc2
Operating System Language: English
Hardware: Amlogic S905D 2G

Restarting the videos doesn't fix it for me, it just ends up buffering in pretty much the same spots, within a few seconds it. However, restarting Kodi (via systemctl restart kodi) does clear the issue.

@wagnerch
Copy link
Contributor

Here is a snippet of a log, a much much larger log spanning ~20 hours is available. It shows the video playing just before fine at 08:04, and then the stuttering/buffering happening on the video starting at 08:16

https://paste.ubuntu.com/p/RzRFzcYhQS/

I also tried to restart the same video, and pretty much buffers in the same exact spots. Restart kodi, and video plays fine.

@neo-neo1
Copy link
Author

neo-neo1 commented Jun 27, 2021

Also affects:

Add-on Version: 6.8.15
Kodi Version: 19.1-ish
Kodi GUI Language: English
Operating System: CoreELEC 19.2rc2
Operating System Language: English
Hardware: Amlogic S905D 2G

Restarting the videos doesn't fix it for me, it just ends up buffering in pretty much the same spots, within a few seconds it. However, restarting Kodi (via systemctl restart kodi) does clear the issue.

I can also confirm restarting videos doesn’t fix the buffer issue. Only a Kodi device restart or clearing database and cache from Kodi YouTube Add-on settings.

To elaborate on my original post it doesn’t only occur to videos in a playlist. After a Kodi restart I haven’t had the first video I opened buffer, usually after watching several.

In this YouTube Add-on settings I changed the cache size and video settings to every available option yielding the same result with this buffering bug still persisting.

@neo-neo1 neo-neo1 changed the title Repeat Buffering Buffering Bug Jun 27, 2021
@Isayso
Copy link

Isayso commented Jun 27, 2021

This occurs also if I send videos from other devices via html POST to play queue. And is independent to settings of cache in advancedsettings.xml

Add-on Version: 6.8.15 and 6.8.14 and 6.8.13
Kodi Version: 19.1
Kodi GUI Language: English
Operating System: LibreELEC 10.0
Hardware: Raspberry Pi 3 and 3+

@dchristl
Copy link

Can also confirm this issue. I always use POST for playing multiple videos in queue. Restarting the video doesn't work for me either only a Kodi restart.
I often watch multiple short (<15 min) videos without any issue. Sometimes 2 large videos are a problem. It seems a longer playlist (more time not more items) lead earlier to this issue.

Add-on Version: 6.8.15
Kodi Version: 19.1
Kodi GUI Language: German
Operating System: Ubuntu 20.04.2
Hardware: AMD Athlon 8 core, Nvidia Geforce GTX275, 16 GB RAM

@brainwaster
Copy link

brainwaster commented Jun 28, 2021

Same issue for me, happens randomly, it can happen immediately or after playing a few vids. I can fix it without a restart by turning off MPEG DASH if it's on or turn it on if it's off.

ADD-on Version: 6.8.15
Kodi Version: 18.9
Kodi GUI Language: English
Operating System: LibreElec 9.2.6
Hardware: Intel Core Duo Quad Core 4ghz, 4gig ram, AMD Radeon HD 4550

@pbo10
Copy link

pbo10 commented Jun 30, 2021

I've been looking around some more and I think this issue may be down to YouTube throttling on their side. If you read the youtube-dl reddit forum they seem to be aware of throttling being done by Youtube now, I also tested myself downloading a list of videos with youtube-dl and the first few start downloading at 2mbps+ then drops to 50kb/s. Not sure what triggers the throttling yet though.

ytdl-org/youtube-dl#29326

I think it then stops throttling after a short time, so perhaps just by exiting Kodi and restarting it allows enough time for the throttling to have stopped.

@wagnerch
Copy link
Contributor

This comment is interesting, it is suggesting that there is a "n" query parameter that YouTube is putting this parameter in their URLs and the client-side needs to modify it and send it back as a signature/challenge of some sorts.

ytdl-org/youtube-dl#29326 (comment)
ytdl-org/youtube-dl#29326 (comment)

@pbo10
Copy link

pbo10 commented Jun 30, 2021

Yea they seem to have the fix but no one has had time to implement it yet. Hopefully the fix works and can be added here as well.

@drrak
Copy link
Contributor

drrak commented Jul 4, 2021

Translator:
I have a problem with buffering too. Not only in playlists, just in randomly played videos.

RPi4, LibrELEC 9.95.4, Kodi 19.1, YouTube 6.8.15+matrix.1

@RNavega
Copy link
Contributor

RNavega commented Jul 26, 2021

The yt-dlp project seems to be using the workaround of forcing / spoofing an Android device?
But it's not clear how this is done internally (what kind of headers they're changing etc) that we could do from plugin.video.youtube.

https://github.com/yt-dlp/yt-dlp/blob/master/yt_dlp/extractor/youtube.py

@clovk
Copy link

clovk commented Aug 5, 2021

This has been plaguing me now for months and I've tried YouTube addons 6.8.10 -15, from repos and downloads, Libreelec 9.2.6, 9.2.8 and 10.1, Odroid C2, C4 and Raspberry pi 4 (all buffer even 1080 at 30fps) and upgraded my network to a i5 pfsense and cat6 cabling, nothing worked. I think there are 2 issues here:

  1. Playing from (long) playlist:
    Videos randomly start buffering. Rebooting, waiting (1-2 min), or playing something from a local (network) source fixes the problem, for the next few videos. I think it's a Kodi - Youtube-addon problem (just a feeling, not a programmer).

  2. Certain videos always buffer.
    Rebooting, reinstalling, clearing various add-on, system caches does nothing. Here is a partial list of channels who's videos always buffer:
    https://youtube.com/c/MxRPlays
    https://youtube.com/c/ForgottenWeapons
    https://youtube.com/c/JerryRigEverything
    https://youtube.com/user/DemolitionRanch

Downloading videos from these channels with youtube-dl (on x86 Ubuntu), yields similar download speeds to other videos. Here I think google is throteling somehow...

Also, is it just my YouTube addon, that only buffers a few seconds and gets cleared everytime I scrub or play/pause? So I can't just wait for it to buffer, since the buffer resets when I click play, or go back 10 seconds... I've played with the buffer size in the add-on settings and I have an advanced settings file for buffering everything to 400mb on a RPI4 2gb, which all other local/online videos respect, just not the YouTube add-on.

@RNavega
Copy link
Contributor

RNavega commented Aug 8, 2021

Someone from Pytube generously wrote the functions needed to parse and generate the "n" token: https://github.com/pytube/pytube/blob/master/pytube/cipher.py

@anxdpanic
Copy link
Owner

Thanks for the heads up @RNavega
#176

@anxdpanic
Copy link
Owner

I've created an alpha build with this included, https://github.com/anxdpanic/plugin.video.youtube/releases/tag/6.x.x-dev

@gc248
Copy link

gc248 commented Aug 9, 2021

Thanks for the new build! While I'm not skilled enough to contribute code, I can at least test it. I've installed it on my main system and will see how it behaves over the next few days. I hope others will do the same.

@pnperehod
Copy link

alpha1 didn't fixed the bug - still endless buffering after 3-4 videos

@AlexNk
Copy link

AlexNk commented Aug 9, 2021

Tested the alpha build - it seems that the videos are starting faster now, but I still got the buffering issue twice in 20-25 videos. It might be less often than before, but I am not sure about this - need more tests.

@pnperehod
Copy link

Tested the alpha build - it seems that the videos are starting faster now, but I still got the buffering issue twice in 20-25 videos. It might be less often than before, but I am not sure about this - need more tests.

Almost the same here, but number of videos smaller, from 3 to 7 оn average

@neo-neo1
Copy link
Author

neo-neo1 commented Aug 9, 2021

I've created an alpha build with this included, https://github.com/anxdpanic/plugin.video.youtube/releases/tag/6.x.x-dev

Unfortunately the buffering did not go away and still persists same as before. After a few videos at random it will start buffering to unwatchable conditions. Thank you for your attempt.

@neo-neo1
Copy link
Author

Just as an update to the Alpha build I believe it may have at least done something. If a video starts buffering I can stop and reopen it and it’ll play fine. Before I had to restart Kodi to get the same video exhibiting buffering to play normally.

@arcaine2
Copy link

arcaine2 commented Aug 14, 2021

@neo-neo1, if that's the behaviour, then it works for me like this for a very long time. I'm currently on 6.8.16+matrix1 version, but it's been a few months like this. Sometimes i get the buffering as soon as i start a video, but most of the time it is enough to stop and start it again. Sometimes 2-3 times, sometimes with a small, couple seconds delay, and it plays fine then. I never had to restart Kodi as a whole to get it played correctly. It behaves like this for me on Shield TV, as well as a on Linux based PC i'm using. I haven't tried it on Windows at all.

@pix0wl
Copy link

pix0wl commented Aug 27, 2021

Version 6.8.17 fixed this problem for me.
Thanks to ramateur and anxdpanic. 👍

@DmnzH
Copy link

DmnzH commented Aug 27, 2021

6.8.17+matrix1 still not working for me unfortunately, buffering still happen occasionally.
Kodi 19.1 Matrix, Ubuntu 20.04, x64, HD 5450

@maxberghammer
Copy link

alpha6 works perfectly on leia!

@JORGETECH
Copy link

6.8.18 alpha6 fixed the buffering issue for me under LibreELEC 9.2.8 Rpi4 version. Very big thanks to the devs!

@Naciim
Copy link

Naciim commented Oct 23, 2021

@toupeira thks man, it works.
@damnms I have the same error, you have to install the matrix version zip, it works for me.
@anxdpanic thank you for the fix, it works very well on raspberry pi 2

@MMan1982
Copy link

Guys,thank you very much for the fix,working perfectly!!;)

@Drag0nFly
Copy link

Installed the latest alpha release for Leia – 6.8.18.alpha6 (https://github.com/anxdpanic/plugin.video.youtube/releases/download/6.x.x-dev/plugin.video.youtube-unofficial-6.8.18.alpha6.zip), it worked, but only for the first video played.

After that, the original problem with no buffering is back, making videos unplayable.

@RNavega
Copy link
Contributor

RNavega commented Oct 23, 2021

@Drag0nFly if you try the same video at the exact same quality level, on either the official YT site or app, do you also get the buffering? Just to rule out the occasional slow network day

@Drag0nFly
Copy link

Yes, I did that. Once the issue occurs, videos do not play due to zero buffering. This is running off a dedicated fibre connection, so I can safely rule out intermittent connection isues (the bitrate for these streams are so low anyway that it would make little difference)

Obviously in a standalone browser none of these issues occur, just on Kodi using the plugin.

I did however restart the Kodi (18.7) instance a couple of times and re-tested, and witnessed the same problem after the first few restarts. Later, when I tested the videos after another restart they did play, although I only tested 2-3 of them due to time constraints.

Not sure what to make of it, but will let you know if it re-occurs when I test it later today (and look for any hints in the debug log, if anything logs to it)

@redstorm1
Copy link

When's this being pushed to the repo. such a frustrating bug, glad its fixed.

@anxdpanic
Copy link
Owner

6.8.18 should be available from the official repository already.

@redstorm1
Copy link

I mean the kodi repository not github.

@anxdpanic
Copy link
Owner

So do I,
xbmc/repo-plugins#3769
xbmc/repo-plugins#3768

https://mirrors.kodi.tv/addons/jarvis/plugin.video.youtube/
https://mirrors.kodi.tv/addons/matrix/plugin.video.youtube/

@redstorm1
Copy link

Thanks, refreshing the repo now reports .18 instead of .17 updated.

@DjDiabolik
Copy link
Contributor

DjDiabolik commented Oct 26, 2021

@anxdpanic i hope i can install the final .18 unofficial version for your panicked repo :)

@blaudp79
Copy link

blaudp79 commented Oct 26, 2021

Disable "Yatse Kodi helper script" under program add-ons if still does not work

@Putr
Copy link

Putr commented Oct 26, 2021

Thank you @anxdpanic for 6.8.18, it fixes the issue. THANK YOU, it was VERY frustrating. Please set up donations, I owe you a few euros and so does everyone else in this thread.

@sTevefor3
Copy link

Well then. Another data point: I installed the 6.8.18 version a month or so ago, and it r̶e̶s̶o̶l̶v̶e̶d̶ squashed the bug.

And then this evening, the bug unsquashed itself...or so it appeared Dammit. Turns out my wireless AP range extender, which feeds my kodi box, needed to be rebooted. But before I did that, I ran SpeedTest on my kodi box, confirming that it wasn't 6.8.18 that was misbehaving, thank the Maker. Cheers!

@Killom
Copy link

Killom commented Jan 5, 2022

Looks like the "Buffering Bug" is back. I'm trying to watch a video right now, but the old symptoms are back.

Vers: 6.8.18

@RNavega
Copy link
Contributor

RNavega commented Jan 5, 2022

@Killom does this happen with other videos? Do you have the IDs or names of one or more videos that have this problem? Does playing the same video on the browser / official app have the same problem?

@Killom
Copy link

Killom commented Jan 5, 2022

@RNavega Same with every other video I'm trying to start

Example: zoCK3vMcZ-M

Running fine on Browser / YT App

Edit:

.. will post logs

@RNavega
Copy link
Contributor

RNavega commented Jan 5, 2022

@Killom thank you.

For me, on plugin.video.youtube that video is playing normal in either 1080 HD with Mpeg-DASH playback or 720HD with normal playback, and it caches a few seconds ahead too.

If it didn't play well on your browser or app then we could call it as a slow day on your connection, but since you said it plays fine in the official channels over there and I can't reproduce here on Kodi, then I have no idea =(

@Killom
Copy link

Killom commented Jan 5, 2022

@Killom
Copy link

Killom commented Jan 5, 2022

Ok, was just me ... Looks like HDMI cable/interference was the cause here. (Using 4B model) Had very bad WiFi Rx/Tx. Switched to higher channels on Router - Problem gone. Serious gourmet shit :D

@TheNetworkIsDown
Copy link

Ok, was just me ... Looks like HDMI cable/interference was the cause here. (Using 4B model) Had very bad WiFi Rx/Tx. Switched to higher channels on Router - Problem gone. Serious gourmet shit :D

Good ol' root cause analysis for the win ;)

@DjDiabolik
Copy link
Contributor

@Killom i have watched alot of video until 5 minutes ago..... all streamed whitout any issue.

DjDiabolik referenced this issue in Maven85/plugin.video.dazn Jan 17, 2022
@anxdpanic anxdpanic unpinned this issue Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working resolved in alpha/beta
Projects
None yet
Development

No branches or pull requests