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

YouTube buffering #441

Closed
RJVB opened this issue Sep 30, 2021 · 21 comments
Closed

YouTube buffering #441

RJVB opened this issue Sep 30, 2021 · 21 comments

Comments

@RJVB
Copy link
Contributor

RJVB commented Sep 30, 2021

These days I often get buffering issues with playback of YouTube videos in 720p mode. I have a 200Mbs fibre connection (often a bit more in reality) but find myself obliged to downgrade to 480p mode because download speeds from YouTube are apparently so slow that I run out of buffer continuously. This causes playback to halt every few seconds.

Is there anything (youtube-dl arguments) that can I experiment with to try to address this?

@zaps166
Copy link
Owner

zaps166 commented Oct 7, 2021

I also noticed it, I'll look at this.

@zaps166
Copy link
Owner

zaps166 commented Oct 7, 2021

QMPlay2 plays 2 different streams: video and audio (2 URLS). Looks like audio stream has buffering issues (can freeze for a long time).

Is there anything (youtube-dl arguments) that can I experiment with to try to address this?

youtube-dl is dead, use: https://github.com/yt-dlp/yt-dlp/releases

Run ./yt-dlp -g "youtube_url"

Output will show URLs per stream (video, audio). You can play separately (just add URL to QMPlay2 playlist) or play both at once: select "FFmpeg" in "Add address" window, enter URLs [https://url1][https://url2] and add.

@RJVB
Copy link
Contributor Author

RJVB commented Oct 7, 2021 via email

@zaps166
Copy link
Owner

zaps166 commented Oct 7, 2021

I suppose that you'll switch to using this new fork if it solves the issue?

I switched today to yt-dlp, but this only extracts (temporary) URL to stream from website.

I have a 200Mbs fibre connection

I think Youtube sometimes doesn't allow to download faster from URL I get from yt-dlp... Or it's also audio stream issue which can be downloading at 0kbps from time to time.

Do you have problems when seeking a stream? Sometimes seek is very slow to me, sometimes fast and can help also with buffering (reconnect to the server sometimes makes download faster).

@RJVB
Copy link
Contributor Author

RJVB commented Oct 8, 2021 via email

@RJVB
Copy link
Contributor Author

RJVB commented Oct 16, 2021 via email

@formlessdao
Copy link

formlessdao commented Oct 16, 2021

QMPlay2 plays 2 different streams: video and audio (2 URLS). Looks like audio stream has buffering issues (can freeze for a long time).

Is there anything (youtube-dl arguments) that can I experiment with to try to address this?

youtube-dl is dead, use: https://github.com/yt-dlp/yt-dlp/releases

Run ./yt-dlp -g "youtube_url"

Output will show URLs per stream (video, audio). You can play separately (just add URL to QMPlay2 playlist) or play both at once: select "FFmpeg" in "Add address" window, enter URLs [https://url1][https://url2] and add.

How do we install yt-dlp on Windows 10 and enable it with QMPlay?

@zaps166
Copy link
Owner

zaps166 commented Oct 16, 2021

or possibly just an option to buffer an entire streamed clip

go to playback settings and increase network buffer size to maximum and apply - it should help

How do we install yt-dlp on Windows 10 and enable it with QMPlay?

it's not possible on current Windows release. It is available only on git sources. If you need it now, download it manually and replace current youtube-dl (with exactly the same file name) in %appdata%\QMPlay2.

@RJVB
Copy link
Contributor Author

RJVB commented Oct 17, 2021 via email

@zaps166
Copy link
Owner

zaps166 commented Oct 25, 2021

I have problems with YouTube slow downloading on many applications including download via command line using yt-dlp, Firefox extensions, QMPlay2, etc. A few days ago I wanted to download a video stream from various applications, all with speed ~80 KiB/s.

It happens sometimes on some streams. Currently I don't have any problems, it works fast.

I want to add an option to choose default video codec, maybe more luck with speed for streams with other codecs?

@RJVB
Copy link
Contributor Author

RJVB commented Oct 25, 2021 via email

@zaps166
Copy link
Owner

zaps166 commented Oct 25, 2021

I just tried a video with the same codecs settings on QMPlay2 (and the extracted video URL in wget and Firefox) vs official YouTube player on their website.

QMPlay2 usually loads 4-5 seconds of video and then server stops streaming for a while (the pause is much longer than 4-5 seconds), after a pause, it buffers more data. The same problem with buffering is when I paste extracted URL (yt-dlp is extracting the URL) into a Firefox.
On official YouTube player it works correct.

The curious thing is that the same video worked perfectly on QMPlay2 about an hour ago.

@zaps166
Copy link
Owner

zaps166 commented Oct 25, 2021

NewPipe app on Android phone - the same codec settings, connected to the same network, the same video and exactly the same problem as in QMPlay2 (4 -5 sec and pause).

I play the video in 2560x1440 size and VP9 codec. When I switch to 1080p, it buffers immediately now.

@zaps166 zaps166 closed this as completed Oct 25, 2021
@zaps166 zaps166 pinned this issue Oct 25, 2021
@RJVB
Copy link
Contributor Author

RJVB commented Oct 26, 2021 via email

@zaps166
Copy link
Owner

zaps166 commented Oct 26, 2021

1080p in MP4 or still VP9? Are there significant differences in the required bandwidth between those?

Now still the same issue on the same video:

  • VP9 1440p 60 FPS - 4 sec buffer and pause
  • VP9 1080p 60 FPS - full video buffers immediately on my network
  • VP9 720p 60 FPS - full video buffers immediately on my network
  • VP9 720p 30 FPS - 2 sec buffer and pause
  • H.264 1440p 60 FPS - 4 sec buffer and pause
  • H.264 1080p 60 FPS - 4 sec buffer and pause
  • H.264 720p 60 FPS - 4 sec buffer and pause
  • H.264 720p 30 FPS - 1 sec buffer and pause

Looks like server bandwidth is limited for most streams, but the reason why it works better on YouTube website is unknown to me.

Best might be 1080p 60 FPS VP9 profile. But I think it depends on video.

A thought: can this have anything to do with the, erm, missing ads?

I don't know, but I'm blocking ads in Firefox and no problems on YouTube website.

@RJVB
Copy link
Contributor Author

RJVB commented Oct 26, 2021 via email

@zaps166
Copy link
Owner

zaps166 commented Oct 26, 2021

New tests done right now:

  • 480p (VP9 and H264) - this is working properly

It depends also on video position, start of video buffers slowly, when I seek to half of the video, it buffers much faster.

@RJVB
Copy link
Contributor Author

RJVB commented Oct 26, 2021 via email

@zaps166
Copy link
Owner

zaps166 commented Oct 26, 2021

Where do you select the preferred codec for YouTube, in QMPlay2?? Is that something you can do only for videos that have multiple streams?

It's new feature, git only.

Screenshot_20211026_211401

@beew
Copy link

beew commented Oct 27, 2021

So I got yt-dlp and renamed it youtube-dl and place it in ~/.config/QMPlay2, streaming works but the videos are not 360 degree (flat videos), with youtube-dl 360 degree works but stream is throttled. What am I missing?

I am using appimage on Ubuntu 20.04.

P.S yt-dlp does solve the streaming problem for mpv. So the buffering problem is definitely due to youtube-dl not being up to date.

@zaps166
Copy link
Owner

zaps166 commented Oct 28, 2021

but the videos are not 360 degree

I don't know, yt-dlp returns an URL to 360 video in different mapping. youtube-dl with my custom user agent returned URL to video with spherical image (this is supported by QMPlay2).

P.S yt-dlp does solve the streaming problem for mpv. So the buffering problem is definitely due to youtube-dl not being up to date.

With yt-dlp is much better, but not for all videos. Youtube throttles it intentionally, so workarounds are needed.

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

No branches or pull requests

4 participants