How to rotate a video on my Linux operating system PC

Rotate a video in Linux

Video recording has changed a lot over the years. A couple of decades ago the options were few: we held a "huge" camera in the most natural position and that was all or almost all. The problem has been compounded since the launch of camera smartphones, where anyone can get it wrong and record vertically what should go horizontally or vice versa. Then what do we do? Rotate a video to see it correctly on any computer may be the best idea.

Linux is a whole range of possibilities in itself and as such we have many options to perform the same task. In this post we will teach you how to rotate a video with one of the most famous programs and that almost all of us have installed on our computer. Why? Because I think that the target of this post is not just any user who masters programs like Kdenlive or OpenShot, but rather newer users that those more complete programs resist. Although a second option will also be added ...

How to rotate a video with VLC

VLC is a great program which will be even better with the arrival of VLC 4. Right now it already allows us to see a large number of video formats, as well as convert them. To rotate a video with VLC, the first time we will have to make some changes in the general settings, but it is more difficult said than done. Rotating a video with this player is done by following these steps:

  1. If we don't have it installed, we install the player. We can do it from the software center.
  2. Once installed, we open the video with VLC.
  3. Next, we will rotate the video. For this we go to "Tools / Effects and filters" and in the line of tabs at the top we choose "Video Effects".
  4. Within «Video Effects» we mark the «Transform» box.
  5. We choose the desired orientation. The video I have chosen was good, so for this example I have put it wrong in vertical.

Rotate video with VLC

  1. We click on «Save» and then on «Close».
  2. We may think that we already have him, but this will only be the case in cases where we want to see a video in this program with in his new position. VLC will remember that we have rotated a video and each time we close and reopen it it will respect its orientation, so now we are going to save it. As we have mentioned, the first time we will have to activate some options that are deactivated by default. For this we go to «Tools / Preferences» and we mark the box “All” to see the advanced options.
  1. Next, we move to «Video / Filters» and activate the «Video transformation filter» box.
  2. We save the settings by clicking on "Save". Steps 7, 8 and 9 will no longer have to be done.
  3. Now we go to «Medium / Convert ...».
  4. In the window that opens, we choose «Add».
  5. We choose the video that we have just rotated. It is the same that we opened in step 2, that is, the video that we want to rotate from the beginning.

Convert / Save to VLC

  1. Then we click on «Convert / Save». This will take us to a kind of video encoding process.
  2. In this window we will choose how we want to save the video. This is already to the consumer's taste, but I would choose one of the MP4 options that it presents.
  3. We leave the "Convert" box checked and give it a name. To do this we have to click on «Explore». Once we have chosen the name and the path where it will be saved, we click Save.

Encode video with VLC

  1. Not everything is there yet. Now we will click on the wrench icon.
  2. In the "Video Codec" tab we mark the "Video" box.
  3. Next we go to the «Filters» tab, we scroll down and mark «Video transformation filter». At the time of writing this post it is in English.
  4. We click on Save.

Video filters

  1. We return to the Convert window, click "Start" and wait for the conversion to take place. The progress bar that it shows while it is converting is the same as if you were playing a video, with the difference that that video only shows a stationary icon.
  2. Finally, we close the window. Be careful that if we give it to reproduce, the conversion will start again, although with prior notice.

VLC encoding video

Now you can open the video in another player and check that the orientation has changed and has been saved. The funniest thing of all is that VLC, the program we have used for the conversion, in my case decides not to respect the new orientation and turns it upside down, but any other player does play it well.

How to rotate a video from the Terminal

If you thought we were going to leave it here, you were wrong. The easiest method to rotate a video with a user interface program is supposed to be with Avidemux, but it is a very old program that can give many errors. The second easiest for me is to use VLC, a program that I have been installing on all my computers since I discovered it more than a decade ago. But there may still be something simpler if we get over the moment of thinking that we have to use a command line, something that, in addition to being simple, is very powerful. We will do it as follows:

To rotate it clockwise we will write:

ffmpeg -i entrada.mov -vf "transpose=1" salida.mov

Where "input.mov" is the input video and "output.mov" is the output video (including path). This system is much faster, it does not approach the minute in a 10-minute video, so it is advisable to memorize this command to rotate the videos with it. The options available to rotate a video using ffmpeg from the terminal are:

  • 0 = 90º counterclockwise and vertical rotation (default).
  • 1 = 90º clockwise.
  • 2 = 90º counterclockwise.
  • 3 = 90º clockwise and vertical rotation.

If what we want is to do a horizontal flip, we will write the following:

ffmpeg -i entrada.avi -vf "hflip" salida.avi

where "input.avi" corresponds to the name and extension of the original file and "output.avi" corresponds to the name and extension of the already converted file.

Do you already know how to rotate a video in Linux? Do you know a better and faster method? Feel free to tell us.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: AB Internet Networks 2008 SL
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Luis Jose said

    Your post helped me, thank you very much!