Hacker News new | past | comments | ask | show | jobs | submit login

You can also play videos over http, many websites are supported, even YouTube:

    mpv <yt link>



It uses yt-dlp as the download backend, so it works with anything that yt-dlp handles.


I have found this not to be as straightforward as this. In particular:

1. Although `yt-dlp` consistently is able to download videos at link speed (even when the said link is in multi-gig range!), streaming the video through `mpv` will not work as well and some videos would buffer every couple chunks. But that was in the past…

2. With recent changes to how videos are served and "protected", I'm still able to download them with recent versions of `yt-dlp`, but streaming a `yt-dlp` generated playlist will reliably fail to work (this is true for the newpipe android app too.)

3. Even back when streaming youtube worked, closed captions and other such features would not work by default.

I download videos first, nowadays. And then play them with mpv anyway.


For 1, there might be settings that can help.

I used to use mplayer(of which mpv is a fork) to watch pirate streams of premier league games several years ago, via acestream. Since this was live, lag was a real issue; you can't buffer ahead when there's nothing to buffer yet. Eventually I figured out that mplayer had settings to do things like buffer for 2 minutes at the beginning of the stream before playing. You could also configure it by megabytes pre-buffered. This solved my lag issues very neatly. I can't remember what the settings were, it's been a long time and I don't have those config files anymore. But it should all be in the docs somewhere.


Try setting `ytdl-format=ytdl` in `mpv.conf`, that fixed it for me.


> 1. Although `yt-dlp` consistently is able to download videos at link speed (even when the said link is in multi-gig range!), streaming the video through `mpv` will not work as well and some videos would buffer every couple chunks. But that was in the past…

I still get this with YouTube from time to time. Works with some videos, others are unwatchable. Seeking also generally seems broke and is often slower than downloading even the whole video.


I think the issue with buffering on some videos is because of bad DASH support https://github.com/mpv-player/mpv/issues/7033


I wish seeking word work better in this mode though. There is no reason seecon should freeze the player for minutes or indefinitely if the whole video can be downloaded from start to finish in seconds.


I agree. With decent bandwidth it's more convenient to first download video with yt-dlp and then play it with mpv




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: