Any Idea on How FFmpeg Rotates Video?

Q:"I have a video clip recorded by a smartphone vertically, and I am trying to rotate it 90 degrees clockwise using the usual FFmpeg command on my Windows. But the results are not encouraging. Am I doing something wrong? Can anyone explian how FFmpeg rotates video at every step or recommend another tool to help me?" - from StackExchange

When capturing a video with wrong orientation, many people prefer to use FFmpeg to perform a video rotation to make it with the proper visual orientation. However, as a command-line-based tool, rotating video in FFmpeg is a bumpy ride for most users, especially for those who have zero experience in it. If you are looking for operating instructions or the easier alternative after suffering the failure as mentioned above, this reading is perfect for you. From it, you will get a clear explantion of how to rotate video in FFmpeg and a simple alternative means of video rotation.

Part 1. How to Let FFmpeg Rotate Video Properly

FFmpeg is a tool based on the command line. All of its editing tasks are completed by the given commands. For clockwise or anti-clockwise video rotation, you need to have the aid of its "Transpose" filter. How to use the rotation filter to rotate a video in FFmpeg? Just see below.

ffmpeg rotate video

Step 1: Download the recent version of FFmpeg and activate Command Prompt on your computer to enter "cmd" to access the terminal;

Step 2: Then, input command: sudo apt install ffmpeg to install FFmpeg;

install ffmpeg for video rotation

Step 3: Import video and type the following commands to rotate video as you need.

Rotate video 90 degrees clockwise: ffmpeg -i input.mp4 -vf "transpose=1" output.mp4 or ffmpeg -i input.mp4 -vf "transpose=clock" output.mp4

Rotate 90 degrees anti-clockwise: ffmpeg -i input.mp4 -vf "transpose=2" output.mp4

Rotate 90 degrees clockwise and flip vertically: ffmpeg -i input.mp4 -vf "transpose=3" output.mp4

Rotate 90 degrees anti-clockwise and flip vertically: ffmpeg -i input.mp4 -vf "transpose=0" output.mp4

Rotate 180 degrees: ffmpeg -i input.mp4 -vf "transpose=2, transpose=2" output.mp4

Step 4: After the input of your required command, press "Enter" key to start the conversion process.

Note: All commands stated above will re-encode your video during rotation. To prevent the re-encoding from happening, you can use command: ffmpeg -i input.mp4 -c copy -metadata:s:v:0 rotate=90 output.mp4 to only rotate video in the metadata. But many times, metadata rotation fails to realize. Faced with this, use the re-encoded rotation command.

Part 2. How Does FFmpeg Alternative Rotate Video 90 Degrees

Do you still have difficulty rotating video using FFmpeg command even with detailed guidelines? Don't stress about it. Here is the recommendation of a simple alternative - Joyoshare Video Cutter to perform video rotation hand over fist. Not being developed as a single cutting tool, it is a combination of cutter, rotator, cropper, splitter, merger, converter, and editor. Not just can it make you enjoy the high precision and speed video cutting, but also provide you with the creative ability to change video orientation, watermark and subtitle video, correct video color, add music track and sound effects, apply stunning visual effects, etc.

Its two processing modes let it be compatible with almost any media formats, such as MP4, MKV, WMV, AVI, TS, SWF, FLV, MP3, OGG, 3GP, DV, HD, 4K, and hundreds of others. The video rotating software is not hard to work with. That it comes equipped with the modern and succinct interface makes it possible for beginners to operate without help.

Highlighted Features of Joyoshare Video Cutter:

  • Rotate any video 90° clockwise and anticlockwise
  • Flexibly crop video, adjust aspect ratio, flip video, etc
  • Change output quality, codec, frame rate, resolution, etc
  • Output video to other formats and various portable devices
  • Cut and split audio and video files in a lossless and precise way
  • Step 1 Launch program and add video

    Download and install the program from the above link or button first. Run it so that you can import the video file that you are going to rotate. According to your will, choose "Open" button to import video from computer hard disk or use drag & drop function to add file quickly.

    add video for rotation
  • Step 2 Choose encoding mode for video rotation

    Continue by the click of "Format". You will be guided to the format window, in which it is necessary to mark the encoding mode and determine an output format as you desire. There is a gear icon displaying at the top right corner of the chosen format box. Clicking it, you get the chance to custom video codec, bit rate, frame rate, resolution, audio channel, sample rate, and so on. Take note that the high-speed mode only works to cut or split file in original quality and merge split clips together at 60X speed.

    choose encoding mode for video rotation
  • Step 3 Start to rotate video and save

    Remember to click "OK" to confirm the format settings. When you go back to the previous window, find and touch "Edit" edit icon icon to launch edit panel. Select "Adjust" tab where the rotation tool lies in. On the bottom left-hand corner, clockwise rotation button and counterclockwise rotation button are presented. Based on your demand, touch the rotations buttons to rotate your video 90°, 180°, 270° clockwise or anticlockwise. Also, don't hesitate to flip video vertically or horizonally if needed. After you are done, touch "OK" to return to the first interface so as to tap on "Start" to export the final rotated video.

    rotate video in ffmpeg alternative

Part 3. Comparison

Below is a comparison table of features coming with FFmpeg and Joyoshare video Cutter from many aspects. If you have trouble deciding which one to accept after reading on the above, you may as well spare some time to take a look at the following.

Program FFmpeg Joyoshare Video Cutter
Supported OS Windows, Mac, Linux Windows, Mac
Target Groups Experienced users Novice & Expert
Quality Loss Yes Yes
But automatically match the highest quality
Easy to Use No Yes
More Editing Tools No Yes
Real-time Preview No Yes
Video Rotation Not Working Sometimes Yes No
Price Cost-free $29.95/Lifetime

Comments

Leave a comment

  Home >  Resource >  Video Editing >  Any Idea on How FFmpeg Rotates Video?
joyoshare review vidikit