Kodi Community Forum

Full Version: YouTube
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
(2021-10-05, 18:49)blueribb Wrote: [ -> ]
(2021-10-05, 18:44)Juppstein Wrote: [ -> ]It started a few weeks ago that suddenly every third or fourth video started to have problems when I tried to play it. Those videos just came to a halt after 10 seconds and it started to cache for several seconds until it continued, which then went on and on in a cycle. Usually I could stop the video, load another one and come back to this one and it would play back normally. 

Now since yesterday I have this issue on basically every youtube video and on netflix as well. Funny enough Twitch still works perfectly without this kind of issue. Videos from my NAS and ZattooPVR work as they should. To make matters worse, when I wait a few minutes and then try again, the same video which didnt work several times before, just plays normal :| 

I rebooted the kodi box, ran a network monitor on my cable line and did some latency and bandwith testing with no issues found, and I rebooted router and modem, so I think I can exclude the internet line as a potential issue.

Here's a log where I start Kodi, go to Youtube and start a random video from my subscriptions. Took about 15 seconds to start and then started to cache after 5 seconds or playtime or so.

https://paste.kodi.tv/vohihenise.kodi
This issue has been reported many times in this thread. So far, a fix hasn't been made. Be patient.
Same issue here - v6.8.17 on Kodi 18.9.0 and Ubuntu 18.04

As an aside, does anyone know if its possible to donate to @anxdpanic ?
The last time he made a expedited change in response to a YouTube update, I checked his website and his profile on this forum and couldn't find anything.
An Alpha version containing a fix went up on GitHub a few days ago and has made an enormous difference:

https://github.com/anxdpanic/plugin.vide.../6.x.x-dev

6.x.x-dev
@github-actions github-actions released this 3 days ago

[fix] Fix to_str |contrib: RNavega|
[fix] Fix ratebypass |contrib: RNavega|
[lang] translation updates from Weblate

Use Kodi's 'Install from Zip' feature to try this version.

I'm using it daily and haven't noticed any problems so far, but I have experienced an almost 100% reduction in the buffering problem.

GitHub 'Buffering Bug' thread: https://github.com/anxdpanic/plugin.vide...-934691213
plugin.video.youtube-6.8.18.alpha1+matrix.1.zip 

Worked for me !
No more buffering (yet)
Fingers Crossed

Thanks
Is it available on youtube's testing repo yet? I am interested in the kodi 18 version for now.

---edit
Answering myself. No it isn't (yet). Actually, the testing repo hosts v6.8.16 today...
(2021-10-06, 14:48)jim_p Wrote: [ -> ]Is it available on youtube's testing repo yet? I am interested in the kodi 18 version for now.

---edit
Answering myself. No it isn't (yet). Actually, the testing repo hosts v6.8.16 today...

It's available here.
https://github.com/anxdpanic/plugin.vide.../6.x.x-dev
I noticed that. I am just not in the "mood" for updating via zip every now and then. Plus, the reason I installed the testing repo is to get early access to the addon's development version when issues like this one occur. I have done the same for the twitch addon which is made by the same dev.

---edit
It got me so upset a few moments ago that I downloaded the zip and installed it manually. Let's see how it goes.
If anyone is following its updates from github, please post whenever there is a new dev version.

---re-edit
Nope, still the same issue. It plays for 5 seconds and then the endless buffering starts.
It even pops the "slow source" notification now. Please share any ideas.
Grabbed the zip... Like 4 or 5 there, no idea which to get. They all failed saying something about dependencies but finally found the right one.

Tried the video I was trying to watch again and worked finally no issues. Next video I clicked, back to the same issue.

When it works, it seems to play a second, blank for a second, then the video continues fine again.

The stutter and caching, sometimes switching resolutions works, but not an issue of my internet connection because sometimes 720 fails and 1080 works, so, sometimes going up works too. But today, it's just being a pain on every stream.
Basically the same issue here for me as THRobinson and jim_p, above.  I have a RPi 4 running LibreElec v9 (Leia?) and I installed pretty much all of the ones in that new github, one at a time.  Results for the non-matrix versions of the addon were basically that the first video would play correctly.  Thereafter major stuttering, buffering, and "slow source" notifications would occur about 5-6 seconds in.
(2021-10-06, 01:31)jmh2002 Wrote: [ -> ]An Alpha version containing a fix went up on GitHub a few days ago and has made an enormous difference:

v6.8.18.alpha1+matrix.1 is working great for me.

