IWMEncSource.MarkOut

Windows Media Encoder SDK banner art

The MarkOut property sets and retrieves the end point of a media stream, in milliseconds (ms), from the start of the original stream.

Syntax

IWMEncSource.MarkOut = Long
Long = IWMEncSource.MarkOut

Parameters

This property takes no parameters.

Property Value

A Long that indicates the end point of the stream.

If this property fails, it returns an error number.

Number Description
0xC00D1B59 The specified ending point is either less than 0 or less than the starting point.
0xC00D0011 This property cannot be set if the encoder engine is running.
0xC00D002B You must index the Windows Media file before setting this property.

Example Code

' Create a WMEncoder object.
Dim Encoder As WMEncoder
Set Encoder = New WMEncoder

' Declare objects and variables.
Dim SrcGrpColl As IWMEncSourceGroupCollection
Dim SrcGrp As IWMEncSourceGroup
Dim SrcAud As IWMEncSource
Dim SrcVid As IWMEncVideoSource
Dim ProColl As IWMEncProfileCollection
Dim Pro As IWMEncProfile
Dim i As Integer

' Create an IWMEncSourceGroupCollection object.
Set SrcGrpColl = Encoder.SourceGroupCollection

' Create an IWMEncSourceGroup object.
Set SrcGrp = SrcGrpColl.Add("SG_1")

' Create an audio and a video source object.
Set SrcAud = SrcGrp.AddSource(WMENC_AUDIO)
Set SrcVid = SrcGrp.AddSource(WMENC_VIDEO)

' Loop through the collection of system profiles to set
' a specific profile into the source group object.

Set ProColl = Encoder.ProfileCollection
For i = 0 To ProColl.Count - 1
    Set Pro = ProColl.Item(i)
    If Pro.Name = "Windows Media Video 8 for Local Area Network (384 Kbps)") Then
        SrcGrp.Profile = Pro
        Exit For
    End If
Next

' Specify live stream capture from the installed video
' and audio cards.

SrcVid.SetInput "DEVICE://Default_Video_Device"
SrcAud.SetInput("Device://Default_Audio_Device")

' Verify that the repeat property is turned off. This is
' the default.

SrcVid.Repeat = False
SrcAud.Repeat = False

' Start the encoding process 10 seconds after the source
' has started, and stop the encoding process 25 seconds
' after the source has started.

SrcVid.MarkIn = 10000
SrcAud.MarkIn = 10000
SrcVid.MarkOut = 25000
SrcAud.MarkOut = 25000

' Start the encoding process.
SrcGrp.PrepareToEncode (True)

Requirements

Reference: Windows Media Encoder

Library: wmenc.exe

See Also