Share via


IWMEncSource.MarkIn

Windows Media Encoder SDK banner art

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

Syntax

int = IWMEncSource.MarkIn;
IWMEncSource.MarkIn = int;

Parameters

This property takes no parameters.

Property Value

An Int32 type that indicates the starting point of the stream.

If this property fails, it returns an error number.

Number Description
0xC00D1B58 The specified starting point is less than 0 or greater than the end 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

using WMEncoderLib;

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

// Declare objects and variables.
IWMEncSourceGroupCollection SrcGrpColl;
IWMEncSourceGroup SrcGrp;
IWMEncSource SrcAud;
IWMEncVideoSource SrcVid;
IWMEncProfileCollection ProColl;
IWMEncProfile Pro;
int i;

// Create an IWMEncSourceGroupCollection object.
SrcGrpColl = Encoder.SourceGroupCollection;

// Create an IWMEncSourceGroup object.
SrcGrp = SrcGrpColl.Add("SG_1");

// Create an audio and a video source object.
SrcAud = SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_AUDIO);
SrcVid = (IWMEncVideoSource)SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_VIDEO);

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

ProColl = Encoder.ProfileCollection;
for (i = 0; i < ProColl.Count; i++)
{
    Pro = ProColl.Item(i);
    if (Pro.Name == "Windows Media Video 8 for Local Area Network (384 Kbps)")
    {
        SrcGrp.set_Profile(Pro);
        break;
    }
}

// Specify audio and video sources.

SrcVid.SetInput("C:\\InputFile.mpg", "", "");
SrcAud.SetInput("C:\\InputFile.mpg", "", "");

// 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);
}

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

Requirements

Reference: Windows Media Encoder

Namespace: WMEncoderLib

Assembly: Interop.WMEncoderLib.dll

Library: WMEncoderLib.dll

See Also