0

I am writing an application above a camera driver, I am using IMFSourceReader in a synchronized way to extract IMFSamples from the driver. I am able to config the SourceReader media types of each stream and generate sample in 2 video formats that my camera driver supports, NV12 and YUY2. What I want is a video format that I can display easily like RGB, so I was looking for a MFT that can convert these media types, but I am not sure I can connect it to the SourceReader, as I understood from media foundation documentation I see that the IMFSourceReader can load a decoder but a decoder is not a converter…</p>

I was wondering what is the best way to convert a video source output media type to a different media type like RGB (beside doing the conversion by myself), while still using IMFSourceReader?

4

1 回答 1

1

在 Windows 8 上,您可以设置 MF_SOURCE_READER_ENABLE_ADVANCED_VIDEO_PROCESSING 属性来获得 GPU 加速的 YUV 到 RGB 的转换。

在早期版本的 Windows 上,您可以将 DXVA2 与 D3D9 一起使用,只需使用 IDirect3DDevice9::StretchRect() 在 YUV 表面和 RGB 表面之间进行复制。如果图形驱动程序支持,这将在复制期间进行转换。您应该调用 ID3D9::CheckDeviceFormatConversion() 来检查驱动程序是否支持您正在执行的颜色转换,然后再依赖它。

于 2013-05-29T23:55:39.443 回答