Share via


IWMEncSource.Repeat

Windows Media Encoder SDK banner art

The Repeat property sets and retrieves the repeat property of a stream.

Syntax

bool = IWMEncSource.Repeat;
IWMEncSource.Repeat = bool;

Parameters

This property takes no parameters.

Property Value

A Boolean that indicates whether the stream is repeated.

If this property fails, it returns an error number.

Number Description
0xC00D0011 This property cannot be set if the encoder engine is running.

Remarks

Set this property to true to repeatedly capture input from the same source.

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