7.9. Preserving aspect ratio
Prev | Chapter 7. Encoding with MEncoder | Next

## 7.9. Preserving aspect ratio

DVDs and SVCDs (i.e. MPEG1/2) files contain an aspect ratio value, which describes how the player should scale the video stream, so humans won't have egg heads (ex.: 480x480 + 4:3 = 640x480). However when encoding to AVI (DivX) files, you have be aware that AVI headers don't store this value. Rescaling the movie is disgusting and time consuming, there has to be a better way!

There is

MPEG4 has an unique feature: the video stream can contain its needed aspect ratio. Yes, just like MPEG1/2 (DVD, SVCD) and H263 files. Regretfully, there are no video players outside which support this attribute of MPEG4, except MPlayer.

This feature can be used only with libavcodec's `mpeg4` codec. Keep in mind: although MPlayer will correctly play the created file, other players will use the wrong aspect ratio.

You seriously should crop the black bands over and below the movie image. See the man page for the usage of the `cropdetect` and `crop` filters.

Usage

    mencoder sample-svcd.mpg -ovc lavc -lavcopts vcodec=mpeg4:autoaspect -vf crop=714:548:0:14 -oac copy -o output.avi

Prev | Up | Next
7.8. Extracting DVD subtitles to Vobsub file | Home | 7.10. Custom inter/intra matrices