Rotating a video in MPV using keyboard shortcuts is a handy feature that allows users to quickly adjust the orientation of their videos without interrupting playback. This is especially useful for correcting videos that were recorded in the wrong orientation or for viewing content in a preferred angle. By simply pressing a key combination, users can rotate the video by 90, 180, or 270 degrees, enhancing their viewing experience and saving time.
Locate or Create input.conf
:
~/.config/mpv/
.input.conf
does not exist, create it.Open input.conf
:
input.conf
file. For example, you can use nano
:nano ~/.config/mpv/input.conf
Add Key Bindings for Rotation:
R
key, add the following line:R cycle-values video-rotate 0 90 180 270
Save and Close:
nano
, you can do this by pressing Ctrl+X
, then Y
, and Enter
.Restart MPV:
Now, pressing R
while playing a video in MPV will cycle through the rotation angles (0°, 90°, 180°, 270°).
To rotate a video clockwise in mpv, add the following line to your input.conf
file:
Alt+RIGHT script-message Cycle_Video_Rotate "clockwise"
This binds the Alt+RIGHT
key combination to rotate the video clockwise.
To rotate a video counterclockwise in MPV using a keyboard shortcut, follow these steps:
Open or create the input.conf
file in the MPV configuration directory (usually ~/.config/mpv/
).
Add the following line to bind the rotation command to a key (e.g., Alt+LEFT
):
Alt+LEFT script-message Cycle_Video_Rotate "counter-clockwise"
This will rotate the video by 90 degrees counterclockwise each time you press Alt+LEFT
.
Shift
+ r
.Shift
+ R
.Shortcuts Not Working:
input.conf
file in ~/.config/mpv/
has the correct bindings.Video Not Rotating:
Other Issues:
Locate or create the input.conf file in the MPV configuration directory, typically found at ~/.config/mpv/
.
Open the input.conf file and add key bindings for rotation, such as:
R cycle-values video-rotate 0 90 180 270
This will rotate the video by 90 degrees using the R key.
Save and close the file, then restart MPV to apply the new key bindings.
To rotate a video clockwise or counterclockwise, add specific lines to the input.conf file:
Alt+RIGHT script-message Cycle_Video_Rotate "clockwise"
This will rotate the video clockwise.
Alt+LEFT script-message Cycle_Video_Rotate "counter-clockwise"
This will rotate the video counterclockwise.
To test keyboard shortcuts, open MPV and load a video. Then press:
If you encounter issues with keyboard shortcuts, try: