IWMEncVideoSource2.Country
![]() |
The Country property specifies and retrieves the country/region code for television.
Syntax
int = IWMEncVideoSource2.Country;
IWMEncVideoSource2.Country = int;
Parameters
This property takes no parameters.
Property Value
An Int32 type that indicates the country/region code.
Remarks
When your input video source is a TV-tuner capture card, specify the capture card settings after you initialize the encoding process using the WMEncoder.PrepareToEncode method.
For a list of country/region codes, see the Tables and Assignments page in the MSDN Library on the Microsoft Web site, and search for the section Country/Region Assignments.
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
.gif)