How to convert a 16:9 movie to a 4:3 letterbox version?

Suppose you have a 16:9 aspect ratio wide-format movie file and you want to make a version ideal for playing on a 4:3 device. Since you don't want to clip any of the image or distort the picture, so you want to make a letterbox version.

That is, you want a 4:3 movie with black bars at the top and bottom surrounding the moving image rectangle, which has true 16:9 dimensions.

Can you tell us how to do this in Windows or Linux, using free command-line or GUI tools.

Newer versions of ffmpeg deprecate the "padtop" and "padbottom" options. To do it with the new version, use the same basic logic above. In my case, my original video was 720x404, but I wanted to encode 720x480 - padding the top and bottom. So per-above:

``````(480-404) / 2 = 38
``````

i.e. Pad 38 pixels to both the top and bottom. The "pad" command wants the size of the video you are encoding, and how far left and down you want to move the original. So:

``````-vf pad=720:480:0:38
``````

note that the output resolution needs to be written as 720:480 not 720x480

This can be done in ffmpeg. Before you begin, read this great resource on understanding the math: http://www.doom9.org/index.html?/aspectratios.htm

First, calculate the top and bottom padding values.

``````long=width of original,
skinny=height of orginal
``````

NOTE: if the top and bottom paddings are not EVEN numbers, force them even so that they sum to totalPadding (e.g. not 47 and 53, but 48 and 52 to get 100)

Second, add letterbox bars and ensure outfile will be recognized as 4x3. Suppose your paddings came out to be 58 pixels for both top and bottom

``````ffmpeg -i Infile.avi -padtop 58 -padbottom 58 -padcolor 000000 -aspect 4:3 Outfile_letterbox.mpg
``````

By "ideal" I'm guessing your playback device is stretching videos?

The ideal situation is no to add black bars to the video, but to display the video with black bars - re-encoding a video to add bars not only breaks the rule of "encode once" but ALSO lowers the over-all quality per bit by adding extra, useless information.

Can you explain further what problem you're trying to solve?

• I have a 4:3 TV. I have 16:9 movies. I burn them to playable DVDs and one of two things happens 1) they get resized to 4:3 (i.e. stretched) 2) they don't get stretched but don't show as letterboxed. Since it's impossible to have an unstretched 16:9 image fill up a 4:3 screen, this means the edges are getting cropped. I'm using some cheesy commercial software to make playable DVDs (Cyberlink PowerProducer). Maybe that is the problem. I'm open to other ways of making the DVDs from .avi and .mpg files in the first place. Aug 20, 2009 at 13:12
• Ahhh, ok, there's the problem - I don't use disks anymore, but I suggest shopping around for other software - off the top of my head I think you need to be able to export with anamorphic pixels - this will stretch the video to 4:3 but tell the player to change the ratio. Aug 20, 2009 at 13:21

``````AviSource("c:\movies\somemovie.avi")
BicubicResize(720,266,0,0.5)