WMEncoder.PreserveSourceTimecode

Windows Media Encoder SDK banner art

The PreserveSourceTimecode property specifies and retrieves a Boolean value indicating whether the content's original time code will be used in the output.

Syntax

bool = WMEncoder.PreserveSourceTimecode();
WMEncoder.PreserveSourceTimecode = bool;

Parameters

This property takes no parameters.

Property Value

A Boolean that indicates whether to preserve the original time code.

If this property fails, it returns an error number.

Return code Number Description
NS_E_INVALIDCALL_WHILE_ENCODER_RUNNING 0xC00D1B66L This property cannot be set while the encoder engine is running.

Remarks

Set the EnableTimecode property to true to use time codes in your video content, and then use this property to preserve an existing time code from your source content (set PreserveSourceTimecode to true) or to insert a new time code (set PreserveSourceTimecode to false). If false, a new time code of 01:00:00:00 is used. You can change this starting time code using the StartingTimecode property.

Note   To preserve the time code for a VTR that is connected through a COM port using the Sony RS422 protocol, you must set up an EDL for the session.

Example Code

using WMEncoderLib;

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

// Enable the time code and preserve the existing one in the content.
  Encoder.set_EnableTimecode = true;
  Encoder.PreserveSourceTimecode = true;
}

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

Requirements

Reference: Windows Media Encoder

Namespace: WMEncoderLib

Assembly: Interop.WMEncoderLib.dll

Library: WMEncoderLib.dll

See Also