0

I always use mpv to play videos in Ubuntu. As mpv has less GUI options so there is no any GUI option to rotate video. But we can rotate video with the help of command line using terminal (example given below)

Rotating video by 90 deg.
mpv --video-rotate=90 /home/guest/new_vdo.mp4
But in this way ( using terminal ) I have to type the command all time when i want to rotate the video.
My question is -
How can we create the keyboard shortcut to rotate video which is currently playing by mpv ?

What's in my mind for the solution -

Create the shell script (.sh) .

  1. Find the absolute path of the currently playing video by mpv.
  2. When a defined shortcut key pressed then kill that mpv and start a new mpv with the rotating aurguments. mpv --video-rotate=90 /home/guest/new_vdo.mp4

Help here !

Edit 1 : I am currently using Ubuntu 19.10 with the unity DE.

  • 1
    @K7AAY I updated question. – Abhishek Kamal Feb 24 at 16:21
  • manpages.ubuntu.com/manpages/eoan/man1/mpv.1.html shows usused key bindings can be assigned by a script. Scripts are discussed in manpages.ubuntu.com/manpages/eoan/man1/… – K7AAY Feb 24 at 16:26
  • @K7AAY My question is not a DE (desktop env) specific so why you changed the question title ? Most of the Ubuntu users do not use Unity so when they see unity in my question title then there is high chance that they will not answer my question. – Abhishek Kamal Feb 24 at 17:14
  • Unity DE may handle key bindings differently. Amended title to show it's Unity DE and not the Unity for game development. – K7AAY Feb 24 at 17:20
  • @K7AAY I didn't ask/specify for the default key-bindings any where in my question description. So why are you worried about key-bindings here ? I think question title must remains same as before . – Abhishek Kamal Feb 24 at 17:28

Your Answer

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

Browse other questions tagged or ask your own question.