4

I just installed mpv with homebrew on MacOS Catalina. Since I spend equal amounts of time using the terminal and Finder, I would like to open all video files with mpv from Finder. Unfortunately, I don't know how to locate the homebrew app when setting the default application for video files. To be clear, I'd like to open all my video files with mpv from Finder.

I have also tried the solution found in this thread: Set macvim as default application after homebrew installation

But for mpv, there is no .app file. I tried moving and linking the /bin/mpv file but Finder wouldn't allow me to use that application as the default.

1
  • You may try making your own app. Copy any tiny app in a test directory. Right click > show package contents. Replace the binary in Contents/MacOS with the brew one. In the info.plist, replace CFBundleTypeExtensions's array's string value with mpv. But this is not guaranteed to work. Remove any references to icon files or directories that don't exist.
    – anki
    Commented Jul 25, 2020 at 19:16

2 Answers 2

5

Read the FAQ @ https://mpv.io -> Reference -> FAQ


How can I make mpv the default application for opening movie files on macOS (OSX)?

  • Install mpv as an app with Homebrew:
brew install --cask mpv
  • If you need an alias in Applications/Launchpad, open a Finder window at /usr/local/Caskroom/mpv/your_mpv_version/. In there the mpv.app bundle has been generated. While holding Cmd+Alt, drag this .app into the Applications folder.

  • Use duti to associate files with the application:

brew install duti
duti -s io.mpv avi all
duti -s io.mpv mkv all
duti -s io.mpv mp4 all

Or you can do it macOS Finder

Find a video file you want to play in mpv and CMD + I to Get Info on it and then change the default app to be mpv and click Change All button. Rinse and repeat for other file types.

1
  • Awesome, what this did is that mpv actually showed up on the list of apps that could be linked to video files.
    – Tea Tree
    Commented Jul 25, 2020 at 19:43
0

Not wanting to install something to make this possible or wanting to pop open a terminal window for every instance of mpv, I kept looking until I figured out a better method than James Brickley's.

  • ⌘ Command Space → Automator

  • In the Choose a type for your document: prompt, select "Application"

  • In the search bar to the right of Actions and Variables type in 'script' and then select Run Shell Script

  • Select your preferred shell from the Shell: dropdown (for simplicity's sake I'm choosing /bin/bash)

  • Select "as arguments" from the Pass input: dropdown

  • Delete the for loop that they pre-populated in the text area

Now you can just write your script as needed. I decided to set the PATH environment variable since I am using nix. So my entire "script" is:

export PATH="$HOME/.nix-profile/bin:$PATH"

mpv $@

Now, save your "Application" (I had to save it to $HOME/Applications/mpv.app), find a file that you want to set to be opened (eg. a .mp4 file), select it, hit ⌘ Command I, go down to Open with: and go to Other..., go to where you saved your "Application" (so $HOME/Applications/ for me), select it, and hit "Add".

Finally, before you close the Info window, hit Change All... and that'll set it as the default.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .