This script allows users to take screenshots in MPV, crop them to keep only the bottom portion, and stitch them together into a long vertical image, just like a meme of lines. It is designed for Windows operating systems and requires ffmpeg
to function.
- Take multiple screenshots with the press of a key.
- Crop the bottom portion of the screenshots to create a unified long image with customizable location.
- Stitch all cropped images together into a single output image.
- Option to save screenshots in lossless
.png
format for higher quality or.jpg
format for smaller file size. - Customizable directory for saving images and height of cropped sections.
- MPV Media Player
- FFmpeg (ensure it is in your system's PATH)
- Ensure you have MPV and FFmpeg installed on your system.
- Copy the script into your MPV scripts directory, typically found at:
C:\Users\<YourUsername>\AppData\mpv\scripts\
- Edit the script to set the desired screenshot directory, cropping arguments, whether to save images in lossless format and ffmpeg log level.
- Restart MPV.
-
Key Bindings:
- Press
n
to take a screenshot (can be pressed multiple times). - Press
Ctrl+n
to create the stitched image from the taken screenshots. - Press
Alt+Up/Down
to increase/decrease the top margin of the subtitles. - Press
Alt+Left/Right
to increase/decrease the bottom margin of the subtitles. - Press
Alt+m
to toggle the mouse position ratio display in order to show the position intuitively.
- Press
-
Configuration:
- Update the
dir
option in the script to specify the directory where screenshots will be saved. - Adjust the
subtitle_top
andsubtitle_bottom
option to set the top/bottom margin of subtitles to keep (height from the bottom). - Set the
lossless
option totrue
if you want lossless PNG images, orfalse
for compressed JPEG images. - Set the
ffmpeg_loglevel
option to select the appropriate logging level to avoid ffmpeg outputting too many log records. (ffmpeg log level: quiet, panic, fatal, error, warning, info, verbose, debug)
- Update the
Note: Using the lossless option will significantly increase the time it takes to process and stitch images due to the larger file size and processing requirements of PNG files.
local options = {
dir = "C:/Users/YourUsername/Documents/mpv/screenshots",
subtitle_top = 0.15, -- Set 15% (of video height) to the top of subtitles
subtitle_bottom = 0, -- Set the bottom to the bottom of subtitles
lossless = false, -- Save screenshots as JPG for lower processing time
ffmpeg_loglevel = "error", -- Only output error and fatal logs
}
- Original concept and code by Wanakachi.
- Thanks to Dai-JiaLin -- submitted PR #1, which added the ability to freely adjust the cropping height.
- If you encounter issues with the script, ensure that the paths are correctly set and that
ffmpeg
is accessible from the command line. - Check the MPV log for error messages related to the script.