Windows Media Encoder banner art

Encoding files and live events

Using Windows Media Encoding Script, you can take files with .wma, .wmv, .asf, .avi, .wav, .mpg, .mp3, .bmp, and .jpg file name extensions and compress them into Windows Media Format. You can convert a single file, all files within a folder or subfolders, or use a batch file to convert files you specify. You can also use Windows Media Encoding Script to capture a live event from devices. You can choose to either output to a file or broadcast the content.

Windows Media Encoding Script is installed in the same folder as Windows Media Encoder. By default, the folder is located in Program Files\Windows Media Components\Encoder.

The following examples show how you can complete various tasks by using basic command-line syntax:

To source from a file and encode to a file:

cscript.exe wmcmd.vbs –input C:\My-clips\Myfile.avi –output C:\My-clips-coded\Myfile.wmv

You can also specify a UNC path.

To encode all files within a folder:

cscript.exe wmcmd.vbs –input C:\My-clips –output C:\My-clips-coded

To source from devices and encode to a file:

cscript.exe wmcmd.vbs –adevice 1 -vdevice 2 –output C:\My-clips-coded\Myfile.wmv -duration 620

To broadcast a live event:

cscript.exe wmcmd.vbs –adevice 1 -vdevice 2 –broadcast 8080 -duration 480

Additional command-line options can be appended to the end of the basic command. For example, you can specify either CBR or VBR encoding, apply a deinterlacing filter to source video, specify a profile to use, and so on. You can add command-line options to a command in any order.

Related topics


© 2000-2002 Microsoft Corporation. All rights reserved.