How to Rotate Video 90 Degrees Clockwise in mpv?
Rotating a video during playback in the mpv media player can be done instantly using a simple keyboard shortcut or by applying a video filter via the command line. This guide covers the built-in hotkey for 90-degree rotation, how to use cycle commands for seamless switching, and how to set a permanent or default rotation using the configuration file.
The Quick Keyboard Shortcut
By default, mpv includes a built-in cycle command mapped to video rotation. While playing a video, you can rotate it 90 degrees clockwise by pressing the following key combination on your keyboard:
- **
Alt+LEFT**(Press the Alt key and the Left Arrow key simultaneously) - **
Alt+RIGHT**(Press the Alt key and the Right Arrow key simultaneously)
Note: In many default mpv installations,
Alt+LEFTrotates the video 90 degrees counter-clockwise, whileAlt+RIGHTrotates it 90 degrees clockwise. If these do not work, your specific version or configuration might require the manual command line or input binding methods detailed below.
Using the Command Line Interface
If you prefer to launch mpv from the terminal with the video already
rotated 90 degrees clockwise, you can use the video filter
(--vf) option. Open your terminal and run the following
command:
mpv --vf=rotate=90 input_video.mp4
For other rotation angles, you can adjust the numerical value:
- 90 degrees clockwise:
--vf=rotate=90 - 180 degrees (upside down):
--vf=rotate=180 - 270 degrees clockwise (or 90 counter-clockwise):
--vf=rotate=270
Adding a Custom Hotkey to input.conf
To map the 90-degree clockwise rotation to a specific single key (for
example, the R key), you can edit your
input.conf file.
- Locate your mpv configuration directory (usually
~/.config/mpv/on Linux/macOS or%APPDATA%/mpv/on Windows). - Open or create the
input.conffile. - Add the following line to the file:
R cycle-values video-rotate "90" "180" "270" "0"
Saving this configuration allows you to press R during
playback to cycle the video orientation clockwise by 90 degrees with
each press until it returns to normal.