I am currently using Ubuntu 19.10 with the unity DE and I always use mpv to play videos in Ubuntu. As mpv has few GUI options, there is no GUI option to rotate a video, but we can rotate it with the help of the command line. For example, we can rotate a video by 90 degrees using the command below:

mpv --video-rotate=90 /home/guest/new_vdo.mp4

This way (using the terminal) however, I have to type the command every time I want to rotate the video.

How can we create a keyboard shortcut to rotate a video which is currently playing in mpv?


1 Answer 1


You can add a custom mpv key binding for rotating a video in steps of 90 degrees as follows:

  1. Open the ~/.config/mpv/input.conf file with your favorite text editor (here I'm using nano):

    nano ~/.config/mpv/input.conf
  2. Add the following line which sets the key for the action (here I am using r, but you can add any single key or key combination you wish):

    r cycle_values video-rotate 90 180 270 0
  3. Save and close the file by pressing Ctrl+O and Ctrl+X.

Now, when you open a video, you can press r to rotate it to 90 degrees. Press another time to rotate it to 180 degrees, and so on.

You can modify the above setting to your liking by changing the single key or key combination you want to use and the rotation values you want to cycle.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.