FormatVideoGetByIndex Method (IMFormat)
type of the format
index of the format
properties of video format (bitrate, 3D format, type of interlacing, type of scaling, aspet ratio etc.)
full name of format (for example, "3D-HSbS HD720-50p HDYC 1280x720 @ 50.00p 16:9")
Gets the video format by its index.
Syntax
Sub FormatVideoGetByIndex( _
   ByVal _eFormatType As eMFormatType, _
   ByVal _nIndex As Integer, _
   ByRef _pVidProps As M_VID_PROPS, _
   ByRef _pbsName As String _
) 
void FormatVideoGetByIndex( 
   eMFormatType _eFormatType,
   int _nIndex,
   out M_VID_PROPS _pVidProps,
   out string _pbsName
)
procedure FormatVideoGetByIndex( 
    _eFormatType: eMFormatType;
    _nIndex: Integer;
   Out  _pVidProps: M_VID_PROPS;
   Out  _pbsName: String
); 
void FormatVideoGetByIndex( 
   eMFormatType _eFormatType,
   int _nIndex,
   [PARAMFLAG::Out] M_VID_PROPS _pVidProps,
   [PARAMFLAG::Out] BSTR* _pbsName
) 

Parameters

_eFormatType
type of the format
_nIndex
index of the format
_pVidProps
properties of video format (bitrate, 3D format, type of interlacing, type of scaling, aspet ratio etc.)
_pbsName
full name of format (for example, "3D-HSbS HD720-50p HDYC 1280x720 @ 50.00p 16:9")
Example

Here is example of how to set standard format to the playlist:

Dim myPlaylist As New MPlaylistClass()
Dim vidProps As New M_VID_PROPS()
Dim strFormat As String
Dim nCount As Integer
myPlaylist.FormatVideoGetCount(nCount)
myPlaylist.FormatVideoGetByIndex(eMFormatType.eMFT_Convert, nCount - 1, vidProps, strFormat)
myPlaylist.FormatVideoSet(eMFormatType.eMFT_Convert, vidProps)
MPlaylistClass myPlaylist = new MPlaylistClass();
M_VID_PROPS vidProps = new M_VID_PROPS();
string strFormat;
int nCount;
myPlaylist.FormatVideoGetCount(out nCount);
myPlaylist.FormatVideoGetByIndex(eMFormatType.eMFT_Convert, nCount - 1, out vidProps, out strFormat);
myPlaylist.FormatVideoSet(eMFormatType.eMFT_Convert, ref vidProps);
var
myPlaylist: MPlaylist;
myFormat: IMFormat;
nCount: integer;
vidProps: M_VID_PROPS;
strFormat: string;
begin
myPlaylist:= CreateComObject(CLASS_MPlaylist) as MPlaylist;
myFormat := myPlaylist as IMFormat;
myFormat.FormatVideoGetCount(nCount);
myFormat.FormatVideoGetByIndex(eMFT_Convert, nCount-2, vidProps, strFormat);
myFormat.FormatVideoSet(eMFT_Convert, vidProps);
end;
See Also

Reference

IMFormat Interface
IMFormat Members