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:

Note: In many default mpv installations, Alt + LEFT rotates the video 90 degrees counter-clockwise, while Alt + RIGHT rotates 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:

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.

  1. Locate your mpv configuration directory (usually ~/.config/mpv/ on Linux/macOS or %APPDATA%/mpv/ on Windows).
  2. Open or create the input.conf file.
  3. 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.