mpv (multi-platform CLI media player)

Submit command line tools that you find here.
Post Reply
Message
Author
User avatar
Midas
Posts: 6710
Joined: Mon Dec 07, 2009 7:09 am
Location: Sol3

mpv (multi-platform CLI media player)

#1 Post by Midas »

Multi-platform FOSS mpv has been around for a while now, but has only garnered accidental mention here at TPFC. In fact, I had to (re)discover by myself the portability info previously supplied by SYSTEM (see below). Duh. ;)
https://mpv.io/ wrote:mpv [is] a free, open source, and cross-platform media player. mpv is a fork of mplayer2 and MPlayer. It shares some features with the former projects while introducing many more.
https://mpv.io/manual/master/#files-on-windows wrote:If a directory named 'portable_config' next to the 'mpv.exe' exists, all config will be loaded from this directory only. Watch [that] later config files are written to this directory as well. (This exists on Windows only and is redundant with $MPV_HOME. However, since Windows is very scripting unfriendly, a wrapper script just setting $MPV_HOME, like you could do it on other systems, won't work. portable_config is provided for convenience to get around this restriction).
Image

Image

Notice the advice from the download page of one of the Windows builders: "To play content from various media streaming sites, place 'youtube-dl.exe' in the same directory as mpv."

Download mpv latest Windows binaries (currently for v0.24.0) from either mpv.srsfckn.biz or sourceforge.net/projects/mpv-player-windows/files.

User avatar
Midas
Posts: 6710
Joined: Mon Dec 07, 2009 7:09 am
Location: Sol3

Re: mpv (multi-platform CLI media player)

#2 Post by Midas »

Quick tip: a very comprehensive mpv configuration guide can be found at iamscum.wordpress.com /guides/videoplayback-guide/mpv-conf/.

User avatar
webfork
Posts: 10818
Joined: Wed Apr 11, 2007 8:06 pm
Location: US, Texas
Contact:

Re: mpv (multi-platform CLI media player)

#3 Post by webfork »

Midas wrote: Sun Mar 15, 2020 7:07 am Quick tip: a very comprehensive mpv configuration guide can be found at iamscum.wordpress.com /guides/videoplayback-guide/mpv-conf/.
These sort of guides really reinforce portability, as you wouldn't want to jump through all these hoops more than once to get it running just right.

freakazoid
Posts: 1212
Joined: Wed Jul 18, 2007 5:45 pm

Re: mpv (multi-platform CLI media player)

#4 Post by freakazoid »

I've always loved mpv on Android, but haven't really looked into the Windows version until now.

I wanted to hook up Firefox to forward YouTube URLs with youtube-dl to an external media player and found that mpv was the best option for this. For Firefox, you'll have to install the play-with addon so it will transform the YouTube URL to a m3u file, which would then be used with mpv. Make sure you have youtube-dl.exe in the same directory as mpv.exe (can also use a symlink if you already have a copy somewhere else on your HDD).

I'm pretty pleased with this set up. Also, there are a ton of user scripts you can add to customize the player because mpv is pretty barebones by default.

One nitpick is mpv's uncompressed file is almost double the size of MPC-HC, but other than that, thumbs up!

Thanks for posting the info to make mpv portable, SYSTEM and Midas!
is it stealth? ;)

User avatar
vevy
Posts: 795
Joined: Tue Sep 10, 2019 11:17 am

Re: mpv (multi-platform CLI media player)

#5 Post by vevy »

freakazoid wrote: Mon Jun 15, 2020 3:24 pm I wanted to hook up Firefox to forward YouTube URLs with youtube-dl to an external media player and found that mpv was the best option for this.
Care to explain why (vs, for example, MPC-HC)?

Another way to get the stream to the player is SVPtube which works by copying the link (it monitors the clipboard).

freakazoid
Posts: 1212
Joined: Wed Jul 18, 2007 5:45 pm

Re: mpv (multi-platform CLI media player)

#6 Post by freakazoid »

The mpv method I listed works well if you just want to click a button in Firefox.

Now that you mentioned how youtube-dl works with MPC-HC, I actually took a look at what I was doing wrong. You need to add youtube-dl.exe in the same directory as mpc-hc, then you can either paste in the URL under 'File - Open File/URL' or pass the URL to MPC-HC's command line. I was attempting to use the Firefox button approach I mentioned and that didn't work, however the command line approach works for me. Thanks vevy! mpv does have more configuration options though.

Also, thanks for mentioning SVPtube, but it doesn't fit my requirements.
is it stealth? ;)

User avatar
Midas
Posts: 6710
Joined: Mon Dec 07, 2009 7:09 am
Location: Sol3

Re: mpv (multi-platform CLI media player)

#7 Post by Midas »

freakazoid wrote: You need to add youtube-dl.exe in the same directory as mpc-hc, then you can either paste in the URL under 'File - Open File/URL' or pass the URL to MPC-HC's command line.

Would you care to provide a practical example for this, freakazoid? Meaning the command line you're using, for example? :thinking:

freakazoid
Posts: 1212
Joined: Wed Jul 18, 2007 5:45 pm

Re: mpv (multi-platform CLI media player)

#8 Post by freakazoid »

Midas wrote: Tue Jun 16, 2020 3:40 amWould you care to provide a practical example for this, freakazoid? Meaning the command line you're using, for example? :thinking:
First, make sure you have youtube-dl.exe in the same directory as MPC-HC.

Then, pass the URL you want to watch in the command-line, so:

Code: Select all

mpc-hc.exe https://youtube.com/?watch=id
You can tweak some youtube-dl items from MPC-HC's Options under the Advanced panel. Look for parameters matching YDL.
is it stealth? ;)

User avatar
Midas
Posts: 6710
Joined: Mon Dec 07, 2009 7:09 am
Location: Sol3

Re: mpv (multi-platform CLI media player)

#9 Post by Midas »

Thanks. :sunglasses:

User avatar
vevy
Posts: 795
Joined: Tue Sep 10, 2019 11:17 am

Re: mpv (multi-platform CLI media player)

#10 Post by vevy »

There is an option in MPC (I don't know if it is in mpv), where you can select whether to use internal LAV filter for HTTP(S) streaming:

without the filter: the piped stream is downloaded sequentially, and MPC play the file while being downloaded (or "buffered"). You can't jump around before the download reaches the selected part, but you can navigated the downloaded part like a local file.
with the filter: you can jump around immediately; it will start downloading from the selected time, like the web player, but unlike the web player, it will discard the previously downloaded part; i.e., if you go back to the beginning, it will start downloading again.

freakazoid
Posts: 1212
Joined: Wed Jul 18, 2007 5:45 pm

Re: mpv (multi-platform CLI media player)

#11 Post by freakazoid »

Thanks for the info, vevy.

Looks like MPC-HC already has HTTP(S) checked under "Source Filters" in the Internal Filters section by default, so should be good to go!
is it stealth? ;)

freakazoid
Posts: 1212
Joined: Wed Jul 18, 2007 5:45 pm

Re: mpv (multi-platform CLI media player)

#12 Post by freakazoid »

I've been playing around with mpv over the weekend and didn't know about alternative UIs or OSDs.

I started using uosc as the main UI: https://github.com/tomasklaen/uosc. Pretty nifty minimalist UI. mpv is also very extensible with custom scripts. You can find a bunch here: https://github.com/mpv-player/mpv/wiki/User-Scripts. One of my favorite ones I just discovered is the ontop-only-while-playing script that puts mpv always on top while playing and turns off when idle or paused. Handy when you just want to watch some video, but need to disable always on top on pause.
is it stealth? ;)

Post Reply