How to properly handle SD video’s aspect ratio in Flash
Who work with SD videos knows that a PAL SD video has a resolution of 720×576 pixel.
Now, if you encode such a video at the original resolution and playback it in Flash using 720 by 576 pixels, You will notice that the picture is slightly streched vertically (compressed horizontally).
It is also known that Aspect Ratio of SD video is usually 4:3, which means that the ratio between horizantal and vertical “display” measures of video is 4:3=1,33.
But if you divide 720 by 576 you get 1,25…There is something wrong, but what ?
DAR & PAR
Let me introduce you DAR and PAR. The DAR of a video is the aforementioned Display Aspect Ratio of a video which in the case of SD is 4:3. The second parameter is instead the Pixel Aspect Ratio, which is the ratio between horizontal and vertical sizes of the single pixel in the display device.
Now, you have to know that computer monitors and LCD television devices have a PAR of exactly 1, but the good old CRT televisions have a PAR of 1.066 which means that pixels on a CRT tv are not squares but slighlty wider rectangles.
Now, the correct formula to calculate the exact “display” size of a video is:
height = width * PAR / DAR
width = height * DAR / PAR
So, if you leave the vertial resolution to 576 pixels, you have a correct horizzontal display resolution of 768 pixels. Now, 768 : 576 = 4 : 3 and the proprotions of display video are right.