Windows Media Encoder banner art

Using command-line options

The following options are all of the command-line options that you can append to your command to achieve specific encoding results. If you have specified a profile in addition to any of these options, these options take precedence.

To access quick-reference Help from the command line, type cscript.exe wmcmd.vbs, and then press the ENTER key.

-a_codec codec_index

Specifies the audio codec. If you do not specify a codec, the Windows Media Audio Standard 9 codec is used. Use the -a_codecs option to find out the codecs and codec indexes (for example, WMA9STD) that are installed on the encoding computer.

-a_codecs

Lists the audio codecs, codec indexes, and the encoding modes (CBR and VBR) supported for the codecs that are installed on the encoding computer.

-a_content mode_number

Specifies whether audio content is primarily voice (-a_content 1) or mixed (-a_content 2). By default, -a_content 0, which is neutral, is used. You must specify the Windows Media Audio Voice codec when you use the -a_content option. For example:

cscript.exe wmcmd.vbs –input C:\My-speeches\Myspeech.wav –output C:\My-speeches-coded\Myspeech.wma -a_codec WMSP9 -a_content 1

-a_contentedl file_name

If your audio content is a mix of speech and music, this option enables you to specify the places in the content where music starts and ends. To do this, you must first create an optimization definition file, which is a text file that identifies the places in your file where music starts and ends. The unspecified portions in the file are treated as speech. In the optimization definition file, first type the version number and the number of music segments the file contains. Then type the start and end times (in milliseconds) of each segment and separate each start and end time with a comma. For example, typing 1, 3, 0, 10000, 50000, 80000, 150000, 200000 indicates that there are three music segments; the codec will switch to music mode at 0 to 10 seconds, 50 to 80 seconds, and 150 to 200 seconds. The version number should always be the number 1. Finally, the optimization definition file must use Unicode encoding. If you use Notepad to create the file, you can save the file as Unicode by choosing the Save As command on the File menu, and then, in Encoding, clicking Unicode. You must specify the Windows Media Audio Voice codec and -a_content 2 when you use the -a_contentedl option. For example:

cscript.exe wmcmd.vbs –input C:\My-speeches\Myspeech.wav –output C:\My-speeches-coded\Myspeech.wma -a_codec WMSP9 -a_content 2 -a_contentedl c:\My-speeches\my_contentedl.txt

-adevice audio device number

Specifies the audio device to source from. For example:

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

Use the -devices option to find out the device numbers for the audio and video capture devices on the encoding computer. The option -duration is required when capturing from devices.

-a_folddown6to2 surround channel center channel low frequency channel

Specifies, for multichannel audio encoding, the folddown coefficients for playback on stereo speakers. Use whole numbers only. The values, which must be between 0 and 144 decibels, are converted to negative numbers. For example:

cscript.exe wmcmd.vbs –input C:\My-songs\Song1.wav –output C:\My-songs-coded\Song1.wma -a_codec WMA9PRO -a_mode 2 –a_setting Q90_48_2_24 -a_folddown6to2 3 3 12

-a_formats

Lists the audio formats (bit rate, sampling rate, and channels) supported by each codec.

-a_mode mode_number

Specifies the encoding mode for audio content: one- or two-pass CBR encoding, or VBR encoding (quality-based or bit rate-based). For more information, see Using CBR or VBR encoding.

-a_peakbitrate maximum bit rate

Specifies the maximum bit rate, in bits per second, for peak bit rate VBR encoding for audio content. The default is 1.5 times the audio bit rate. For example:

cscript.exe wmcmd.vbs –input C:\My-music\Mysong.wav –output C:\My-music-coded\Mysong.wma -a_mode 4 -a_setting 80_44_2 -a_peakbitrate 300000 -a_peakbuffer 8000

-a_peakbuffer maximum buffer size

Specifies the time, in milliseconds, that audio content is buffered. This option is used with peak bit rate-based VBR encoding for audio content. The default is 3,000 milliseconds. For example:

cscript.exe wmcmd.vbs –input C:\My-music\Mysong.wav –output C:\My-music-coded\Mysong.wma -a_mode 4 -a_setting 80_44_2 -a_peakbitrate 300000 -a_peakbuffer 8000

-a_setting bitrate_samplerate_channel

Specifies the audio bit rate, sample rate, and channel setting for encoding. Use the -a_formats option to see the settings supported for each codec. Each value is separated by an underscore (_), in the form bitrate_samplerate_channel. The default value is 64_44_2. For example:

cscript.exe wmcmd.vbs –input C:\My-songs\Song1.wav –output C:\My-songs-coded\Song1.wma –a_setting 32_44_2

