[Quick Tip] A single command to rotate a video on Ubuntu Linux

Did the video play upside down? Here’s an easy way to rotate it using a single command on Ubuntu:

There are several video players, such as SMPlayer, that support rotating 90 degrees clockwise or counterclockwise during video playback.

Besides using heavy video editing tools such as Pitivi and Openshot, if you want to export your rotated video and make it persistent, one command in this tutorial may be useful.

Upside down video

Upside down video

1. Install FFmpeg.

If you don’t have FFmpeg, install it first. FFmpeg is a large suite of libraries and programs for working with multimedia files and streams.

If you have audio, video, and other multimedia related applications installed, this is very popular and may already be installed on your system.

To check, open a terminal (Ctrl + Alt + T) and run the following command:

[Quick Tip] A single command to rotate a video on Ubuntu Linux

2. Command to rotate video:

You can now run a single command to rotate the video.

ffmpeg -i input-video.mp4 -vf "transpose=1" output-video.mp4

Before this command, you can first use the cd command to go to the video folder (for example, cd ~/Videos) Or in the File Browser, go to the folder and right-click on the blank area[ターミナルで開く]Choose.

In the command, “transpose=1Is also as follows.

  • 0 – means rotate 90 degrees counterclockwise and flip
  • 1 – means rotate 90 degrees clockwise
  • 2 – means rotate 90 degrees counterclockwise
  • 3 – means rotate 90 degrees clockwise and flip

In my case, the command is:

ffmpeg -i ~/Videos/aisha.mp4 -vf "transpose=1" ~/Videos/aisha-rotated.mp4

Also, depending on the video size and CPU, the process may take a few minutes.

[Quick Tip] A single command to rotate a video on Ubuntu Linux

Share this:

  • More
Sidebar