SourceFrameConvertedGetByNumber Method (IMFSource)
required format's properties for a frame
number of a frame. It is possible to use negative values. For example, "-1" returns you a next frame and "-5" returns you the next 5th frame
maximal wait time in milliseconds. By default use "-1".
converted frame object
additional parameters
Gets a converted to required format frame by its number. For live sources number is ignored.
Syntax
Sub SourceFrameConvertedGetByNumber( _
   ByRef _pAVPropsOut As M_AV_PROPS, _
   ByVal _nFrameNo As Integer, _
   ByVal _rtMaxWait As Long, _
   ByRef _ppFrame As MFFrame, _
   ByVal _bsHints As String _
) 
void SourceFrameConvertedGetByNumber( 
   ref M_AV_PROPS _pAVPropsOut,
   int _nFrameNo,
   long _rtMaxWait,
   out MFFrame _ppFrame,
   string _bsHints
)
procedure SourceFrameConvertedGetByNumber( 
   var  _pAVPropsOut: M_AV_PROPS;
    _nFrameNo: Integer;
    _rtMaxWait: Int64;
   Out  _ppFrame: MFFrame;
    _bsHints: String
); 
void SourceFrameConvertedGetByNumber( 
   ref M_AV_PROPS _pAVPropsOut,
   int _nFrameNo,
   long _rtMaxWait,
   [PARAMFLAG::Out] MFFrame* _ppFrame,
   BSTR* _bsHints
) 

Parameters

_pAVPropsOut
required format's properties for a frame
_nFrameNo
number of a frame. It is possible to use negative values. For example, "-1" returns you a next frame and "-5" returns you the next 5th frame
_rtMaxWait
maximal wait time in milliseconds. By default use "-1".
_ppFrame
converted frame object
_bsHints
additional parameters
Example

Here is an example of how to get a frame from a file:

m_objPreview = new MFPreviewClass();
//Configure preview
m_objPreview.PreviewWindowSet("", panelPreview.Handle.ToInt32());
m_objPreview.PreviewEnable("", 1, 1);
m_objMFReader = new MFReaderClass();
m_objMFReader.ReaderOpen(sourceFileName, "");
m_avProps = new M_AV_PROPS(); // set video format for conversion
m_avProps.vidProps.eVideoFormat = eMVideoFormat.eMVF_HD1080_5994i;
MFFrame pFrame = null;
// Get next frame
if (m_objMFReader != null)
    m_objMFReader.SourceFrameConvertedGetByNumber(ref m_avProps, -1, -1, out pFrame, "");
m_objPreview.ReceiverFramePut(pFrame, -1, ""); // show the frame on preview
See Also

Reference

IMFSource Interface
IMFSource Members