In the quality-based VBR mode for audio (-a_mode 2), the first number in -a_setting represents the target quality. You must include a "Q" before the quality setting. For example:

cscript.exe wmcmd.vbs –input C:\My-songs\Song1.wav –output C:\My-songs-coded\Song1.wma -a_mode 2 –a_setting Q75_44_2

If you are using the Windows Media Audio Professional 9 codec or the Windows Media Audio 9 lossless format, you can also use -a_setting to specify 16- or 24-bit encoding. The following example illustrates how to set up a command that specifies the lossless format (requires quality-based VBR encoding at a quality setting of 100), a sampling rate of 48 kHz, two channels, and 24-bit encoding:

cscript.exe wmcmd.vbs –input C:\My-songs\Song1.wav –output C:\My-songs-coded\Song1.wma -a_codec WMA9LSL -a_mode 2 –a_setting Q100_48_2_24

-audioonly

When sourcing from a file that contains both audio and video content, specifies to encode the audio portion only.

-author string

Specifies the author of your content; the information is displayed during playback of the content. If there are spaces in the string, enclose it in quotations. The maximum string length is 255 characters. For example:

cscript.exe wmcmd.vbs –input C:\My-songs\Song1.wav –output C:\y-songs-coded\Song1.wma –author "David Johnson"

-broadcast port_number

Specifies the HTTP port used to broadcast. The default is 8080. You must also include the -duration option when you source from devices. For example:

cscript.exe wmcmd.vbs –input C:\My-songs\Song1.wav –broadcast 9090 
cscript.exe wmcmd.vbs -adevice 1 -vdevice 4 –broadcast 9090 –duration 620

-config file_name

Specifies the configuration file to use during the encoding session. Configuration files have a .weu file name extension. Use the -s_config option or a text editor to create a configuration file. For more information, see Using configuration files. For example:

cscript.exe wmcmd.vbs –config C:\My-config-files\Myconfig_file.weu

-copyright string

Specifies the copyright information for your content; the information is displayed during playback of the content. If there are spaces in the string, enclose it in quotations. The maximum string length is 255 characters. For example:

cscript.exe wmcmd.vbs –input C:\My-songs\Song1.wav –output C:\My-songs-coded\Song1.wma –copyright "David Johnson 2001"

-description string

Provides a description of your content; the information is displayed during playback of the content. If there are spaces in the string, enclose it in quotations. The maximum string length is 255 characters. For example:

cscript.exe wmcmd.vbs –input C:\My-songs\Song1.wav –output C:\My-songs-coded\Song1.wma –description "A collection of my favorite music"

-devices

Lists the audio and video devices (and their associated device numbers) on the encoding computer. You can use the device numbers when capturing a live event. (For more information, see the -adevice and -vdevice options.)

-duration time

Specifies the amount of time in seconds to encode. Use this option when you are sourcing from devices. Encoding starts at the beginning of the broadcast and stops when the duration you specified is reached. The actual encoding time will be within a few seconds of the time you specify. For example:

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

-input file_name or folder_name

Specifies the name of the file or folder. For example:

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

Enclose file or folder names that have spaces in quotations. For example, "my sample.avi".

-output file_name or folder

Specifies the name of the output file or folder. If the specified folder does not exist, it will be created. For example:

cscript.exe wmcmd.vbs –input C:\My-songs\Song1.wav –output c:\My-songs-coded\My-songs.wma
cscript.exe wmcmd.vbs –input C:\My-songs –output C:\My-songs-coded

-outputstring string

When encoding files in a folder, this command appends the text entered for the string to the file name of every output file. The string precedes the .wma or .wmv file name extension. For example:

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

-pixelratio x y

Specifies the pixel aspect ratio of the encoded video. Use if your video source has nonsquare pixels and you want to retain the pixel aspect ratio of the source video. For example:

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

-pixelformat format

Specifies the pixel format of the encoded video. For example:

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

For a list of pixel formats, see Supported pixel formats.

-profile profile_number

Specifies the profile for the encoding session. For example:

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

For a list of profiles, see Using profiles.

-rating string

Specifies the rating of the content; this information is displayed during playback of the content. For example:

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

-saveprofile profile_name

Saves the other options specified in a command as a profile for later use. Profiles have a .prx file name extension. For example:

cscript.exe wmcmd.vbs –input C:\My-clips\Myfile.avi -output C:\My-clips-coded\Myfile.wmv –v_clip 4 6 2 8 –v_codec WMV8 -v_bitrate 100000 –v_keydist 20 –v_framerate 24 -saveprofile C:\My-profiles\100kbps.prx

-silent

Prevents encoding statistics from being displayed after the encoding process is complete.

-s_config file_name

Creates a configuration file. For example:

