trizen / pipe-viewer

A lightweight YouTube client for Linux, without requiring an API key.
Artistic License 2.0
379 stars 18 forks source link

[Question] How to increase mpv download speed with pipe viewer? #153

Open sun95n opened 1 year ago

sun95n commented 1 year ago

So YouTube video and audio download speed is limited by ffmpeg as mentioned in this thread. Although I understand that pipe-viewer manages both URLs separately. So the logical thing to do would be to pass the URL to mpv to make it work. The problem is that mpv takes 5-7 seconds to parse a URL unlike pipe-viewer which only takes 2. So is there any other method to achieve this?

sun95n commented 1 year ago

I didn't think I would find a solution for this, haha. It was enough to set split_videos to 0 to avoid the download limits. Although you will only be able to view videos with 720p and 360p resolution, 1080p or higher will revert to 720p

@trizen do you think you can explain why this behavior happens? According to the documentation:

https://github.com/trizen/pipe-viewer/blob/25c176b3f3210ff970cbbdddac476b606c66690d/bin/pipe-viewer#L5075-L5077

Although I would appreciate if it would be easier to explain in this context.

sun95n commented 1 year ago

Thanks a lot. I guess now I can close it.

sun95n commented 3 weeks ago

@trizen YouTube has now limited the resolution to 360p for split videos :(

mpv users have proposed a couple more solutions to this problem, however, Guidocella's comment continues to be the most voted.

Selecting HLS streams with --ytdl-format='bestvideo[protocol^=m3u8]+bestaudio[protocol^=m3u8]/bestvideo+bestaudio/best' reduces the throttling, but it breaks seeking to timestamps that haven't been cached in >= 1440p streams, and doesn't select 4320p streams.

You can also let yt-dlp do the downloading by piping its standard output to mpv, e.g. with this zsh script:

Is there a way to implement this within Pipe Viewer? It worked for me.

sun95n commented 3 weeks ago

YouTube has now limited the resolution to 360p for split videos :(

There is no more 720p

https://github.com/trizen/pipe-viewer/blob/6f692afe25530d6568e8763c3d468224ee131afd/bin/pipe-viewer#L5137-L5141