17

I need to rotate a MP4 video by 90 degrees. There is software like Free Video Flip and Rotate available that does this but produces an AVI file.

Do you have any suggestions for a software to produce a MP4 that is in the same quality (and file size) as the original, just 90 degrees rotated? Does not have to be free software ;-)

quack quixote
  • 42,186
  • 14
  • 105
  • 129
thegate
  • 173
  • 1
  • 1
  • 4

8 Answers8

9
  1. Open Avidemux (free video editing software)
  2. Open your mp4 file.
  3. Choose a "Video Output" other than "Copy" [I chose "Mpeg4 ASP (ff)"]
  4. Choose Video > Filters (or in Windows, press Ctrl+Alt+F)
  5. Double-click "Rotate" to add that filter
  6. Choose 90 degrees
  7. Press "Close" to exit "Video Filter Manager"
  8. Save

(Thanks to @secret for getting me started, but his/her list of steps weren't complete.)

Raymundus
  • 103
  • 4
Ryan
  • 1,736
  • 11
  • 41
  • 68
  • I used this once in the past, I don´t know what I did, avidemux looks like detected video was rotated automatically, and rotated video by itself :/... now I have another clean installation and does not work that way anymore, and when I select video outputs (tried all possible combinations) it never ends with same file size than the first time... I would love to have a way to say... "format same than origin" and rotate only – Yogurtu Jun 21 '19 at 22:44
7

I used Avidemux, a free video editor.

This software allows you to rotate any movie.

In a drop-down list you can select the desired output format (e.g. MP4, AVI, FLV, etc.).

If using the MPEG-4 ASP setting in the video drop-down list, you will have to fiddle around with Quantizer setting (A higher number means reduced file size and less quality).

This tool is great when you capture a movie on your cell phone and want to send the movie to friends!

mathijsuitmegen
  • 257
  • 4
  • 14
7

If you actually recorded video in landscape mode, but phone erroneously saved in metadata that it is 90 degrees rotated (it happen to me today during helicopter flight) just download ffmpeg and use this command (completely lossless as it just writes new header - metadata):

ffmpeg -i input.mp4 -c copy -metadata:s:v:0 rotate=0 output.mp4
Nenad Bulatović
  • 595
  • 1
  • 8
  • 12
  • I just tested this approach, seems not to lose quality, file size is 0.001% bigger tough, not sure why if this is a header-metadata change only. – Yogurtu Jun 21 '19 at 22:42
  • I experience a 1.3MB decrease in size but the command ran in a couple of seconds, not nearly long enough to transcode anything 3 minutes long. All I can guess is that GoPro has a bunch of extra room in the file that is not actually used. Maybe space pre-allocated for event tags and such. – boatcoder Feb 16 '20 at 17:29
  • This is NOT necessarily lossless - if the source video has any other streams (i.e. subtitles, etc) they won't be copied. For that you need -map 0. And even with -map 0 & -copy_unknown, it can still screw up some streams it doesn't recognize, i.e. telemetry recorded by GoPros. – J23 Jun 19 '20 at 07:18
  • This wasn't working for me, but found [this page](https://ostechnix.com/how-to-rotate-videos-using-ffmpeg-from-commandline/) with a similar solution that worked: `ffmpeg -i input.mp4 -map_metadata 0 -metadata:s:v rotate="90" -codec copy output.mp4` – Joao Coelho Dec 30 '21 at 18:54
7
  1. Open Avidemux
  2. Press Ctrl+Alt+F (for Windows)
  3. Select Rotate
  4. Save
Oliver Salzburg
  • 86,445
  • 63
  • 260
  • 306
secret
  • 87
  • 1
  • 1
2

You can rotate an MP4 video using VLC and some awesome nice guy wrote a detailed set of instructions with screenshots here: http://www.wintips.org/how-to-rotate-and-save-a-video-using-vlc-media-player/ (Disclaimer: This post isn't spam, I have no connection at all to the site or the dude who wrote the instructions. I merely used the instructions to rotate a video of my baby daughter and so I'm just really grateful for it.)

  • I think my version of VLC is broken because VLC won't rotate anything, even for viewing, let alone saving the rotated file..... – boatcoder Feb 16 '20 at 17:21
1

The easiest method I've seen is with QuickTime (Pro), open Movie Properties, click Video Track, then go to Visual Settings and use the arrows to rotate as needed. Then close the Movie Properties, then do a File Save As.

Syclone0044
  • 1,300
  • 9
  • 19
1

I had many .mov files that needed rotation. I used Square 5 Streamclip and did not loose any quality. Super easy to save as in many file formats: http://www.squared5.com/svideo/mpeg-streamclip-win.html

larry
  • 11
  • 1
  • Your answer sounds suspiciously like an advertisement. Please read the [FAQ](http://stackoverflow.com/faq#link-promotion) on these types of posts as answers. If you're going to provide a link to your product at least take the time to show how you would do this in it. At least your answer would have more merit than just a link. – slm Apr 12 '13 at 17:00
  • I tried it. First the "stable" version 1.2 - it does not have the Rotate option. The beta 1.2.1b6 does have the option, but it didn't work for me on 1st try and I didn't pursue any further. At least there's nothing to install - just unzip an executable - and it doesn't seem to hae strings (i.e. crapware) attached. It does require a certain version of `Quicktime Alternative`to be installed. A link to that is on their site – Cristian Diaconescu May 05 '13 at 21:31
1

There's no way to rotate a video without re-encoding it. So you can only appoximate the size and quality.

I recommend VirtualDub to do the rotation. It's free and fast.

fretje
  • 10,692
  • 5
  • 40
  • 63
  • 6
    VirtualDub does not seem to support MP4, but Avidemux does. – sschuberth Jan 10 '13 at 22:00
  • 8
    This is actually not true. The MP4 format supports a `rotate` flag, which informs the player to rotate the video prior to displaying it. The flag can be edited using f.ex. the [MP4Box](http://www.videohelp.com/tools/MP4Box) command-line multiplexer. – Witiko Jun 30 '13 at 17:02