Medialooks Knowledge Base Support Center

Contact Us

Convert video format on device output

MRenderer object supports IMFormat interface so you can convert a source video to any desired resolution. You should use the FormatVideoSet method.

Specify M_VID_PROPS structure with desired fields:

M_VID_PROPS vidProps = new M_VID_PROPS();
vidProps.eVideoFormat = eMVideoFormat.eMVF_NTSC;

For common video formats, it is enough to specify eVideoFormat field only. For some specific resolutions, you should specify all the fields with eVideoFormat = eMVF_Custom.

Note please that custom formats could be unsupported by your output devices.

M_VID_PROPS vidProps = new M_VID_PROPS();
vidProps.eVideoFormat = eMVideoFormat.eMVF_Custom,
vidProps.dblRate = 29.97,
vidProps.nWidth = 1280,
vidProps.nHeight = 720,
vidProps.nAspectX = 16,
vidProps.nAspectY = 9,
vidProps.fccType = eMFCC.eMFCC_HDYC

Set the video format:

pRenderer.FormatVideoSet(eMFormatType.eMFT_Convert, ref vidProps);

What about MFormats SDK?

MFormats SDK is based on frame processing so you can convert your MFFrame object to the desired format with MFConvert method before sending it to an MFRenderer object.