Share via


IWMEncStatistics.get_StreamOutputCount

Windows Media Encoder SDK banner art

The get_StreamOutputCount method retrieves the number of streams with multiple audiences (bit rates) generated from a specific input stream.

Syntax

short IWMEncStatistics.get_StreamOutputCount(
  WMENC_SOURCE_TYPE  enumType, 
  short  iMediaIndex
);

Parameters

enumType

[in]  Specifies a member of a WMENC_SOURCE_TYPE enumeration type indicating the type of stream. 

iMediaIndex

[in]  Int16 containing the source group index number for a specific input media stream of the type identified by enumType. Because Windows Media Encoder supports only one audio, one video and one text stream per source group, iMediaIndex must be 0. The index is zero-based.

Return Values

An Int16 that indicates the number of streams containing multiple bit rates generated from a specific input stream.

Remarks

This property is read-only. If you specify a source type that does not exist in the source group, the get_StreamOutputCount method returns an error code. It does not return 0.

Example Code

using WMEncoderLib;

try
{
// Create a WMEncoder object.
WMEncoder Encoder;
Encoder = new WMEncoder();

// Retrieve an IWMEncStatistics object.
IWMEncStatistics Stats;
Stats = Encoder.Statistics;

// Configure the encoding session.

// Retrieve the number of output streams with multiple bit rates.
int iStreamCount;
iStreamCount = Stats.get_StreamOutputCount(WMENC_SOURCE_TYPE.WMENC_VIDEO,0);

// Retrieve an IWMEncOutputStats object from the
// IWMEncStatistics object.
IWMEncOutputStats OutputStats;
OutputStats = (IWMEncOutputStats)Stats.get_StreamOutputStats(WMENC_SOURCE_TYPE.WMENC_VIDEO, 0, 0);

// You can create a timer control to retrieve the statistics
// (as follows) after you start the encoding session.
int lAvgBitrate;
int lAvgSampleRate;
decimal lByteCount;
int lCurrentBitRate;
int lCurrentSampleRate;
decimal lDroppedByteCount;
decimal lDroppedSampleCount;
int lExpectedBitRate;
int lExpectedSampleRate;
decimal lSampleCount;

lAvgBitrate = OutputStats.AverageBitrate;
lAvgSampleRate = OutputStats.AverageSampleRate;
lByteCount = OutputStats.ByteCount;
lCurrentBitRate = OutputStats.CurrentBitrate;
lCurrentSampleRate = OutputStats.CurrentSampleRate;
lDroppedByteCount = OutputStats.DroppedByteCount;
lDroppedSampleCount = OutputStats.DroppedSampleCount;
lExpectedBitRate = OutputStats.ExpectedBitrate;
lExpectedSampleRate = OutputStats.ExpectedSampleRate;
lSampleCount = OutputStats.SampleCount;
}

catch (Exception e)
{
     // TODO: Handle exceptions.
}

Requirements

Reference: Windows Media Encoder

Namespace: WMEncoderLib

Assembly: Interop.WMEncoderLib.dll

Library: WMEncoderLib.dll

See Also