Rotate video by a keyboard shortcut in mpv
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?
Top Answer/Comment:
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 using nano):
nano ~/.config/mpv/input.conf
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
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.
상단 광고의 [X] 버튼을 누르면 내용이 보입니다