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
?
You can add a custom mpv key binding for rotating a video in steps of 90 degrees as follows:
Open the
~/.config/mpv/input.conf
file with your favorite text editor (here I'm usingnano
):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):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.