IWMEncVideoSource2.TVFormat

Windows Media Encoder SDK banner art

The TVFormat property specifies and retrieves a value indicating the TV format used by a TV-tuner capture card.

Syntax

int = IWMEncVideoSource2.TVFormat;
IWMEncVideoSource2.TVFormat = int;

Parameters

This property takes no parameters.

Property Value

An Int32 type that indicates the TV format, which can be one of the following values.

Format type Number
AnalogVideo_None 0x00000000
AnalogVideo_NTSC_M 0x00000001
AnalogVideo_NTSC_M_J 0x00000002
AnalogVideo_NTSC_433 0x00000004
AnalogVideo_PAL_B 0x00000010
AnalogVideo_PAL_D 0x00000020
AnalogVideo_PAL_H 0x00000080
AnalogVideo_PAL_I 0x00000100
AnalogVideo_PAL_M 0x00000200
AnalogVideo_PAL_N 0x00000400
AnalogVideo_PAL_60 0x00000800
AnalogVideo_SECAM_B 0x00001000
AnalogVideo_SECAM_D 0x00002000
AnalogVideo_SECAM_G 0x00004000
AnalogVideo_SECAM_H 0x00008000
AnalogVideo_SECAM_K 0x00010000
AnalogVideo_SECAM_K1 0x00020000
AnalogVideo_SECAM_L 0x00040000
AnalogVideo_SECAM_L1 0x00080000
AnalogVideo_PAL_N_COMBO 0x00100000

Example Code

using WMEncoderLib;

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

// Create a source group and add the sources.
  IWMEncSourceGroupCollection SrcGrpColl;
  IWMEncSourceGroup SrcGrp;
  IWMEncSource SrcAud;
  IWMEncVideoSource2 SrcVid;
  SrcGrpColl = Encoder.SourceGroupCollection;
  SrcGrp = SrcGrpColl.Add("SG_1");
  SrcAud = SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_AUDIO);
  SrcVid = (IWMEncVideoSource2)SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_VIDEO);
  SrcAud.SetInput("Default_Audio_Device", "Device", "");
  SrcVid.SetInput("Default_Video_Device", "Device", "");

// Configure the output and profile for the encoding session.

// Initialize the encoding process.
  Encoder.PrepareToEncode(true);

// Enumerate the type of inputs supported by the TV-tuner capture card.
// Find and select the Video Tuner input.
  IWMEncInputCollection InputColl;
  InputColl = SrcVid.EnumerateInputs();
  for (x = 0;  x < InputColl.Count; x++)
{
    if (InputColl.Item(x) == "Video Tuner")
{
      SrcVid.Input = x;
      break;
    }
  }

// Specify the TV channel, pixel format, and country/region code (USA).
  SrcVid.Channel = 5;
  SrcVid.PixelFormat = WMENC_PIXELFORMAT_VIDEO.WMENC_PIXELFORMAT_UYVY;
  SrcVid.Country = 1;

// Specify cable reception.
  SrcVid.TVType = 0;

// Specify the NTSC TV format.
  SrcVid.TVFormat = 1;

// Start encoding.
  Encoder.Start();
}

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

Requirements

Reference: Windows Media Encoder

Namespace: WMEncoderLib

Assembly: Interop.WMEncoderLib.dll

Library: WMEncoderLib.dll

See Also