mpv Picture-in-Picture (PiP)
November 3, 2025 ยท View on GitHub
This script adds Picture-in-Picture functionality to MPV media player, allowing you to watch videos in a small floating window while working with other applications. It is tested only on Windows system.
Features
- Toggle Picture-in-Picture mode with a single keypress.
- Borderless floating window that stays on top of other applications.
- Automatically exits PiP mode when entering fullscreen.
Installation
- Ensure you have MPV Media Player installed on your system.
- Copy the
mpv-PiP.luascript into your MPV scripts directory, e.g.:C:\Users\<YourUsername>\AppData\Roaming\mpv\scripts\
- Restart MPV.
Usage
Press Alt+p to toggle Picture-in-Picture mode on/off. Then you can use the mouse to freely resize the window and adjust its position.
Automatic Behavior
- Entering fullscreen while in PiP mode will automatically disable PiP and enter fullscreen normally.
- The script handles file transitions properly - PiP mode persists when loading new videos.
- Original window settings are preserved even when MPV saves state via watchlater when
save-position-on-quitis true.
Acknowledgments
- Original script by Wanakachi.