How to rotate videos with ffmpeg or VLC

The option to rotate is -vf as in "video filter". Ffmpeg comes with tons of filters, one of them is "transpose". You can rotate a video 90 degrees like this:
ffmpeg -i video.mp4 -acodec copy -sameq -vf transpose=1 out.mp4

The various parameter values for "transpose" are:
  • 0: rotate by 90 degrees counterclockwise and vertically flip
  • 1: rotate by 90 degrees clockwise
  • 2: rotate by 90 degrees counterclockwise
  • 3: rotate by 90 degrees clockwise and vertically flip
To vertically flip the video, use the "vflip" filter. To horizontally flip, use "hflip".
Eg. to rotate the video by 180 degrees you can combine both flips
ffmpeg -i video.mp4 -acodec copy -sameq -vf vflip,hflip out.mp4

You can do similiar rotations in VLC too.

Using the commandline:
vlc --started-from-file video.mp4 --video-filter "rotate{angle=180}"

Using the GUI: Tools / Effects & Filters / Video Effects / Geometry / Transform / Rotate by 180 degrees
(this is based on VLC v2.0.4 for Windows)