Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to use Ubuntu and preferably standard packages such as ffmpeg to rotate a .3gp video file by 90 degrees in any direction. Preferably a command line or Python script.

How can I do that?

share|improve this question
I found that ffmpeg was able to do this. See, e.g. Ubuntu forums: rotate video 90 degrees – Simon Dec 15 '11 at 12:26
up vote 4 down vote accepted

by using VLC, you may rotate the video by going to Tools >> Preferences...

And select "All" for show settings. Then go to: Video >> Filters >> Rotate

After setting the degree you want, you can rotate by going to Tools > Effects and Filters > Video Effects > Geometry .. .

alt text

the one I've tested is mp4 but I believe that VLC can support 3gp too. hope this helps. :)

share|improve this answer
i can view the video rotated, but how do you make the change persist – justinhj Jun 6 '10 at 9:14

From the command-line, with ffmpeg:

ffmpeg -i input.3gp -filter:v transpose=1 \
-c:v libx264 -preset veryfast -crf 22 \
-c:a copy \
-metadata:s:v rotate="" \
  • transpose=1 will rotate the video 90 degrees clockwise; to rotate anti-clockwise, use transpose=2. See the transpose documentation for a bit more information.

  • -metadata:s:v rotate="" will strip any existing video stream rotation metadata; otherwise ffmpeg will copy it which may cause your player to apply additional unwanted rotation.

  • For information on the video encoding settings here, see this H.264 encoding guide and the AAC encoding guide if you want to re-encode the audio instead of stream copying.

share|improve this answer

Avidemux should be able to do this.

Do Video->Filters->Rotate(x degrees)->Close then File->Save->Save Video

share|improve this answer

I solved a similar problem — I had a .MOV that was taken upside-down (i.e., rotated 180 degrees) which I wanted to set right.

On my Ubuntu 14.04 system, I ran avconv with essentially the same command-line options as given for ffmpeg in evilsoup's answer.  Apparently, it does not support a transpose option for 180-degree rotation, so I did the 90-degree clockwise (i.e., transpose=1) twice.

When I tried minimal options, I got a message to the effect that:

encoder 'aac' is experimental and might produce bad results.

Add '-strict experimental' if you want to use it.

and the output file was zero length, so I added the -strict experimental.

Command lines that worked were:

avconv -i IMG_orignl.MOV -filter:v 'transpose=1' -strict experimental IMG_interm.MOV
avconv -i IMG_interm.MOV -filter:v 'transpose=1' -strict experimental IMG_result.MOV

The result was satisfactory, with unexplained side-effects:

  1. Intermediate file was smaller than original by ~14%.
  2. Result file was smaller than intermediate by ~18% and smaller than original by almost 30%.
  3. Result file shows thumbnail, while original and intermediate show merely generic icon.

Not that I'm complaining: these are desirable; I just don't understand why they came about...

share|improve this answer
Welcome to Super User.  (1) While some background information in your answer may be helpful, it’s best to focus on your solution to the problem.  I’ve edited your answer to illustrate; feel free to edit it further if you believe that I changed too much.  (2) The display order of answers may vary; it’s better to identify other answer(s) explicitly rather than saying “above”.  (2½) I hope you presented your avconv command lines in their entirety, and not just the differences from the ffmpeg command.  Your answer should be self-sufficient; the other answer might go away.  (3) Good luck! – G-Man Jun 8 '15 at 4:25
Also, I assume that when you say “result was satisfactory” you mean that your “result” file looked as good as the original file.  You might want to (edit your message to) say so explicitly.  (Such information — i.e., whether you lost video quality visible to the eye — is important to your answer, and shouldn’t be hidden away in a comment.)  Also, I betcha you could leave out the quotes and say just -filter:v transpose=1 …. – G-Man Jun 8 '15 at 4:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.