IWMEncStatistics.WMFOutputStats
![]() |
The WMFOutputStats property retrieves status information for the encoded output.
Syntax
object = IWMEncStatistics.WMFOutputStats;
Parameters
This property takes no parameters.
Property Value
An IWMEncOutputStats object containing encoding and broadcasting statistics for the encoded output.
Remarks
This property is read-only. The IWMEncOutputStats interface contains information about the number of media samples received and dropped; the current, average and expected bit rate of the broadcast; and the current, average and expected rates at which media samples are encoded.
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 an IWMEncOutputStats object from the
// IWMEncStatistics object.
IWMEncOutputStats OutputStats;
OutputStats =(IWMEncOutputStats)Stats.WMFOutputStats;
// You can create a timer control to retrieve the statistics
// (as follows) after you start encoding.
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
.gif)