How to crop widescreen videos using pan-and-scan in mpv?
This article provides a quick guide on how to adjust the pan-and-scan settings in the mpv media player to effectively crop widescreen videos. By utilizing built-in keyboard shortcuts or modifying your configuration file, you can easily remove black bars or zoom into video content to fit your screen’s aspect ratio.
Understanding Pan-and-Scan in mpv
The pan-and-scan feature in mpv allows you to zoom into a video, changing how it fits your display window. When dealing with widescreen videos (like 21:9 or 16:9) on a display with a different aspect ratio, zooming in will crop the edges of the video while filling the screen, eliminating letterboxing or pillarboxing.
Using On-the-Fly Keyboard Shortcuts
The fastest way to change pan-and-scan settings while a video is playing is by using mpv’s default keyboard shortcuts.
- Increase Zoom / Pan-and-Scan: Press
wto zoom in. This will gradually crop the sides or top/bottom of the video to fill more of your screen. - Decrease Zoom / Pan-and-Scan: Press
eto zoom out, reversing the crop and bringing back the original framing. - Reset Zoom: Press
Alt+0(orShift+gon some configurations) to reset the video back to its original, uncropped aspect ratio.
Shifting the Cropped Window (Panning)
When you crop a video using zoom, you might cut off important action happening at the edges of the frame. You can pan the cropped window using the following default keys:
- Move Left/Right:
Alt+leftandAlt+rightarrow keys. - Move Up/Down:
Alt+upandAlt+downarrow keys.
Setting a Default Pan-and-Scan Value
If you want mpv to always apply a specific level of cropping
automatically when it launches, you can add a line to your
mpv.conf configuration file.
Open your mpv.conf file (typically located in
~/.config/mpv/ on Linux/macOS or
%APPDATA%\mpv\ on Windows) and add the following
command:
panscan=1.0
The value 1.0 will zoom in completely to fill the
screen, cropping the excess video. You can adjust this value between
0.0 (no crop) and 1.0 (maximum crop to fit
screen) to find your preferred balance.