In-depth introduction to vmr7, vmr9, video Renderer, and media cainiao

Source: Internet
Author: User

When using video players such as KMP and MPC, we are always confused about the DirectShow video Renderer. What are vmr7 and vmr9?

Let's start with video Renderer and overlay mixer.

I. Video Renderer and overlay Mixer

As you know, video Renderer (VR) receives raw RGB/YUV data and then displays the filter on the display. To improve the Computer Drawing performance, based on your computer's graphics card capabilities, VR will first use DirectDraw and overlay surfaces. If these features are not supported by the graphics card, VR will use the GDI function for drawing. When the upper-level filter is connected to VR, VR always requires the RGB format of the color bits set for the current display, such as the 24-bit color set for your machine, first, VR requires that the connected media type be rgb24. If your video card supports the YUV overlay surface, VR dynamically changes the connected media type when the filter graph runs, and requires the upper-level filter to output a suitable YUV format. The ivideowindow interface is implemented on the VR filter. The filter graph Manager uses this interface to control the video window.

so what is the problem with overlay mixer? To put it simply, overlay mixer is the filter that can combine several video streams and output them. This filter is specially designed for DVD playback (the DVD has sub-picture or line-21 data needs to be superimposed) or broadcast video streams (including line-21 data. At the same time, it also supports the use of video port extensions by the hardware decoder, that is, bypassing the PCI bus and directly sending the data decoded by the hardware to the video card for display. This filter also gives priority to the DirectDraw capability of the video card and must have an overlay surface. Overlay mixer has an output pin. The output media type is mediatype_video and mediasubtype _ overlay. A video Renderer is usually connected to the end. When the filter graph is running, the actual image display is completed by Overlay mixer, while the video Renderer only manages the video window. Another more common filter is overlay mixer 2. The filter and overlay mixer functions are the same, but the two filters support different format types and merit values.

Overlay mixer uses color keying to synthesize several videos: it sends the Color Key and sub-picture (or line-21) data to the primary surface and the primary video data to the overlay surface; the video card then combines the data on the two surfaces and sends them to the frame buffer for display. In typical cases, overlay mixer uses three input pins: PIN 0 to input primary video data, Pin 1 and pin 2 to input sub-picture data and line-21 data. Overlay mixer internally creates an overlay surface based on the data entered by pin 0. Overlay mixer is connected to video decoder. If this is a software decoder, data transmission on Pin 0 uses the standard imeminputpin interface. If hardware acceleration is used, the iamvideoaccelerator interface must be used on Pin 0. (Note that these two interfaces cannot be used at the same time !) If the last-level filter is the packaging filter of the hardware decoder and the VP pin is used for output, the decoder and overlay mixer use the ivpconfig and ivpnotify interfaces for communication to coordinate the work. Overlay mixer does not support collection devices with 1394 or USB interfaces. Overlay mixer is generally connected to the video Renderer. Video Renderer is only a video window manager. The two filters communicate with each other through the ioverlay and ioverlaypolicy interfaces to coordinate the work. (Video Renderer input pin has two connection modes: When VR directly performs image display, the imeminputpin interface is used to receive video stream data; When overlay mixer performs image display, VR uses the ioverlay interface to communicate with the previous filter. There is no video data transmission between overlay mixer and VR. Note that these two interfaces are not used at the same time !)

2. VMR-7

As you can see, some of the functions of video Renderer and overlay mixer are repeated. Video Renderer was first designed. At the beginning of the design, many applications were not taken into account. Therefore, overlay mixer was used to "patch ". Now, why don't we integrate the two functions? That's exactly what Microsoft did! In Windows XP (Home Edition and Professional Edition), a new filter (the registered name is also called "video Renderer", but the CLSID of the two filters is different and the merit value is different) appears ), replaces the original default video Renderer. This new filter, called video mixing Renderer Filter 7 (VMR-7), uses DirectDraw 7 Technology internally. In this case, vmr is a new generation of video Renderer on Windows. It is worth noting that this filter is only integrated in Windows XP and is not available in any other DirectX release package. The general functions of the VMR-7 are as follows: Support for Alpha mixing of up to 16 input streams; support for access to synthetic images prior to display; Support for inserting third-party developed Video Effects and transitions components. In addition, the RGB media type is not required for vmr connection, because it will not use the GDI function for drawing in any case.

VMR-9

With the release of DirectX 9, there will be a new video Renderer, called the VMR-9. This filter uses direct3d 9 technology. VMR-9 and VMR-7 are two different filters. VMR-9 performance is stronger. It is worth noting that in order to maintain downward compatibility, the merit value of the VMR-9 is not high and it is not used as the system's default video Renderer; if your applicationProgramWe recommend that you use the default video Renderer of your platform.

Iv. Summary

Obviously, the results are already obvious if you want to get advanced features and better quality, please use VMR-9 if you need faster or machine configuration is not high enough, please select VMR-7.

In KMP, the video Renderer is selected as follows:
"select how to output images in KMP. By default, overwrite mixer is recommended. If you are using Windows XP or DirectX 9, select vmr 7
/9 without rendering and output subtitles to the vmr surface. It increases the quality of subtitles. If you cannot switch to desktop mode or overwrite subtitles in vmr output. Select the built-in Renderer to directly output the image through DirectDraw rendering. If it can be correctly covered, then using the covered surface will produce a softer and faster image playback effect ."

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.