[Home]History of Aspect Ratio


Revision 11 . . (edit) February 4, 2007 12:34 am by Achurch
Revision 10 . . February 3, 2007 3:45 am by Achurch [Try to clarify things; move examples to a separate page]
Revision 9 . . October 8, 2006 1:42 pm by Achurch [Don't give an example with odd height]
Revision 6 . . April 30, 2006 9:52 pm by gateway
  

Difference (from prior major revision) (minor diff, author diff)

Changed: 1c1
Aspect ratio refers to the ratio between the width and height of an object. Aspect ratios are typically written either as a ratio, such as "4:3" or "16:9", or as a decimal number obtained by dividing the first number by the second, such as 1.333 or 1.778. (In many cases, including these two examples, aspect ratios cannot be represented accurately as decimal numbers, so the ratio format is preferred.)
Aspect ratio refers generally to the ratio between the width and height of an object. Aspect ratios are typically written either as a ratio, such as "4:3" or "16:9", or as a decimal number obtained by dividing the first number by the second, such as 1.333 or 1.778. (In many cases, including these two examples, aspect ratios cannot be represented accurately as decimal numbers, so the ratio format is preferred.)

Changed: 3c3,7
There are two types of aspect ratios involved in video editing. One is display aspect ratio or DAR; this is the ratio most commonly referred to by the term "aspect ratio", and is the ratio of the video frame's physical (displayed) width to its height, regardless of the number of pixels used to represent the video image. The other, pixel aspect ratio or PAR (also known as "sample aspect ratio" or SAR), is the ratio of the width to the height of a single pixel in the video image. These two aspect ratios are related to each other and the number of pixels in the video frame as follows:
There are two types of aspect ratios involved in video editing. One is display aspect ratio or DAR; this is the ratio most commonly referred to by the term "aspect ratio", and is the ratio of the video frame's physical (displayed) width to its height, regardless of the number of pixels used to represent the video image. Typical DAR values are 4:3 for standard-definition video or 16:9 for widescreen television.

The other type of aspect ratio is pixel aspect ratio, or PAR (also known as "sample aspect ratio" or SAR). This is the ratio of the width to the height of a single pixel in the video image; a PAR of 1:1 means that each pixel is a perfect square, while a PAR of 2:1 would mean that each pixel is a rectangle twice as wide as it is tall. PAR can be used to refer either to the pixels in a video file, or to the pixels on a physical display device such as a television.

These two aspect ratios are related to each other and the number of pixels in the video frame (or display device) as follows:

Changed: 10,31c14
When transcoding video between different frame sizes, it is important to take both of these aspect ratios into account. The PAR may be determined by the display hardware; for example, most LCD televisions and monitors have a PAR of 1:1. (CRT monitors and televisions are able to change their PAR on the fly, because the analog signals which they use do not have the concept of "pixels".) The DAR, on the other hand, is an inherent attribute of the video stream; if the DAR changes, the video will look "stretched" either horizontally or vertically.

If you know the DAR of your input video, the PAR of the device you're going to display it on, and the target width or height, you can determine the other size value (height or width) using the formula above:
height = width * PAR / DAR
or
width = height * DAR / PAR
For example, if you're transcoding a 720x576, DAR 4:3 video for display on a computer monitor (PAR 1:1), and you decide to keep the height the same (576), then the new width would be:
width = 576 * (4/3) / (1/1) = 576 * 4/3 = 768




As another example, suppose you have a 672x272 video file on your computer that you want to transcode to an NTSC (720x480) DVD. If you don't know the DAR, but you assume the intended PAR is 1:1 (standard for computer monitors), you can calculate the DAR as:
DAR = PAR * width / height = (1/1) * 672 / 272 = 42:17
or about 2.47:1. Now, we know that the width and height must fit within the DVD frame size, so we calculate using both the width and the height:
width = 720 height = width * PAR / DAR = 720 * (1/1) / (42/17) = 292 (291.428)
height = 480 width = height * DAR / PAR = 480 * (42/17) / (1/1) = 1186 (1185.882)
giving us possible frame sizes of either 720x292(*) or 1186x480. The latter is obviously too big for DVD video, so we use the former, and add black bars to the top and bottom with the -Y option to transcode:
transcode -Z 720x292 -Y -94,0 (other options)

(*) 291.428 is rounded up to 292 because the most common video image format, YUV 4:2:0, encodes pixels in 2x2 groups, so width and height values must always be even.



When transcoding a video, it is important to take both of these aspect ratios into account. For example, most NTSC DVDs use a video frame size of 720x480 pixels but a DAR of either 4:3 or 16:9, meaning that the PAR is not 1:1. If you transcode that DVD to an AVI file without changing the size, the resulting video may look "squished" in one direction. This is because most video playing software (with the notable exception of MPlayer) assumes that AVI files have a PAR of 1:1, resulting in a DAR of 720:480, or 3:2, for the displayed video frame.

Changed: 33c16
Note that when the --export prof, --export asr, and -Z options are used with Transcode, all geometry calculations are done automagically for you, assuming that Transcode is able to probe the input files successfully. In that case the -Z option should be set to the default for the output format, and the fast flag should always be used.
For example, to create an NTSC DVD compatible mpg you would use -Z 720x480,fast. The appropriate geometry calculations will then be done by Transcode. For some reason this only works when the fast flag is used, even if the source geometry is incompatible with the fast flag!
Choosing the proper size for a video when transcoding can be a confusing task. For some examples of how to determine size and aspect ratio, see: Calculating frame size and aspect ratio

Transcode Wiki | Recent Changes | Preferences
Search: