PDA

View Full Version : Does AVI support non-square pixels?


PaulJBis
22nd January 2004, 18:05
Hi all:

I'm not sure if this is the right forum for the question, but I don't know if any of the others would be more adequate either... Does anybody know if the AVI format supports an "anamorphic" flag that tells the player to show the file using non-square pixels, like with MPEG-2?

I'm asking because I've rendered some clips that I edited using Vegas 4.0, and despite telling it to use 720x576 and 1.09 as pixel aspect ratio, when playing the result I still see the image being slightly "compressed" vertically (in other words, as if the player was ignoring the 1.09 part and just playing with square pixels). This happens to me rendering to DIVX 5, HuffyUV and RGB uncompressed... but when I render to AVI using the DV codec, then the result does look right, despite being also 720x576. Which is why I'm wondering whether the pixel aspect ratio information is stored in the AVI format itself, or if it's something that depends on each codec.

alba_zeroX
22nd January 2004, 18:43
monitors use sqaure pixels

PaulJBis
23rd January 2004, 02:55
Okay, but my point is: when watching an MPEG-2 clip, the player will usually "stretch" the image to make it look right, even if its resolution might be something like 480x480. Is there something similar for AVI? Some flag somewhere that tells the player that the pixels are supposed to be non-square (even if they are actually not), so that it will stretch the image to the intended aspect ratio.

radorn
23rd January 2004, 04:12
As far as I know AVI doesn't have such capability.
I think some (free) players like BSplayer or Media Player Classic can make aspect ratio correction if you manually input the aspect ratio.
Anyway, this, of course is done by rescaling the image in real-time not "unsquaring" the pixels (I think)
Newer containers like Matroska can implement such a capability, but I don't know if it is implemented in the specs nor any sowftware to specify such function. But again it would be (in PC world) a rescaling not making the pixels non-square.

This is, I think, because when you display an avi, it is displayed on an existen pixel matrix (your selected screen resolution) and this matrix has an aspect ratio which you can't/shouldn't change, specially if you are displaying the video in your desktop.

AVI is a video format intended for PC's so you should "create" the aspect ratio of your video by setting the right resolution. Any "unsquaring" of the pixels would end in a rescaling so you would end up with the same resolution as if you had encoded the video at a "native" rasolution to aspect ratio basis.

luck

KpeX
23rd January 2004, 04:45
Although AVI as a container does not well support anamorphic capabilities, it is possible to have an anamorphic bitstream within an AVI when using MPEG-4 implementations such as 3ivx or XviD. (Although AVI wasn't designed for MPEG-4 either...but that's another story.)

However playing back anamorphic MPEG-4 encodes within AVI may not work with DirectShow players such as MPC or ZoomPlayer. I'd recommend using VLC (http://www.videolan.org) for anamorphic playback.

zambelli
4th February 2004, 21:30
It is my understanding that the problem is not in storing the PAR or DAR information in the AVI header, but in having a decoder or renderer interpret that information and do the right thing. So technically, you could store "PAR = 1.09" as metadata in an AVI file, but if the decoder/renderer doesn't know what to do with it, then obviously nothing will happen.