How do I change the aspect ratio of a video in mpv?
Changing the aspect ratio of a video on the fly in the mpv media player is a straightforward process that can be achieved instantly using a default keyboard shortcut. Adjusting the aspect ratio helps correct stretched playback or eliminate unwanted black bars without stopping or restarting your media. Beyond the built-in cycle key, users can also map custom hotkeys to specific ratios or use numerical scaling for precise, real-time adjustments.
Using the Default Keyboard Shortcut
The fastest way to change the aspect ratio on the fly in mpv is by using the default cycle command built into the player.
- Shift + A: Pressing this key combination cycles through the standard aspect ratio overrides forced onto the currently playing media.
Repeatedly pressing Shift + A will loop through common dimensions (such as 4:3, 16:9, 2.35:1) and return to the video’s default container aspect ratio.
Setting Up Custom Aspect Ratio Cycles
If you want to cycle through a specific set of preferred aspect
ratios or map the action to a different key, you can modify your
input.conf file. This file is typically located in your mpv
configuration directory (~/.config/mpv/ on Linux/macOS or
%APPDATA%\mpv\ on Windows).
Add the following line to bind a specific cycle to a key (for
example, the A key without holding Shift):
a cycle-values video-aspect-override "16:9" "4:3" "2.35:1" "-1"
Note: The
-1value tells mpv to reset the video back to its original, unforced default aspect ratio.
Incremental Adjustments Using Numpad
For precise control where standard constraints fail, you can bind
keys to incrementally adjust the ratio. By adding the following lines to
your input.conf file, you can utilize your keyboard’s
numpad to manually warp or fix irregular aspect ratios on the fly:
KP9 add video-aspect +0.04
KP3 add video-aspect -0.04
KP5 set video-aspect-override "-1"
Using this configuration, Numpad 9 stretches the aspect ratio wider, Numpad 3 narrows it, and Numpad 5 instantly resets the video to its default settings.