IWMEncFile.LocalFileName
The LocalFileName property specifies and retrieves the full path of the file used for archiving encoded content.
Syntax
string = IWMEncFile.LocalFileName;
IWMEncFile.LocalFileName = string;
Parameters
This property takes no parameters.
Property Value
A String containing the name of the archive file. If this property fails, it returns an error number.
Number | Description |
0xC00D0011 | This property cannot be set if the encoder engine is running. |
Remarks
The file for saving content must be on the computer that is running the encoding application or on the local network to which that computer is connected.
By default, the archiving process automatically begins when you start the encoding process. If you want to manually control the archiving process, set the WMEncoder.EnableAutoArchive property to false, and use the WMEncoder.Archive method to manually start and stop archiving.
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;
IWMEncFile File;
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);
// Create an IWMEncFile object.
File = Encoder.File;
// Specify an .avi source file. REPLACE WITH A VALID FILE NAME.
SrcAud.SetInput("C:\\test.avi", "", "");
SrcVid.SetInput("C:\\test.avi", "", "");
// Specify the output Windows Media file.
File.LocalFileName = "C:\\test.wmv";
// Set a specific profile into the source group object.
ProColl = Encoder.ProfileCollection;
SrcGrp.set_Profile(ProColl.Item(2));
// Start archiving when the encoding process starts.
Encoder.EnableAutoArchive = true;
// Initialize the encoding process.
Encoder.PrepareToEncode(true);
// 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