Mpv

From Indie IT Wiki
Revision as of 09:27, 10 August 2024 by Plittlefield (talk | contribs) (→‎Subtitles)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Introduction

mpv is a free open source media player for the command line. It supports a wide variety of media file formats, audio and video codecs, and subtitle types. Powerful scripting capabilities can make the player do almost anything.

https://mpv.io

Usage

Usage:   mpv [options] [url|path/]filename

Basic options:
 --no-audio        do not play sound
 --no-video        do not play video
 --fs              fullscreen playback
 --sub-file=<file> specify subtitle file to use
 --playlist=<file> specify playlist file
 --list-options    list all mpv options
 --h=<string>      print options which contain the given string in their name

Keyboard Shortcuts

https://defkey.com/mpv-media-player-shortcuts

Playing Media Over SSH

mpv sftp://username:password@192.168.0.252"/path/to/Movie Name (2020).avi"

Seek To Time Before Playing

mpv --start=

Subtitles

Save the subtitles file with exactly the same name as the video file and mpv will play them automatically.

e.g.

Movie Name (2024) - HD.mp4
Movie Name (2024) - HD.eng.srt

Over Network

To play subtitles automatically over the network, you will have to mount your network path locally by using something like nfs or sshfs.

e.g.

# create folder for mount
mkdir /home/jsmith/nas

# mount remote folder locally
sshfs nas:/remote/folder/to/movie/ /home/jsmith/nas/

# play movie and subtitles
mpv /home/jsmith/nas/"Movie Name (2024) - HD.mp4"

# unmount remote folder
fusermount -u /home/jsmith/nas