Aspect Ratio Correction

[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

This topic applies to Windows XP Service Pack 2 or later.

In mixing mode, the VMR sizes the video to the correct aspect ratio. (Exception: See Non-Square Mixing.) This may require stretching the video if the preferred aspect ratio is not the same as the image's physical aspect ratio. For example, digital video (DV) format is 720 x 480 pixels (3:2) but should be displayed at a 4:3 aspect ratio.

The VMR supports two different behaviors for aspect ratio correction:

  • Adjust either the horizontal or vertical size, so that the image is always stretched, never shrunk. This is now the default behavior.
  • Adjust the horizontal size, either stretching or shrinking the video.

Because the second behavior (horizontal adjustment only) may entail shrinking the video, the output image may have less resolution. For this reason, the first behavior is preferred. For example, in the case of 720 x 480 video at 4:3 aspect ratio, the default behavior produces a 720 x 550 image, while horizontal adjustment produces a smaller 640 x 480 image.

VMR-7: To set the aspect ratio correction preference, call IVMRMixerControl::SetMixingPrefs. Set the MixerPref_ARAdjustXorY flag for the default behavior, or clear this flag for horizontal adjustment only.

VMR-9: To set the aspect ratio correction preference, call IVMRMixerControl9::SetMixingPrefs. Set the MixerPref9_ARAdjustXorY flag for the default behavior, or clear this flag for horizontal adjustment only.

Using VMR Mixing Mode