IWMEncStatistics.FileArchiveStats

Windows Media Encoder SDK banner art

The FileArchiveStats property retrieves an IWMEncFileArchiveStats object to determine the size of the archive file and the duration of the encoded content stored in the file.

Syntax

object = IWMEncStatistics.FileArchiveStats;

Parameters

This property takes no parameters.

Property Value

An IWMEncFileArchiveStats object.

If this property fails, it returns an error number.

Number Description
0xC00D1B7D No statistics are currently available.
0xC00D1B7E The encoder engine is not currently archiving.

Remarks

This property is read-only. File size and duration information does not persist after the encoding process has stopped. You can create a timer object to retrieve the archiving statistics.

Example Code

using WMEncoderLib;

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

// Configure the encoding session including the sources, output,
// and profile, then start encoding.

// You can create a timer control to retrieve the statistics
// (as follows) after you start the encoding session.

// Declare objects and variables.
  IWMEncStatistics Stats;
  IWMEncFileArchiveStats FileStats;
  decimal lDuration;
  decimal lSize;

// Retrieve an IWMEncStatistics object and retrieve
// the IWMEncFileArchiveStats object from it.
  Stats = Encoder.Statistics;
  FileStats =(IWMEncFileArchiveStats)Stats.FileArchiveStats; 

// Find the duration (in seconds) and size (in KB) of the archive file.
  lDuration = FileStats.FileDuration * 10;
  lSize = FileStats.FileSize * 10;
}

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

Requirements

Reference: Windows Media Encoder

Namespace: WMEncoderLib

Assembly: Interop.WMEncoderLib.dll

Library: WMEncoderLib.dll

See Also