I'd like to rotate video (mp4) by 180 degrees, but not flip. Is it possible to do it with avconv?

  • I found with both existing answers that theywork with the MP4 files from a Hero 3 camera, but only after I added -c:a copy to the command (just before the output filename). I also found that the second version was indistinguishable quality, but about 50% faster than the chained translate version.
    – Simon
    Dec 30, 2013 at 15:48

5 Answers 5


It is possible using the transpose video filter. You cannot rotate by 180 degrees, but you can rotate by 90 degrees and chain the filter.

avconv -i video.mp4 -vf transpose=1,transpose=1 out.mkv

See transpose in the avconv manpage: http://manpages.ubuntu.com/manpages/quantal/en/man1/avconv.1.html

  • This rotated my video, but the quality drop (resolution and framerate) was massive (iphone .mov file). Jan 6, 2014 at 21:14
  • 1
    transpose=clock works now see my answer
    – Elder Geek
    Feb 27, 2017 at 17:05

Yes, but you'll need to add some additional options to your command for it to work properly. Transpose and vflip/hflip should do the trick, but if you don't tell avconv more detail about what you want, you'll likely get very low quality output try:

 avconv -i original.mp4 -vf "hflip,vflip" -codec:v libx264 -preset slow -crf 20 -codec:a copy flipped.mp4

Notice the -crf option. That sets the output quality. It goes from 0 (lossless) upwards logarithmically. You'll probably want a value between 19 and 25 in most cases. -preset sets the speed of the encoding, either "slow", "medium", or "fast". Slow should get you smaller file sizes with an obvious tradeoff. You should adjust -codec:v to match the original. If you don't set these options you'll get the defaults, which don't work well when flipping iphone video.

  • Unrecognized option 'preset' Failed to set value 'slow' for option 'preset' That's what I got May 12, 2014 at 14:16
  • ...and without it, I got Unknown encoder 'libx264' May 12, 2014 at 14:17
  • 1
    apt-get install libavcodec-extra-53 solved it May 12, 2014 at 14:21

Additional method with avconv is to use vflip and hflip filters. Should run faster and maybe better quality:

avconv -i video.mp4 -vf vflip,hflip out.mp4
  • Same: This rotated my video, but the quality drop (resolution and framerate) was massive (iphone .mov file). Jan 6, 2014 at 21:14
  • 1
    @GringoSuave wcarlson has given you a stripped down example, you still need to add all the -codec:v ... and other tags
    – v010dya
    Nov 10, 2014 at 18:24

I did this:

avconv -i invertedOne.mp4 -c:a copy -vf "hflip,vflip" rightOne.mp4

Full HD video, great results with non perceivable quality loss

  • Pure gold for avconv version 11.12-6:11.12-1~deb8u9, except that I desired a 90-degree clockwise rotation, so I replaced "hflip,vflip" with transpose=clock.
    – Digger
    Nov 13, 2020 at 16:43

For avconv or ffmpeg Under 14.04 or later

There have been some changes to the libav documentation since @phoibos quality answer to this question. You can rotate a video 180 degrees avoiding flipping entirely by chaining 2 90 degree commands together (separated by a comma) I accomplished this with the command

avconv -i inputfile -vf transpose=clock,transpose=clock outputfile

for clockwise rotation.

in ffmpeg the syntax is the same.

ffmpeg -i inputfile -vf transpose=clock,transpose=clock outputfile

where inputfile is your supported input video file and outputfile is your desired output file.

For counter clockwise rotation replace clock with cclock



Testing on Ubuntu 14.04.5 and 16.04 LTS

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .