Rotating Digital Camera Movies by 90° and Converting to DVD

Maybe you recorded a video using your digital camera in "portrait" mode, and now you would like to watch it on something other than the camera's display. That means that you will need to rotate it by 90° and probably convert it to DVD format. Here's how.
The description is, of course, how to do this with Linux or BSD or Mac OS. Apparently there are other operating systems out there. Incredibly expensive and incredibly buggy operating systems, so I don't see why anyone would use them.

I learned how to do this from this page:
http://therning.org/niklas/node/160
However, I have updated a couple of steps to track changes in the mencoder tool, and added steps to turn it into a DVD.

It's easy and free with Linux, BSD, or similar!

Rotate the Video

Use mencoder, part of the MPlayer package, to do this. The following assumes that input.avi is the name of the AVI video file from your camera (change as appropriate), and that it's 320x240 resolution (seems most common).

$ mencoder -ovc lavc -lavcopts vcodec=mjpeg -vf rotate=1 -oac copy input.avi -o rotated.avi 

Look at the result. Is it upside down? Then you need to rotate it 90 degrees in the opposite direction. Change rotate=1 to rotate=2 in the command:

$ mencoder -ovc lavc -lavcopts vcodec=mjpeg -vf rotate=2 -oac copy input.avi -o rotated.avi

Look at the resulting rotated.avi and verify that it's right-side up.

Pad to 4:3 Aspect Ratio

Use mencoder again to place the tall and narrow video between black borders, giving you a video stream of the right orientation and shape:

$ mencoder -ovc lavc -lavcopts vcodec=mjpeg -vf expand=427:320 -oac copy rotated.avi -o padded.avi 

Look at the resulting padded.avi and verify that it resembles what you would want to see on the TV. The requested 427x320 is very close to 4:3.

Convert to DVD

This is taken from my page on converting PAL DVDs to NTSC. First, convert to the correct size and frame rate:

$ ffmpeg -i padded.avi -target ntsc-dvd -s 720x480 -r 29.970 my-video-dvd.mpeg 

Next, create a new directory and build the DVD file system data structure in it:

$ mkdir my-dvd
$ dvdauthor -o my-dvd -t my-video-dvd.mpeg
$ dvdauthor -o my-dvd -T 

The result is a new directory my-dvd containing the DVD-specific subdirectories AUDIO_TS and VIDEO_TS, ready to be burned onto a DVD with K3b or similar.


How to Copy DVDs

How to download videos from YouTube and convert them to XviD and DivX

Converting PAL DVDs to NTSC, Creating and Burning Your Own DVDs, and other Video Conversions

How to Extract MP3 Audio from a Video File

Converting Audio Files from WMA or FLAC to MP3

Various Technical Topics

Radio topics — Ham radio, construction and repair, propagation, frequencies, etc

Click here to inquire about advertising on this or any page on this site.
Home Unix/Linux Networking Cybersecurity Travel Technical Radio Site Map Contact


Use /bin/vi! Manipulate images with ImageMagick! Hosted on OpenBSD
Hosted on Apache This site is viewable with any browser Valid XHTML 1.0! Valid CSS!
© Bob Cromwell Feb 2012. Created with /bin/vi and ImageMagick, hosted on OpenBSD with Apache.    Root password available here, privacy policy here.