How can I rotate video by 180 degrees with avconv
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
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.
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