WMEncStreamEdit.Start

Windows Media Encoder SDK banner art

The Start method starts the stream edit process to modify streams you added.

Syntax

void WMEncStreamEdit.Start();

Parameters

This method takes no parameters.

Return Values

If this method fails, it returns an error number.

Return code Number Description
NS_E_INVALID_REQUEST 0xC00D002BL This method cannot be called while the encoding process is running.

Example Code

using WMEncoderLib;

try
{
// Create a WMEncStreamEdit object.
  WMEncStreamEdit Stream;
  Stream = new WMEncStreamEdit();

// This example assumes you have a source file with two audiences.
// Create a new file using the audio from the first audience and the
// video from the second audience, as follows:

// Add the audio stream from the first audience.
  Stream.AddStream("C:\\Source.wmv", WMENC_SOURCE_TYPE.WMENC_AUDIO, 0, 0, 1033, 0, 0);

// Add the video stream from the second audience.
  Stream.AddStream("C:\\Source.wmv", WMENC_SOURCE_TYPE.WMENC_VIDEO, 1, 0, 1033, 0, 0);

// Specify the output file.
  Stream.OutputFile = "C:\\Output.wmv";

// Validate the current settings.
  Stream.Validate();

// Start the stream edit process.
  Stream.Start();

// Retrieve the run state.
  WMENC_BASICEDIT_STATE SERunState;
  SERunState = Stream.RunState;

// You can use a timer to retrieve the percentage complete.
  int lPercentComplete;
  lPercentComplete = Stream.ProgressPercent;
}

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

Requirements

Reference: Windows Media Encoder

Namespace: WMEncoderLib

Assembly: Interop.WMEncoderLib.dll

Library: WMEncoderLib.dll

See Also