Of course! The setting you're looking for is keep-open.
By default, mpv closes when the video or playlist finishes. You can change this behavior easily. Here are the best ways to do it, from temporary to permanent.
The Quick Answer: The Setting
The setting you need to add to your configuration file is:
code
keep-open=yes
Method 1: The Permanent Solution (Recommended)
The best way to make this change permanent is to add it to your mpv.conf configuration file.
1. Find your mpv.conf file:
The location of this file depends on your operating system. If the folder or file doesn't exist, you need to create it yourself.
Windows:%APPDATA%\mpv\mpv.conf
(You can paste %APPDATA%\mpv into the File Explorer address bar to get there. It usually resolves to C:\Users\YourUsername\AppData\Roaming\mpv)
macOS:~/.config/mpv/mpv.conf
(In Finder, press Cmd+Shift+G and paste ~/.config/mpv to open the folder).
Linux:~/.config/mpv/mpv.conf
2. Edit the file:
Open mpv.conf with any plain text editor (like Notepad on Windows, TextEdit on Mac, or Gedit/Nano/Vim on Linux).
3. Add the line:
Add the following line to the file. If the file already has other settings, just add this on a new line.
code
# Keep the player window open after the video finishes.
keep-open=yes
(The first line with the # is a comment and is optional, but it's good practice to remember what the setting does.)
4. Save and Test:
Save the file and close it. Now, whenever you open a video with mpv, it will stay open on the last frame after it finishes playing.
Method 2: The Temporary Solution (Command Line)
If you only want this behavior for a specific video, you can use a command-line flag when you launch mpv.
bash
mpv --keep-open=yes "path/to/your/video.mp4"
This will only apply for that one session.
Extra Tip: Different keep-open Options
The keep-open option has a few possible values:
no: The default behavior. Closes when the file ends.
yes: Stays open after the file finishes. This is what you want.
always: Same as yes, but also stays open even if there's a playback error. yes is usually sufficient for most users.
Another Useful Related Setting: idle
If you like being able to open the mpv player first and then drag a file onto it, you should also add idle=yes to your mpv.conf.
code
# Start mpv in idle mode without a file
idle=yes
This will launch mpv with just its logo, waiting for you to drop a video file onto the window. When combined with keep-open=yes, it makes mpv behave more like a traditional GUI media player.
Your mpv.conf could look like this:
code
# Keep the player window open after the video finishes.
keep-open=yes
# Allow mpv to start without a file (idle mode).
idle=yes
User
I'm on Windows. I can't find the mpv.conf file.
Assistant
You've hit on the most common hurdle for new mpv users! You are correct, the mpv.conf file and even its folder do not exist by default. You have to create them yourself.
It's a simple process. Here is a step-by-step guide for Windows.
Step 1: Open the Correct Folder
Press the Windows Key + R to open the "Run" dialog box.
Type c:\Users\%USERNAME%\AppData\Roaming and press Enter.
Alternative: You can also just type %APPDATA% into the Run box or the File Explorer address bar and press Enter. It will take you to the same place.
Step 2: Create the mpv Folder
Inside the Roaming folder that just opened, you need to create a new folder.
Right-click on an empty space.
Go to New > Folder.
Name the new folder exactly mpv (all lowercase).
Step 3: Create the mpv.conf File
Now, go inside your newly created mpv folder. This is where you will create the configuration file.
This is the most critical step, as Windows can sometimes hide file extensions. Here is the safest way to do it:
Open the Notepad application.
In the empty Notepad window, type or paste the setting you want:
code
keep-open=yes
Go to File > Save As....
In the "Save As" window, navigate to the mpv folder you just created (the full path will be C:\Users\YourUsername\AppData\Roaming\mpv).
This is important: At the bottom of the "Save As" window, change the "Save as type" dropdown from "Text Documents (.txt)" to **"All Files (.*)"**.
In the "File name" box, type mpv.conf.
Click Save.
Summary of the Final Result
You should now have a file at this exact path:
C:\Users\YourUsername\AppData\Roaming\mpv\mpv.conf
The content of that file should be:
keep-open=yes
That's it! Now close everything and try opening a video with mpv. When the video ends, the player window will remain open on the last frame.
Troubleshooting:
If it doesn't work: The most likely reason is that your file was accidentally saved as mpv.conf.txt. Go back to the mpv folder and in File Explorer, click the "View" tab at the top and make sure the "File name extensions" box is checked. This will let you see the true file name and fix it if necessary.
User
I also need a shortcut to quickly rotate the video when playing. How can I do that?
Assistant
Excellent question! Adding custom shortcuts is one of the most powerful features of mpv.
To add a shortcut for rotating video, you'll need to create another configuration file called input.conf in the same mpv folder where you created mpv.conf.
The Quick Answer: The Configuration
You will create a file named input.conf and add this line to it:
code
# Press 'r' to cycle video rotation (90, 180, 270, 0 degrees)
r cycle video-rotate 90 180 270 0
Step-by-Step Guide for Windows
This process is very similar to how you created the mpv.conf file.
1. Go to your mpv configuration folder:
Press Windows Key + R.
Type %APPDATA%\mpv and press Enter.
This should open the folder containing your mpv.conf file.
2. Create the input.conf file:
Open Notepad.
Paste the following line into the empty Notepad window:
code
r cycle video-rotate 90 180 270 0
Go to File > Save As....
Make sure you are in your mpv folder (C:\Users\YourUsername\AppData\Roaming\mpv).
Change the "Save as type" dropdown to "All Files (.)".
For the "File name", type input.conf.
Click Save.
How It Works
Let's break down the line you just added:
r: This is the key you want to press. You can change this to anything you like, for example R (for Shift+R) or CTRL+r.
cycle: This is the action. It tells mpv to loop through a list of values for a specific property.
video-rotate: This is the property you are changing.
90 180 270 0: These are the values to cycle through. Each time you press r, it will rotate the video 90 degrees clockwise. The last 0 is important so you can cycle back to the original, non-rotated state.
Putting It All Together
Your mpv configuration folder should now look like this: