VMR (Video Mixing Renderer)

In terms of both performance and breadth of features, the Video Mixing Renderer (VMR) filter represents the next generation in video rendering on the Windows platform. The VMR replaces the Overlay Mixer and Video Renderer, and adds many new mixing features.

The VMR was first made available for the Windows XP platforms only. Beginning with DirectX 9.0, a separate version of the VMR, called the VMR-9, is available for redistribution on all platforms supported by DirectX. The two VMR filters are very similar in their implementation and the interfaces that they expose. The primary difference is that the original VMR (now called the VMR-7) uses DirectDraw 7 internally to control the video hardware, while the new version of VMR (called the VMR-9) uses Direct3D 9.

VMR vs. Previous DirectShow Renderers

With the old filters, different renderers would be required in the graph depending on the hardware configuration.

The Video Renderer filter was used to render a single video stream in non-video port scenarios. It was based on graphics hardware technology which is now over five years old, and on an older version of DirectDraw. In certain scenarios, it uses GDI for rendering. This is done either to conserve video resources, which were much more limited five years ago, or else to overcome limitations in DirectDraw that were related to multi-monitor support. Neither the VMR-7 nor the VMR-9 ever uses GDI for rendering; the VMR-7 is based completely on DirectDraw 7 and the VMR-9 is based on Direct3D 9.

In scenarios involving either a video port or multiple video input streams, prior to the VMR the Overlay Mixer filter was used for rendering. This filter only uses the hardware overlay on the graphics card, and so is generally limited to the one overlay surface provided by most cards. The Overlay Mixer performs destination color keying, but it is not capable of alpha blending. Because it does not have a window manager, it must use a second filter, the Video Renderer, for window management. The VMR is capable of true alpha blending, and can create multiple overlays in software in addition to the hardware overlays.

The VMR is more robust than the earlier renderers, in part because it only uses DirectDraw 7 (or Direct3D 9 if you are using the VMR-9) interfaces, as opposed to the old renderers which used a mixture of interfaces from older and newer versions of DirectDraw. The VMR also employs a new image presentation mechanism which is designed for current and future generations of adapters, which have support for Direct3D, increased VRAM and video memory bandwidth, and hardware acceleration features.

VMR System Requirements

The VMR uses the graphics-processing capabilities of the computer's display card exclusively; the VMR does not perform any blending or rendering of video using the host processor, because to do so would greatly impact the frame rate and quality of the video being displayed. When taking advantage of the new features offered by the VMR, particularly blending of multiple video streams and/or application images, the overall performance obtained is highly dependent on the capabilities of the graphics card being used on the computer. Graphics cards that perform well with the VMR have the following hardware support built into them:

- Support for YUV and "non-power of 2" Direct3D texture surfaces.
- The ability to StretchBlt from YUV to RGB DirectDraw surfaces.
- At least 16MB of video memory if multiple video streams are to be blended together. The actual amount of memory required is dependent on the image size of the video streams and resolution of the display mode being used.
- Support for an RGB overlay or the ability to blend to a YUV overlay surface.
- Hardware-accelerated video (support for DirectX Video Acceleration) decoding.
- High pixel fill rates.

* Note The VMR requires that the system monitor be set for a color depth of at least 16 bits. The VMR cannot be put into a run state if the monitor is set for 256 colors. Also, some video cards cannot perform Direct3D operations when the display is set to 24 bits per pixel.

Choosing the Right Renderer

With DirectX 9.0, DirectShow provides four separate video renderers: the old Video Renderer, the Overlay Mixer, the VMR-7 and the VMR-9. For various reasons, no single renderer is preferable in all scenarios. The following guidelines should help you decide which renderer to use in your application:

- Existing applications that require only basic video rendering, with no mixing
Use the VMR-9 for its improved de-interlacing and ProcAmp support. Use the old default video renderer if you know in advance that the video hardware is not sufficient to support the VMR-7 or VMR-9.

- Applications based on devices that use video ports
Use the Overlay Mixer if support on platforms earlier than Windows XP is required. If the application will only run on Windows XP, then use the VMR-7. The VMR-9 does not support video ports.

- Applications that require any of the special capabilities of the VMR
Use the VMR-9 rather than the VMR-7 because the VMR-9 supports the latest Direct3D capabilities and is supported on all platforms supported by DirectX. If you specifically target the VMR-7, your application will run only on Windows XP.

Extract from MSDN