But it's important for me and other users to qualify how the YouTube addon is setup because this will cause any reported results to be quite different (and assuming that everyone's internet speed is fast enough - mine is quite slow somethimes in my current location. My primary device at the moment is also quite low powered so I've limited my quality settings too). So:

v6.8.18.alpha1+matrix.1
YouTube > Settings > MPEG-DASH > Use For Videos > Enabled
YouTube > Settings > MPEG-DASH > Video Quality > 360p
YouTube > Settings > MPEG-DASH > Limit to 30fps > Enabled

Enabling MPEG-DASH for Videos helps keep the audio level more consistent from one video to another, but InputStreamAdaptive currently only buffers a small number of seconds in advance, regardless of your Kodi buffer settings. This is not a YouTube addon bug. (I believe InputStreamAdaptive is being worked on and the amount of buffering may be increased for Kodi v20).

Disabling MPEG-DASH means the audio level can vary wildly from one video to another (as well as losing the various MPEG-DASH quality options) but it will mean that your Kodi buffer settings will be respected.

I haven't yet tested v6.8.18.alpha1+matrix.1 with MPEG-DASH > Disabled, but previously when the video started correctly Kodi would go ahead and buffer the correct amount of video in advance.

The key command CTRL + SHIFT + O (letter O) will toggle some video information on the screen and here you can see the amount of video that is being buffered in real time by looking at the section "forward:0 B XXX%".

If everything is rock solid perfect this percentage will be at or close to 100% most of the time. If not you can actually see the percentage decline as a video plays, until it reaches zero (run out of buffer) and the video will pause and try to rebuffer.

This is valid regardless of whether MPEG-DASH is enabled or disabled.

Hope this helps with everyone's troubleshooting and maybe also altering your configuration for playback to work more consistently in your particular situation Nod
About the different versions in github.There ones that have the -matrix suffix in their name are for kodi 19 and newer, because they are made with python 3. The ones that have no suffix are made with python 2 and can be installed up to kodi 18. That's why you get the unmet dependencies notification when you try to install it on a version that does not match.

As for the ones that have the -unofficial suffix, allow me to quote the dev's words from a reply he gave me... 4 years ago that I asked him.
Quote:Unofficial versions include view overrides, which is not allowed on the official repo.
So it really makes zero difference for the addon's core functionality, i.e. youtube playback, whether you use the unofficial version or the regular one.

Enough with the offtopic, back to the known mess. Right now, I am on libreelec 9.2.6 x64, aka kodi 18.9, with youtube 6.8.18-alpha1. My settings are: no mpeg-dash, default quality 720p and I am on a 12Mbps internet connection.
And it still has the buffering issues! The buffer percentage on the player debug info* text (= the text on the left corner that shows up when you press ctrl+shift+o) is exaclty the same as the one mentioned ON the video when it buffers. It is not for youtube only, it happens on anything that has to use the buffer.
And it slooowly goes from 0 to 75-80%, plays for 5 sec and the process repeats because, as averyone has noticed, youtube itself throttles the addon. On the same installation, twitch, which only buffers at the start of every stream, fills that buffer in like 1-2 seconds.

I use this vid for checking. It is guaranteed to show me the issue every time Tongue
https://www.youtube.com/watch?v=L2gT8fbEq54
(2021-10-07, 06:15)jim_p Wrote: [ -> ]I use this vid for checking. It is guaranteed to show me the issue every time Tongue
https://www.youtube.com/watch?v=L2gT8fbEq54

Just tested this video with my previously mentioned settings and got the following results:

YouTube > Settings > MPEG-DASH > Use For Videos > Enabled: Video plays perfectly with 100% buffer immediately filled (small buffer via InputStreamAdaptive)

YouTube > Settings > MPEG-DASH > Use For Videos > Disabled: Struggles to Buffer, I waited for it to buffer 100% (using Kodi buffer settings <memorysize>50000000</memorysize>, <buffermode>1</buffermode>, <readfactor>100</readfactor>) and then the video plays perfectly.

For these tests I was using LE10 on a very old and slow intel device and a less than 10mbps internet connection.

Maybe you can try using MPEG-DASH instead to see if works better for your situation Smile
If I have to use mpeg-dash (aka inputstream adaptive), which I don't see the point because that system can play no vid greater than 720p, AND fiddle around with advancedsettings.xml to find that "sweet spot" of configurations that allows smooth playback, I'd rather not use it at all. All this work in order to fix an issue which did not happen a week ago!

