Display Aspect Ratio

From Free Knowledge Base- The DUCK Project: information for everyone
Jump to: navigation, search

There is a difference between Sample Aspect Ratio (SAR) and Display Aspect Ratio (DAR).

Sample Aspect Ratio (SAR) - count of pixels horizontal ratio to vertical. *** the Pixel Aspect Ratio (PAR)

Display Aspect Ratio (DAR) - a value in the file that tells the video player how to display the video.

To scale the image and change SAR (while transcoding), try:

ffmpeg -i <INPUT_FILE> -vf scale=720:540 -c:v <Video_Codec> <OUTPUT_FILE>

On the other hand, if you just want to change the metadata flag and adjust the DAR, you will be able to stream copy the video. To do this, try:

ffmpeg -i <INPUT_FILE> -aspect 720:540 -c copy [OUTPUT_FILE]


*** SAR , DAR , PAR

We discussed the Sample Aspect Ratio or SAR. Lets add more confusion. Other experts describe SAR as the Storage Aspect Ratio and introduce a third element to the discussion called the Pixel Aspect Ratio (PAR).

When we discuss this type of PAR, we are considering the symmetry of the actual pixel. Consider the pixel as a square box or rectangle. If it is a symmetrical square box, then the PAR or Pixel Aspect Ratio is 1:1 and in this case SAR and PAR are the same thing. However, the pixel might be asymmetrical and be elongated, making SAR and PAR dissimulator.

Anamorphic video is video with rectangular or elongated pixels. Since they are not square, the SAR does not match the PAR. Correction requires altering the video by encoding with the introduction of duplicate pixels in some rows and not in others so that the result utilizes square pixels without doubling every pixel, thus correcting the failure or SAR to match PAR. Various algorithms are used to accomplish this with individual preference varying based on result.

Displaying Video

It is ideal if the viewing aspect ratio, the DAR, matches the SAR. For example, if a video recorded with a frame size of 1280x720 has a DAR value of 16:9 then any video player will render this video correctly in proportion.