IWMEncDeviceControlPlugin.StartupLatency
![]() |
The StartupLatency property specifies and retrieves the number of frames to play before encoding.
Syntax
IWMEncDeviceControlPlugin.StartupLatency = Long
Long = IWMEncDeviceControlPlugin.StartupLatency
Parameters
This property takes no parameters.
Property Value
A Long that indicates the startup latency value in frames.
Remarks
The StartupLatency property is used to offset the delay between issuing the command to start encoding and when encoding actually begins. You will have to experiment with your system to determine its latency in frames. After you determine the length of that delay in frames, you can start the encoder early, relative to your mark-in point, by that number of frames.
To control digital devices programmatically, you must add the Windows Media Encoder Device Control reference to the project. For more information, see Programming in Visual Basic.
Example Code
' Create a WMEncoder object.
Dim Encoder As WMEncoder
Set Encoder = New WMEncoder
' Add the device as the audio source and the video source.
Dim SrcGrpColl As IWMEncSourceGroupCollection
Dim SrcGrp As IWMEncSourceGroup2
Dim SrcAud As IWMEncSource
Dim SrcVid As IWMEncVideoSource
Set SrcGrpColl = Encoder.SourceGroupCollection
Set SrcGrp = SrcGrpColl.Add("SG_1")
Set SrcAud = SrcGrp.AddSource(WMENC_AUDIO)
Set SrcVid = SrcGrp.AddSource(WMENC_VIDEO)
' Replace the following name with the name of your device.
SrcAud.SetInput ("Device://Device resource name")
SrcVid.SetInput ("Device://Device resource name")
' Configure the output and profile.
' Retrieve the device control collection, then add a device to it.
Dim DCColl As IWMEncDeviceControlCollection
Set DCColl = SrcGrp.DeviceControlCollection
Dim DControl As IWMEncDeviceControl
Set DControl = DCColl.Add
' Replace the following name with the name of your device.
DControl.SetInput ("DeviceControl://Device resource name")
' Initialize the encoding session.
Encoder.PrepareToEncode True
' Get the plug-in from the device.
Dim DCPlugin As IWMEncDeviceControlPlugin
Set DCPlugin = DControl.GetDeviceControlPlugin
' Specify latency settings.
DCPlugin.StartupLatency = 2
DCPlugin.StopLatency = 3
Requirements
Reference: Windows Media Encoder Device Control
Library: wmdevctl.dll
See Also
.gif)