Also, if this throttling thing persists and the forementioned workaround does work in the long term, youtube's addon will become the most user unfriendly addon from the main repo because of the extra things the user has to do to make it work.
I made my first api keys back in 2017 for the first time, they stopped working sometime this year. I said I won't be making new ones, but I here I am, with new keys, because the invidious addon is not that good (in various aspects). Now this has to be done too, so as to avoid throttling! Obviously the addon is not to blame but youtube itself, however it is a lot of work even for an advanced user like me.
(2021-09-28, 16:15)burekas Wrote: [ -> ]
(2021-09-28, 15:37)burekas Wrote: [ -> ]A new issue (Maybe it already discuused before):

How can I see content in 4K and 1080p in the addon?
- The max quality I get in the list is 1080p.
- And when I select 1080p, kodi osd info shows that it's 720p.
I found this answer:
Settings - MPEG-DASH - Use MPEG-DASH
Settings - MPEG-DASH - Use for videos
Settings - MPEG-DASH - Video quality -> 4K

But when I run a 4k video from youtube I get those qualities:
...... , 720p, 4K
Why I don't get also the 1080p, 1440p (2K) qualities?

Does anyone know the answe for that?
Why can't I see all the qualities in the qualities dialog? (720p, 1080p, 1440p [2k], 2160p [4k])
Which video? You can run it through youtube-dl -F to see what resolutions it supports, e.g.
 
Code:
$ youtube-dl -F https://www.youtube.com/watch?v=L2gT8fbEq54
[youtube] L2gT8fbEq54: Downloading webpage
[info] Available formats for L2gT8fbEq54:
format code  extension  resolution note
249          webm       audio only tiny   50k , webm_dash container, opus @ 50k (48000Hz), 3.22MiB
250          webm       audio only tiny   60k , webm_dash container, opus @ 60k (48000Hz), 3.87MiB
251          webm       audio only tiny  117k , webm_dash container, opus @117k (48000Hz), 7.58MiB
140          m4a        audio only tiny  129k , m4a_dash container, [email protected] (44100Hz), 8.31MiB
160          mp4        256x144    144p   59k , mp4_dash container, [email protected]  59k, 30fps, video only, 3.81MiB
278          webm       256x144    144p   81k , webm_dash container, [email protected]  81k, 30fps, video only, 5.20MiB
133          mp4        426x240    240p  120k , mp4_dash container, [email protected] 120k, 30fps, video only, 7.77MiB
242          webm       426x240    240p  151k , webm_dash container, [email protected] 151k, 30fps, video only, 9.70MiB
134          mp4        640x360    360p  221k , mp4_dash container, [email protected] 221k, 30fps, video only, 14.23MiB
243          webm       640x360    360p  313k , webm_dash container, [email protected] 313k, 30fps, video only, 20.13MiB
135          mp4        854x480    480p  366k , mp4_dash container, [email protected] 366k, 30fps, video only, 23.53MiB
244          webm       854x480    480p  536k , webm_dash container, [email protected] 536k, 30fps, video only, 34.43MiB
247          webm       1280x720   720p 1030k , webm_dash container, [email protected], 30fps, video only, 66.13MiB
136          mp4        1280x720   720p 1061k , mp4_dash container, [email protected], 30fps, video only, 68.13MiB
302          webm       1280x720   720p60 1573k , webm_dash container, [email protected], 60fps, video only, 101.00MiB
298          mp4        1280x720   720p60 1845k , mp4_dash container, [email protected], 60fps, video only, 118.49MiB
303          webm       1920x1080  1080p60 2815k , webm_dash container, [email protected], 60fps, video only, 180.71MiB
299          mp4        1920x1080  1080p60 3480k , mp4_dash container, [email protected], 60fps, video only, 223.44MiB
308          webm       2560x1440  1440p60 7186k , webm_dash container, [email protected], 60fps, video only, 461.34MiB
315          webm       3840x2160  2160p60 22564k , webm_dash container, [email protected], 60fps, video only, 1.41GiB
18           mp4        640x360    360p  555k , avc1.42001E, 30fps, mp4a.40.2 (44100Hz), 35.66MiB
22           mp4        1280x720   720p 1190k , avc1.64001F, 30fps, mp4a.40.2 (44100Hz) (best)
The meaning of mpeg-dash is to select the best possible quality for the bandwidth you have.
The Alpha version seems to have fixed my buffering problem. Over the last week or so it went from being able to play videos if I restarted them a few times, to the last two days where no YouTube vids at all would play without long freezes every few seconds of playback, no matter how many times I tried restarting. Everything I have tried playing since installing the new alpha today has played perfectly first time, including a bunch of videos I just gave up trying to play yesterday. Thanks yet again anxdpanic.