anxdpanic / plugin.video.youtube

Watch your favorite YouTube content on Kodi
https://ytaddon.panicked.xyz/forum
690 stars 114 forks source link

Playback using MPEG-DASH stutters and there is a lot of buffering #426

Closed das-osi closed 7 months ago

das-osi commented 1 year ago

Context

Please provide any relevant information about your setup


Expected Behavior

Fluid playback


Current Behavior

When playing back videos using MPEG-DASH the video will pause and buffer after just a few seconds. Playback will continue after buffering completed, but will fail again after another few seconds. But this doesn't happen if I disable audio by setting InputStream Adaptive - Media to "Video". Also doesn't happen if I disable MPEG-DASH. On my computer and other devices on the same network there are no issues at all. The same machine plays local 4k movies just fine. Seems to me like Kodi is "thinking" that video and audio got out of sync and therefore reloads the streams.


Steps to Reproduce

Really got no idea how to reproduce this issue, seems to me that I'm the only one facing it.


Log

-


Additional Information

-


spitzenidee commented 1 year ago

I have the same issue / bug (also Kodi 19.5 via Libreelec 10.0.0.4, Youtube addon 6.8.25+matrix.1, running on a x86 Ryzen 3200U, 16 GB RAM) and have - until now - unsuccessfully trying to pinpoint it to either general Kodi buffering woes, my wifi or even my internet provider. After reading this bug description I deactivated MPEG-DASH for testing (resulting in 720p as max resolution for YouTube videos) and immediately I found that all problems & high latencies with the following are completely gone:

Reactivating MPEG-DASH brought back video resolution >720p up to 4k and also all of the above hiccups.

I also have no idea on how chase down this issue in Kodi and how to provide meaningful data, e.g. logs etc - hints and guides are very welcome so I can actually be helpful ;)

GrimChaos commented 1 year ago

Same problem on an android box, Kodi 20.0, Youtube 7.0.0, Internet 300 Mbps down and up

spitzenidee describe the problem pretty well.

I would just add, scrubbing ahead doesn't work as well. Holding (or pressing a few times) the skip forward x seconds, it doesn't skip forward more than once (mine is set to 30 seconds). I don't know if I explained it clearly but I tried.

Thanks! This Addon has been amazing!

Fludizz commented 1 year ago

Similar buffering issues observed on LibreELEC 9.2 (Kodi 18) and on LibreELEC 10 (Kodi 19.5). Watching video's with DASH enabled for Video's causes lots of buffering issues - this is a new issue that we first started noticing about a week or so ago.

Work-around to get stable video feeds is to disable DASH for video and only leave it enabled for Live-streams. However, that results in a maximum resolution of 720p.

However, as disabling InputStream (via DASH) for Video "works around" the issue, it may actually be a problem in InputStream rather than in the Youtube plugin itself.

spitzenidee commented 1 year ago

I would just add, scrubbing ahead doesn't work as well. Holding (or pressing a few times) the skip forward x seconds, it doesn't skip forward more than once (mine is set to 30 seconds). I don't know if I explained it clearly but I tried.

Now that you mention it, yes, scrubbing is weird for me, too:

Video is playing at e.g. 1 minute 30 seconds. I scrub ahead / forward for 30 seconds (just as an example), ie. "skip to 2:00". First of all, it often takes 5-10 seconds until playback resumes at (approximately) 2:00. But also quite often the video resumes at a completely unrelated position, e.g. 0:40 or skips back to the start (but skips back always to a point earlier than the position when scrubbing was initiated).

gatecrasher777 commented 1 year ago

This issue: https://github.com/yt-dlp/yt-dlp/issues/6400

Solution: The latest YouTube players require a valid &range=start-end added to the stream urls (along with the usual decipher and n transform).

Once this is supplied, everything is fast again.

anxdpanic commented 1 year ago

We don't have any decipher or n transform atm, and afiak that's an unrelated issue to what we're facing.

No one has provided the proper information for this either, debug logs reproducing the stuttering would be a start.

das-osi commented 1 year ago

kodi.log @anxdpanic I'm sorry, there you go

neo-neo1 commented 1 year ago

Need an additional debug log?

Buffering issue has been almost getting progressively worse day by day. Numerous users also reporting buffering issues on the Kodi forums. I reproduced the same problem on multiple machines and on multiple ISPs.

I still remember the great buffering saga last year. I guess this is PT 2

XxAcielxX commented 1 year ago

I'm also facing this caching issue as well. It was working smooth till 6.8.25~alpha3+matrix.1 and last week it updated to 6.8.25+matrix.1, and it started causing this caching issue.

On playing, seeking and randomly it caches and video gets stuck while audio is playing. Look at the changes made between this two versions and look for the issue.

I'm have been using this add-on for more than 5 years now.

Edit 1: When you play any video, look at the popup info notification. It says something like <Video Title> - <Weird Time>/<Video Total Length>

Example: .... - 1:47:35/2:54

neo-neo1 commented 1 year ago

You can mitigate the buffering and seeking issues by disabling MPEG-DASH in YouTube options. Of course if you watch live streams, it may prove problematic. Not a fix by any means.

XxAcielxX commented 1 year ago

Today the issue is not happening, that's a surprise. Anyone else?

das-osi commented 1 year ago

@XxAcielxX can confirm, suddenly even 4k 60fps is smooth as butter. What changed?

XxAcielxX commented 1 year ago

What changed?

I have no idea, but I guess this was a backend issue maybe, coming from Google perhaps.

spitzenidee commented 1 year ago

@XxAcielxX can confirm, suddenly even 4k 60fps is smooth as butter. What changed?

Can also confirm (my location is Germany btw) - a 4k 55 Mbps video has no latency problems when starting, stopping, seeking, jumping around in the video's timeline. Since I changed absolutely nothing on my side including Kodi and addon versions I suspect Google's backend, as well.

Buffering is still different than I would expect (from Kodi in general) but this may be a characteristic caused by MPEG-DASH? I mean: without MPEG-DASH Kodi fills the buffer as fast as possible to 100% (I have set it quite high via advancedsettings.xml) saturating my 100 MBit ISP connection, but with MPEG-DASH buffering happens more or less with exactly the video's bitrate.

GrimChaos commented 1 year ago

@XxAcielxX can confirm, suddenly even 4k 60fps is smooth as butter. What changed?

Darn, mine still isn't working right

Shadowevil1666 commented 1 year ago

I have run LE NIGHTLY on S912 box. I have a Let's play that's show 2 Episodes with AV1, they stuttering. The other episodes with h264 running smoothly. With MPEG-DASH off the AV1 episodes running fine.