cscript.exe wmcmd.vbs –input C:\My-clips\Myfile.avi –output C:\My-clips-coded\Myfile.wmv –s_config C:\Config-files\Myvideos.weu

You can also use a text editor to create a configuration file. After you have created the configuration file, you can use the -config option to call the file. For more information, see Using configuration files.

-time start time end time

Specifies the times in milliseconds within the input file that encoding should start and stop. (Use the -time option when your source is a file. Use the -duration option when you are capturing a live event from devices.) If you do not know the precise end time, then replace end time with end. For example:

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

-title string

Specifies a title for your content; the information is displayed during playback of the content. If there are spaces in the string, enclose it in quotations. The maximum string length is 255 characters. For example:

cscript.exe wmcmd.vbs –input C:\My-songs\Song1.wav –output C:\My-songs-coded\Song1.wma –title "My Favorite Music"

-videoonly

When sourcing from a file that contains both audio and video content, specifies to encode the video portion only.

-v_bitrate bit rate

Specifies the desired bit rate in bits per second. The default is 250,000. For example:

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

-v_buffer size

Specifies the portion of the video in milliseconds that is stored in memory before it is played. The default value is 3,000 milliseconds. For example:

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

-v_clip left top right bottom

Specifies the region of the image to be clipped from the source video. If the value specified for the right side is 0 or greater than the width, it is ignored and the value is reassigned to the width. If the value specified for the bottom side is 0 or greater than the height, it is ignored and the value is reassigned to the height. For example:

cscript.exe wmcmd.vbs –input C:\My-clips\Myfile.avi –output C:\My-clips-coded\Myfile.wmv –v_clip 4 6 2 8

-v_codec codec_index

Specifies the video codec. If you do not specify a codec, the Windows Media Video 9 codec is used. Use the -v_codecs option to find out the codecs and codec indexes (for example, WMS9) that are installed on the encoding computer.

-v_codecs

Lists the video codecs and codec indexes that are installed on the encoding computer.

-vdevice video device number

Specifies the video device to source from. For example:

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

Use the -devices option to find out the device numbers for the audio and video capture devices on the encoding computer. The option -duration is required when capturing from devices.

-v_framerate rate

Specifies the frame rate at which the video is encoded. The rate can be an integer or a floating-point value. The default is 30 fps. For example:

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

-v_height height

Specifies the height of the frame in pixels that is encoded. The default is the height of the source video. For example:

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

-v_keydist time

Specifies the number of seconds between key frames. The default is 10 seconds.

-v_mode mode_number

Specifies the encoding mode for video content: one- or two-pass CBR encoding, or VBR encoding (quality-based, bit rate-based, or peak bit rate-based). For more information, see Using CBR or VBR encoding.

-v_peakbitrate maximum bit rate

Specifies the maximum bit rate, in bits per second, for peak bit rate VBR encoding for video content. The default is 1.5 times the video bit rate. For example:

cscript.exe wmcmd.vbs –input C:\My-clips\Myfile.avi –output C:\My-clips-coded\Myfile.wmv -v_mode 4 -v_bitrate 100000 -v_peakbitrate 300000 -v_peakbuffer 8000

-v_peakbuffer maximum buffer size

Specifies the time, in milliseconds, that video content will be buffered for peak bit rate-based VBR encoding. The default is 3,000 milliseconds. For example:

cscript.exe wmcmd.vbs –input C:\My-clips\Myfile.avi –output C:\My-clips-coded\Myfile.wmv -v_mode 4 -v_bitrate 100000 -v_peakbitrate 300000 -v_peakbuffer 8000

-v_performance number

Specifies the performance setting for the encoding computer. By default, the values specified in Windows Media Encoder are used. (To access these values, launch the encoder, and  on the Tools menu, click Options, and then click the Performance tab.) The possible values are 0, 20, 40, 60, 80, and 100, with 100 representing the highest quality.

-v_preproc filter_number

Specifies the preprocessing filter to apply to your content. For a list of the possible values, see Applying preprocessing filters.

-v_quality quality_number

Defines the image quality of the encoded video. Image quality ranges from 0 to 100. In the CBR video modes (-v_mode 0 or –v_mode 1), 0 represents the smoothest motion and 100 represents the crispest images. The default is 75. For example:

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

In the quality-based VBR mode for video (-v_mode 2), this value represents the target image quality for the entire sequence. The default is 85. For example:

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

-v_width width

Specifies the width of the frame in pixels that is encoded. The default is the width of the source video. For example:

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

-wme file name

Specifies an existing encoding session file. For example:

cscript.exe wmcmd.vbs –wme C:\My-sessions\My_session_file.wme

Related topics


© 2000-2002 Microsoft Corporation. All rights reserved.