Share via


IWMEncProfileCollection.Count

Windows Media Encoder SDK banner art

The Count property retrieves the number of profiles in the collection.

Syntax

Long = IWMEncProfileCollection.Count

Parameters

This property takes no parameters.

Property Value

A Long containing the number of profiles in the collection.

Remarks

This property is read-only. This method is the Visual Basic version of the JScript IWMEncProfileCollection.length method.

Example Code

' Create a WMEncoder object.
Dim Encoder As WMEncoder
Set Encoder = New WMEncoder

' Declare objects and variables.
Dim SrcGrpColl As IWMEncSourceGroupCollection
Dim SrcGrp As IWMEncSourceGroup
Dim SrcAud As IWMEncSource
Dim SrcVid As IWMEncVideoSource
Dim ProColl As IWMEncProfileCollection
Dim Pro As IWMEncProfile
Dim i As Integer

' Create an IWMEncSourceGroupCollection object.
Set SrcGrpColl = Encoder.SourceGroupCollection

' Create an IWMEncSourceGroup object.
Set SrcGrp = SrcGrpColl.Add("SG_1")

' Create an audio and a video source object.
Set SrcAud = SrcGrp.AddSource(WMENC_AUDIO)
Set SrcVid = SrcGrp.AddSource(WMENC_VIDEO)

' Specify the .avi source file.
SrcAud.SetInput "C:\filename.avi"
SrcVid.SetInput "C:\filename.avi"

' Loop through the collection of system profiles to set
' a specific profile into the source group object.
Dim sProDesc As String
Dim lMaxPacketSz As Long
Dim iMediaCount As Integer
Dim bMultiBitRate As Boolean

Set ProColl = Encoder.ProfileCollection
For i = 0 To ProColl.Count - 1
    Set Pro = ProColl.Item(i)
    If Pro.Name = "Windows Media Video 8 for Local Area Network (384 Kbps)" Then 
        SrcGrp.Profile = Pro
        sProDesc = Pro.Description
        lMaxPacketSz = Pro.MaxPacketSize
        iMediaCount = Pro.MediaCount(WMENC_VIDEO)
        bMultiBitRate = Pro.MultipleBitrate

        Exit For
    End If
Next

Requirements

Reference: Windows Media Encoder

Library: wmenc.exe

See Also