Skip to content

Instantly share code, notes, and snippets.

@gwpl
Last active December 25, 2018 23:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gwpl/1ab8876be7e6ac656196ba6888ff800d to your computer and use it in GitHub Desktop.
Save gwpl/1ab8876be7e6ac656196ba6888ff800d to your computer and use it in GitHub Desktop.
rotate video cli linux commandline

from : https://www.thelinuxblog.com/rotating-videos-in-linux/

mencoder -ovc lavc -vop rotate=1 -oac copy input.mpg -o output.mpg
  • 0 Rotate by 90 degrees clockwise and flip (default).
  • 1 Rotate by 90 degrees clockwise.
  • 2 Rotate by 90 degrees counterclockwise.
  • 3 Rotate by 90 degrees counterclockwise and flip.

on my experience you need to change -vop flag with -vf

Above command leaves low quality of output.

In search of finding better quality I came across this: https://linhost.info/2009/01/convert-videos-with-mencoder-and-keep-the-original-quality/

mencoder filename.mov -ovc xvid -oac mp3lame -xvidencopts fixed_quant=4 -o output.mp4

So I try:

mencoder -ovc xvid -oac mp3lame -xvidencopts fixed_quant=4  -vf rotate=2 -oac copy MVI_2523.AVI -o MVI_2523.rotated.AVI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment