Video Processor MFT
The video processor MFT is a Microsoft Media Foundation transform (MFT) that performs colorspace conversion, video resizing, deinterlacing, frame rate conversion, rotation, cropping, spatial left and right view unpacking, and mirroring.
CLSID
CLSID_VideoProcessorMFT
Interfaces
Input Formats
- MFVideoFormat_ARGB32
- MFVideoFormat_AYUV
- MFVideoFormat_I420
- MFVideoFormat_IYUV
- MFVideoFormat_NV11
- MFVideoFormat_NV12
- MFVideoFormat_RGB24
- MFVideoFormat_RGB32
- MFVideoFormat_RGB555
- MFVideoFormat_RGB565
- MFVideoFormat_RGB8
- MFVideoFormat_UYVY
- MFVideoFormat_v410
- MFVideoFormat_Y216
- MFVideoFormat_Y41P
- MFVideoFormat_Y41T
- MFVideoFormat_Y42T
- MFVideoFormat_YUY2
- MFVideoFormat_YV12
- MFVideoFormat_YVYU
Output Formats
- MFVideoFormat_ARGB32
- MFVideoFormat_AYUV
- MFVideoFormat_I420
- MFVideoFormat_IYUV
- MFVideoFormat_NV12
- MFVideoFormat_RGB24
- MFVideoFormat_RGB32
- MFVideoFormat_RGB555
- MFVideoFormat_RGB565
- MFVideoFormat_UYVY
- MFVideoFormat_Y216
- MFVideoFormat_YUY2
- MFVideoFormat_YV12
Not every combination of input and output formats is supported. To test whether a conversion is supported, set the input type and then call IMFTransform::GetOutputAvailableType.
For more information about these formats, see Video Subtype GUIDs.
Remarks
An instance of the video processor can be created in one of the following ways:
- By calling MFTEnumEx. The video processor is registered under the MFT_CATEGORY_VIDEO_PROCESSOR category.
- By calling the COM function CoCreateInstance passing it the CLSID CLSID_VideoProcessorMFT.
The following remarks pertain to working with source rectangles and destination rectangles in the Video Processor MFT. Source and destination rectangles are set with IMFVideoProcessorControl::SetDestinationRectangle and SetSourceRectangle and sometimes with IMFMediaEngineEx::UpdateVideoStream.
- The source rectangle should be aligned and rounded to match the requirements of the color format of the frame inputted to the video processor. This is important because formats like 420 and 422 have requirements about the dimensions and offsets that can be created and accessed. For example, a source rectangle of {1, 0, 319, 240} (left, top, right, bottom) will be rounded to {2, 0, 320, 240} when the input format is 420.
- Both the destination and source rectangle will always be clamped to fit inside their respective frames—the source rectangle to the source frame and the destination rectangle to the destination frame. This means that negative values are not meaningful—they will be always clamped to 0.
- The source rectangle is in the destination frame's coordinate system, minus any destination rectangle. This means that transformations like rotation are "undone" on the source rectangle. Therefore, you do not need to know if the video was rotated or 3D unpacked. For example, you could draw a rectangle on top of the video tag, take the relative coordinates (relative to the video tag), normalize them (range 0 to 1) and pass them down as the source rectangle and they should work as expected, even if the video is being rotated.
The video processor supports GPU-accelerated video processing, using Microsoft Direct3D 11. For more information, see MF_SA_D3D11_AWARE.
Stereoscopic Video
The video processor supports the view unpacking operation on 3D video frames:
If the input frame contains two views packed in the same frame, the video processor can split the views into separate buffers, or extract the base view and discard the second view. To enable view unpacking, set the MF_ENABLE_3DVIDEO_OUTPUT attribute to MF3DVideoOutputType_Stereo or MF3DVideoOutputType_BaseView.
Requirements
Requirement | Value |
---|---|
Header |
|
See also