Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade
MPV is a free, open-source, and cross-platform media player that supports a wide range of video and audio formats. It is known for its high performance and extensive customization options. While MPV is not developed by Apple, it is fully compatible with macOS, making it a powerful tool for users who need a versatile media player.
In this article, we will explore how to install and run MPV on macOS via Terminal. This guide is essential for users who prefer command-line operations or need to automate media playback tasks.
Examples:
Installing MPV via Homebrew
Homebrew is a popular package manager for macOS that simplifies the installation of software. To install MPV using Homebrew, follow these steps:
Open Terminal.
Install Homebrew if you haven't already:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Once Homebrew is installed, use it to install MPV:
brew install mpv
Running MPV via Terminal
After installing MPV, you can run it from the Terminal to play media files. Here are some basic commands:
To play a video file:
mpv /path/to/your/video.mp4
To play an audio file:
mpv /path/to/your/audio.mp3
To stream a video from a URL:
mpv https://example.com/stream.mp4
Customizing MPV Configuration
MPV allows extensive customization through its configuration file. You can create or edit the configuration file to set default options:
Create or open the configuration file located at ~/.config/mpv/mpv.conf
:
nano ~/.config/mpv/mpv.conf
Add your desired settings. For example, to set the default video output driver to opengl
and enable hardware decoding:
vo=opengl
hwdec=auto
Save and exit the editor (in nano, you can do this by pressing CTRL + X
, then Y
, and Enter
).
Using MPV with Scripts
You can automate MPV playback using shell scripts. Here is a simple example of a script to play a list of videos:
Create a script file, e.g., play_videos.sh
:
nano play_videos.sh
Add the following script content:
#!/bin/bash
for video in /path/to/videos/*.mp4; do
mpv "$video"
done
Make the script executable:
chmod +x play_videos.sh
Run the script:
./play_videos.sh