What Does the keep-open Option Do in MPV?
When playing a video in the MPV media player, the
--keep-open option determines whether the player remains
active or automatically closes once the playback reaches the end of the
file. By default, MPV terminates and closes its window as soon as a
video finishes. Enabling this option overrides that behavior, allowing
users to keep the player window open on the final frame of the video,
which is particularly useful for reviewing content, checking video
properties, or preparing to restart playback.
How the Keep-Open Option Works
The --keep-open configuration accepts a few different
parameters, allowing you to customize exactly how MPV behaves at the end
of a file:
yes: The player will pause on the very last frame of the video instead of closing. If you are playing a playlist, it will only pause at the end of the final video.always: The player will pause at the end of every individual file, even if there are more files remaining in the playlist.no: This is the default setting. The player will immediately close the window or move to the next file in the playlist when the current video ends.
Benefits of Using Keep-Open
Keeping the media player open at the end of a video offers several practical advantages for everyday viewing and technical workflows:
- Reviewing Content: It allows you to look at the final frame of a video, which is helpful if a clip ends on important information, a graphic, or credits.
- Preventing Accidental Closures: If you are watching a series of short clips, it prevents the application from constantly shutting down, saving you from having to reopen the software.
- Analyzing Stream Data: Keeping the window active allows you to view on-screen controller (OSC) information or terminal output statistics for the video that just finished.
How to Enable Keep-Open
You can utilize this option either on a case-by-case basis via the command line or permanently through your configuration file.
Via Command Line
To use this setting for a single viewing session, launch MPV from your terminal with the following flag:
mpv --keep-open=yes video.mp4
Via Configuration File
To make this the permanent default behavior so you do not have to
type it every time, add the line to your mpv.conf file:
keep-open=yes