MJPEG VidRotate


If you're taking "long photos", and uploading them somewhere like flickr, it will feel perfectly natural to take them in a portrait orientation. So you need some way of taking the file, and turning it on its side.

VidRotate is a simple Windows batch script which brings together a bunch of utilities to rotate a MJPEG video in an AVI container, as produced by a digital camera. In particular, it's been tested with videos from *my* digital camera - a Casio Exilim EX-Z1050. Your mileage, as they say, may vary.

For more background, see the blog post announcing the scripts.


  1. Download the latest zip file.
  2. Unzip somewhere on your hard-disk
  3. Open a Command Prompt
  4. Run path\to\rotate.cmd "input file.avi" "output file.avi"

If those instructions are too technical, you shouldn't be using this script right now. I can't stress enough that this is prototype-quality code, and is used at your own risk!

Known Limitations

Technical Info

The script is really a simple bit of glue to automate a series of command-line utilities. The utilities included are:

MJPEG tools [GPL]
provides the bulk of functionality
jpegtran [Licence unclear]
to rotate the images
FFmpeg [LGPL / GPL], unofficial Windows autobuild
a real sledgehammer-to-crack-a-nut, this is the only tool I've found so far to extract the audio from the original video

To Do

This is still pretty much prototype code, not least because my Windows CMD scripting skills are rudimentary at best.

Licensing and Contact Info

© Script Copyright Rowan Collins, 2009; included utilities copyright of their respective developers

This program is distributed under the GNU GPLv2

If you like - or hate - it, please contact me on vidrotate [[AAHTT]] rwec.co.uk