Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

One of my favorite features of mpv, it integrates with yt-dlp to play youtube videos just given the URL!

    mpv 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'


Worth noting, yt-dlp doesn't just handle YouTube (as the name and your comment might imply) but basically any multimedia on the web. Another example:

    mpv 'https://www.instagram.com/p/CfZK86fozXa/'
Or

    mpv 'https://twitter.com/thesalaam10/status/1547180911606767616'
And many more sites. Here is the full list of supported websites: https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites....


I use this in combination with https://addons.mozilla.org/en-US/firefox/addon/send-to-mpv-p... as my pimary way to play video content on the web. It's nice having everything play in a consistent player with consistent controls as well as tons of useful features.


And with `--vo=tct` argument, you can watch youtube videos directly on your terminal! No GUI necessary!

    mpv --vo=tct "https://youtube.com/watch?v=dQw4w9WgXcQ"


Or if you want to play something without video at all for e.g. music livestreams, that can be done too. Example below uses the famous lofi girl stream.

    mpv --no-video --vo=null --ytdl-format='bestaudio/best' 'https://www.youtube.com/watch?v=jfKfPfyJRdk'


> mpv --no-video --vo=null --ytdl-format='bestaudio/best' 'lofi hip hop radio - beats to relax/study to'

With --ytdl-format='bestaudio' there's no need to disable the video track or use the null vo.


Maybe that behavior is Linux-exclusive? Under macOS and Windows, if I only use --ytdl-format='bestaudio/best' with livestreams mpv will spawn a window with the video.


I'm on Windows as well. Just get rid of the 'best' argument for '--ytdl-format'. Also, 'bestaudio' is mostly only known as a keyword for Youtube videos.


It can also use SDL or DRM to render video on the console. I use this for viewing video and images (even pdfs, with imagemagick) without a graphical environment.


Check fbpdf2, fbida and links -g.


Pair it with GPU acceleration for smooth and low CPU overhead playback for livestreams:

    mpv -vo=gpu --hwdec=vaapi --gpu-context=wayland  https://www.twitch.tv/gorgc


Shove that into ~/.config/mpv/mpv.conf (each parameter on its own line and without the dash prefix) if you don't want to repeat yourself over and over again.


For some reason hwdec doesn't seem to make much difference for me in terms of power or CPU usage. Also worth mentioning is profile=gpu-hq (can just uncomment in the example config).


I recommend this for watching lectures & other long videos. Compared to the web player mpv gives finer control of playback speed and seeking forwards and backwards.


Emacs has a mode to control mpv for easy note taking which seems perfect for this https://github.com/kljohann/mpv.el



Really great for studying other languages too. Can quickly go back and relisten to the same section over and over and over again without an ad popping in midway through a listen.




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

Search: