Windows Media Services SDK banner art
PreviousNext

About the Batch Encode Utility Sample

The Batch Encode Utility is a program created by using Visual Basic. The utility uses Automation to control Windows Media Encoder. The utility creates an instance of Windows Media Encoder, then uses its properties and methods to load .asd files, set source file names, and start and stop encoding. In addition to controlling the Windows Media Encoder object, the utility processes lists of file names, and performs a number of file-handling operations.

When a batch process is run, one .asf file is encoded from each source file using each .asd file. If there are, for example, 10 source files and three .asd files, 30 .asf files are encoded. Finished .asf files are created in the destination directory that you define.

Normally a batch process runs unattended. For this reason, a feature was added to the utility that logs errors while a batch is running. If errors occur, such as a source file cannot be found or an .asd file does not load correctly, they are displayed in the Batch status box, and entered in a log file, which can be opened with any text editor.

To encode files, the Windows Media Encoder Automation object must be configured using the instructions and settings contained in an .asd file. An .asd file contains such information as bandwidth and compression type. The utility uses the LoadASD method to pass .asd file names to the Windows Media Encoder Automation object.

To change or create a new instruction or setting, you must change or create a new .asd file using Windows Media Encoder; an .asd file cannot be created using Automation. When creating an .asd file, use the Configuration wizard in Windows Media Encoder: select the Custom settings option, select AVI/WAV/MP3 file as the input source, and select To a local ASF file as the output option. To save the settings as an .asd file, on the File menu, click Save.

For more information about configuring Windows Media Encoder and creating .asd files, see Windows Media Encoder Help.

Expanding on this Sample

The following examples show how you can extend the capabilities of the Batch Encode Utility Sample by modifying the Visual Basic source code included in this SDK.

See Also

Using the Batch Encode Utility Sample, Windows Media Technologies Solutions Samples

PreviousNext


© 1996-1999 Microsoft Corporation. All rights reserved.