IWMEncDeviceControlPlugin.FrameRate

Windows Media Encoder SDK banner art

The FrameRate property specifies and retrieves the frame rate for the current device control.

Syntax

Int = IWMEncDeviceControlPlugin.FrameRate;
IWMEncDeviceControlPlugin.FrameRate = Int;

Property Value

An Int32 that indicates the frame rate, in frames per second.

Remarks

To control digital devices programmatically, you must add the Windows Media Encoder Device Control reference to the project. For more information, see Programming in C#.

Example Code

using WMEncoderLib;
using WMDEVICECONTROLLib;

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

// Add the device as the audio source and the video source.
IWMEncSourceGroupCollection SrcGrpColl = Encoder.SourceGroupCollection;
IWMEncSourceGroup2 SrcGrp = (IWMEncSourceGroup2)SrcGrpColl.Add("SG_1");
IWMEncSource SrcAud = SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_AUDIO);
IWMEncVideoSource SrcVid = (IWMEncVideoSource)SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_VIDEO);
SrcAud.SetInput("Device resource name", "Device", "");
SrcVid.SetInput("Device resource name", "Device", "");

// Configure the output and profile. 

// Retrieve the device control collection, then add a device to it.
IWMEncDeviceControlCollection DCColl = SrcGrp.DeviceControlCollection;
IWMEncDeviceControl DControl = DCColl.Add();
// Replace the following name with the name of your device.
DControl.SetInput("Device resource name", "DeviceControl", "");

// Initialize the encoding session.
Encoder.PrepareToEncode(true);

// Get the plug-in from the device.
IWMEncDeviceControlPlugin DCPlugin;
DCPlugin = (IWMEncDeviceControlPlugin)DControl.GetDeviceControlPlugin();

// Retrieve the frame rate currently being used. 
int lFrameRate = DCPlugin.FrameRate;
}

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

Requirements

Reference: Windows Media Encoder Device Control

Namespace: WMDeviceControlLib

Assembly: Interop.WMDeviceControlLib.dll

Library: WMDeviceControlLib.dll

See Also