Video with Linux

About Aspect Ratios

We shall talk about three aspect ratios: frame-size aspect ratio (far), the pixel aspect ratio (par) and the the display aspect ratio (dar). All aspect ratios are given as the ratio of width to height of the rectangle. The frame-size aspect ratio is the shape of the data stored. The pixel aspect ratio determines the shape of a pixel. The display aspect ratio determines the shape of the image that will be displayed.

In a sensible world there would be a relationship between the frame-size aspect ratio, pixel aspect ratio and display aspect ratio given by

    far*par=dar

Pixel Aspect Ratio Confusion

There is little confusion about 704x480 NTSC video. The frame-size aspect ratio, pixel aspect ratio and display aspect ratio are given by
    format     frame size     far     par     dar
    NTSC        704x480      22/15   10/11    4/3
After doing some research there seem to be some differences of opinion what the pixel aspect ratio is for DV NSTC and D1 NTSC formats. Some sources state that ITU-R BT.601-6 infers a pixel aspect ratio of 10/11 for all these NTSC 480i formats.
    format     frame size     far     par     dar
    D1 NTSC     720x486      40/27   10/11    4/3
    DV NTSC     720x480       3/2    10/11    4/3
In this case the equation far*par=dar doesn't hold exactly for D1 or DV NTSC video. In particular, there are more pixels in the frames of these video formats than needed. Sources that promote the constant value of 10/11 for the pixel aspect ratio state that the reason for these extra pixels is to protect the image from minor pixel shifts that might result from analog technology.

Other sources indicate the pixel aspect ratio is not 10/11 for D1 and DV NTSC formats, but instead takes on the mathematical values so far*par=dar holds exactly for each frame size.

    format     frame size     far     par     dar
    D1 NTSC     720x486      40/27   9/10     4/3
    DV NTSC     720x480       3/2    8/9      4/3
Note that if far*par=dar were to hold exactly for widescreen NTSC video then
    format     frame size     far     par     dar
    NTSC        704x480      22/15   40/33    16/9
    D1 NTSC     720x486      40/27    6/5     16/9
    DV NTSC     720x480       3/2    32/27    16/9

The Pixel Aspect Ratio of DV Video

To determine what the pixel aspect ratio is for the Canon Elura 90 miniDV camcorder, I made a video of a window with the camera held level and with the camera tilted vertically. Then I measured the width and height of the window in pixels for each orientation and used this to solve for the pixel aspect ratio.

Note that dvgrab was used to download the DV source video and mplayer was used to obtain unscaled 720x480 frames with the command line

$ mplayer -aspect 720:480 -vf screenshot src001.dv
Frames obtained using vlc give the same results.

When the camera is held level

    width of window              pixels in width
    ----------------  =  par *   ---------------
    height of window             pixels in height
and when the camera is held tilted
    height of window            pixels in height
    ----------------  =  par *  ---------------- .
    width of window             pixels in width
Setting
              width of window
    lambda =  ---------------
              height of window
and using the pixel measurements obtained from the extracted video frames leads to
    lambda = par * 349/347

    1/lambda = par * 385/306.
These equations have the solution
    par = 0.88896.
This agrees to more than 3 significant digits with a pixel aspect ratio of 8/9. Therefore, the Canon Elura 90 appears to obey far*par=dar rather than ITU-R BT.601-6.

Repeat the same experiment for the Canon Elura 90 in widescreen mode with image stabilization turned off. The frames are

The equations are

    lambda = par * 342/364

    1/lambda = par * 302/400
which have the solution
    par = 1.18731.
This agrees to more than three significant digits with the aspect ratio 32/27. The Canon Elura 90 also appears to obey far*par=dar for widescreen.

I repeated the calculations for the Canon Vixia HV30 for HDV source exported as DV through firewire. The computed value for the pixel aspect ratio of the DV footage was 1.18374 which again agrees to more than three significant digits with 32/27.

The Pixel Aspect Ratio of a DVD Player

Having determined the pixel aspect ratio is 8/9 for the video captured by the Canon Elura 90, it remains to determine the pixel aspect ratio for a DVD player. To do this I created three different DVD compliant mpeg2 video streams for testing. I started with three images

where

These images were encoded as 20 second long DVD compliant mpeg2 video streams using mjpegtools, the script make-mpg and the commands
$ ./make-mpg 720x480.jpg
$ ./make-mpg 704x480.jpg
$ ./make-mpg 720x480pad.jpg
Playing the first of these video streams using mplayer yields output which contained the lines
Playing 720x480.mpg.
VO: [xv] 720x480 => 720x540 Planar YV12 
This indicates that mplayer plays NSTC video streams with a 720x480 frame size using a pixel aspect ratio 8/9. This is consistent with the camcorder.

Now make a test DVD for determining the pixel aspect ratio of a DVD player. Each video stream needs to be in a separate titleset for dvdauthor to recognize the different resolutions. The dvdauthor configuration file dvd.xml will create a DVD that plays in a loop switching between files. It's an infinite loop, so don't leave it in your DVD player overnight. Author and burn the DVD with the commands

$ dvdauthor -o final -x dvd.xml
$ su
# growisofs -dvd-compat -dvd-video -speed=1 -Z/dev/dvd final/
# exit
The results from playing the test DVD may be interpreted as follows:

I tested the Toshiba HD-A2 HD-DVD player and the Panasonic DMP-BD70V Blu-ray player. Both players displayed 720x480 video with a 10/11 pixel aspect ratio. The Panasonic player cropped the extra pixels and the Toshiba displayed a slightly wider image by including them.

The Pixel Aspect Ratio for HD Video

There seems to be less confusion about the pixel aspect ratio for high definition video formats.
    format     frame size     far     par     dar
    HDV        1440x1080      4/3     4/3     16/9
    1080p      1920x1080     16/9     1/1     16/9
    720p       1280x720      16/9     1/1     16/9

Conclusions

We have determined that 720x480 DV NTSC video recorded by the Canon Elura 90 in fullscreen mode has a pixel aspect ratio of 8/9. We have determined that 720x480 mpeg2 NTSC video encoded by mjpegtools and authored with dvdauthor is displayed by the Toshiba HD-A2 HD-DVD player and the Panasonic DMP-BD70V Blu-ray player with a pixel aspect ratio of 10/11. Therefore, the pixel aspect ratio for 720x480 NTSC video used by some camcorders is different than used by some DVD players.

This means the 720x480 DV source from the Canon Elura 90 in both fullscreen and widescreen modes should be rescaled and encoded as a 704x480 mpeg2 DVD compliant video stream in order to play without image distortion on the Toshiba HD-A2 or the Panasonic DMP-BD70V players. Otherwise, the picture will appear wider by about 2.3 percent.

Many sites on the internet suggest that the pixel aspect ratio of DV source is 10/11 for fullscreen and 40/33 for widescreen. A reliable source supporting this claim is the Sony DVCAM Overview. However, this is not what my measurements show for the camcorders I tested. One reference supporting what I found is at afterdawn.com which stated

There seems to be no consensus on the pixel aspect ratio for DV video. It remains to determine whether other camcorders, DVD players and workflows yield different results. Following the method given above it should be possible to determine the pixel aspect ratio of any particular camcorder and DVD player experimentally.
Page written and maintained by Eric Olson
Last Updated: Tue Jul 21 17:56:36 PDT 2009