Help Me Understand AVI Files and Aspect Ratio

Posted on 2006-05-19
Last Modified: 2013-11-13
I'm having a hell of a time understanding aspect ratios as they apply to AVI formatted video files for a video editing application.

(1) Are the "aspect ratios" reported by Windows Media Player (File>Properties) the pixel aspect ratio (PAR) or the display aspect ratio (DAR)?

(2) Are the "aspect ratios" reported by Windows Media Player a field in all AVI files, or only present in some AVI files, specific to the codec, etc.?

(3) How can I edit/set the aspect ratio in an AVI file, using a tool like VirtualDub?
Question by:todd_e_bryant

    Author Comment

    LHerrou, thanks for reposting in a more appropriate location.
    LVL 18

    Expert Comment

    Pixel aspect ration is not displayed by players usually, since it is a standard for different media. Computer monitors has a 1/1 PAR, but in TV, VCD, DVD the PAR is different from square, look here for some details:
    1. Windows Media Player displays the DAR in pixels and as a ratio.
    2. The avi main header contain two variables, dwWidth and dwHeight, the width and height in pixels. The codec used doesn't matter, avi is a container, not a codec.
    3. Reencoding, but with a lot of comments about PAR and DAR. Read here:

    Author Comment

    The reference table at the end of the document is a great reference.

    Crissand's comment almost got the answer I'm searchign for, but I find myself still confused about how AVI and apps handle aspect ratio.  Let me me precise.  Consider these two cases:

    (a) I create a 720x480 uncompressed AVI file
    (b) I create a 720x480 DV-coded AVI file

    As I understand it, in both cases, there are actually 720x480 pixels of information in the AVI file.  But if you look at the files with Windows Media Player, it will say the aspect ratio of the file (a) is 3:2 (square pixel ratio of 720:480), but it will say the aspect ratio of the file (b) is 4:3 (narrow pixel ratio of 10:11).  Windows Media Player then scales the second AVI file horizontally automatically, so it looks 640x480 on my monitor.

    To summarize:

    (a) Windows Media Player says 720x480, 3:2 aspect ratio (WMP displays as 720x480 on my square pixel monitor)
    (b) Windows Media Player says 720x480, 4:3 aspect ratio (WMP displays as 640x480 on my square pixel monitor)

    So, Windows Media Player treats the source pixel aspect ratio of the two files differently.  It seems Windows Media Player must get the source pixel aspect ratio for the file from somewhere, either in the AVI headers, or perhaps from the fact it's a DV codec, or the codec metadata.  This is the piece I'm missing.

    In particular... is this a general feature?  Can I create an AVI file and specify arbitrary non-square source pixels, or is this just a special case for DV?
    LVL 18

    Accepted Solution

    Yes, the aspect ratio is in the header of opendml avi. Somehow I forgot about the new avi format, open dml, that extend the original definition of Microsoft avi container. More info are in this file, if it's available:
    But, the aspect ratio depends of the codec used. XVid, the free and excellent mpeg4 implementation, has a dialog tab for setting aspect ratio, but with the warning that it can be ignored when decoding.

    Mpeg2 have the aspect ratio in the video sequence header, but the standard state that the decoding process can ignore it. Read about mpeg2 AR here, to better understand the problem:

    My recommendation: If the task is to recode existing video, keep the PAR. If you do your own video, use square pixels, if possible.

    Author Comment

    I'm accepting crissand's answer... it provides background to most of my questions.  I'm still not 100% sure how I can set the PAR in an AVI file, but I have a general understanding what's going on.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    You may or may not be familiar with Kodi ( the open source software media player and entertainment hub that can be installed on Linux, OSX, Windows, iOS, and Android.  Kodi which started off as X-Box Media Center (XBMC) many years…
    Tired of waiting for your show or movie to load?  Are buffering issues a constant problem with your internet connection?  Check this article out to see if these simple adjustments are the solution for you.
    Users will learn how to set proper sequence settings, scale images, paste attributes, add transitions, fades, and music. Open up Final Cut Pro 7 and Create a new Project: Set the Sequence Settings. a) Click File > Easy Setup > Format > Apple ProRe…
    This video will demonstrate how to customize windows, tools, and control bars, and save them as screen sets. Open and resize windows: Customize the toolbar: Customize the control bar: Customize your tool selections: Your screen set is alread…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now