Windows Media Encoding Script

Microsoft® Windows Media™ Encoding Script is a command-line tool you can use to convert both live and prerecorded audio and video into Windows Media files or streams. Using Windows Media Encoding Script, you can:

  • Convert files with .wma, .wmv, .asf, .avi, .wav, .mpg, .mp3, .bmp, .jpg, and .vob file name extensions.
  • Capture a live event from devices.
  • Broadcast the encoded files or live event.
  • Customize the encoding session, including specifying a profile, encoding specific portions of a file, and clipping and resizing the source video.

This documentation explains how to use Windows Media Encoding Script. It is organized as follows:

  • Encoding files and live events. Explains how to perform basic encoding tasks by using some of the more common command-line options.
  • Using profiles. Explains how profiles are used and lists all of the profiles available in Windows Media Encoding Script.
  • Advanced encoding techniques. Explains some of the encoding filters that are available to improve the quality of your video. This section also lists all of the command-line options that are available in Windows Media Encoding Script.
  • Frequently asked questions. Provides answers to common questions about Windows Media Encoding Script.
  • Glossary. Defines terms that are related to Windows Media Encoding Script.
© 2000-2002 Microsoft Corporation. All rights reserved.


Encoding files and live events

Using Windows Media Encoding Script, you can take files with .wma, .wmv, .asf, .avi, .wav, .mpg, .mp3, .bmp, .jpg, and .vob 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. These options enable you to specify profiles, set start and end times, designate configuration files, set the buffer size and image quality settings, and so on.

Related topics

  • Windows Media Encoding Script
  • Using command-line options
  • To open a command prompt window
  • To encode a file
  • To encode all files within a folder
  • To capture a live event
  • Batch encoding


To open a command prompt window

  1. Click Start.
  2. Point to Programs.
  3. Point to Accessories, and then click Command Prompt.

Related topics

  • Encoding files and live events


To encode a file

  1. Open a command prompt window.
  2. At the command prompt, type the path to the folder where the file Wmcmd.vbs is located. For example:

    cd \program files\windows media components\encoder

  3. Type the following command, and then press the ENTER key:
    cscript.exe wmcmd.vbs –input drive:\Path\Input_file_name -output drive:\Path\Output_file_name

    - or -

    cscript.exe wmcmd.vbs –input drive:\Path\Input_file_name -broadcast port_number

    For example:

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

    - or -

    cscript.exe wmcmd.vbs –input C:\My-clips\Myfile.avi -broadcast 9090

    Note image Notes

    • If you do not specify a file name extension for the output file, an extension is automatically appended to the file name.
    • Enclose file names that have spaces in quotations. For example, "my sample.avi".

Related topics

  • Encoding files and live events
  • To encode all files within a folder
  • To capture a live event


To encode all files within a folder

  1. Open a command prompt window.
  2. At the command prompt, type the path to the folder where the file Wmcmd.vbs is located. For example:
    cd \program files\windows media components\encoder
  3. Type the following command, and then press the ENTER key:
    cscript.exe wmcmd.vbs –input drive:\Input_folder -output drive:\Output_folder

    For example:

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

    Note image Notes

    • If the output folder does not already exist, it is created for you.
    • Enclose folders that have spaces in quotations. For example, "my folder."

Related topics

  • Encoding files and live events
  • To encode a file
  • To capture a live event


To capture a live event

  1. Open a command prompt window.
  2. At the command prompt, type the path to the folder where the file Wmcmd.vbs is located. For example:
    cd \program files\windows media components\encoder
  3. Type the following command, and then press the ENTER key:
    cscript.exe wmcmd.vbs -adevice audio_capture_device_number -vdevice video_capture_device_number -output drive:\Path\Output_file_name -duration time

    - or -

    cscript.exe wmcmd.vbs -adevice audio_capture_device_number -vdevice video_capture_device_number -broadcast port_number -duration time

    For example:

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

    - or -

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

    Note image Note

    • You can use the -devices option to find out the device numbers for the audio and video capture devices on the encoding computer.

Related topics

  • Encoding files and live events
  • To encode a file
  • To encode all files within a folder


Batch encoding

By using batch encoding, you can encode numerous files in quick succession instead of having to issue a separate encoding command for each file. For batch encoding, you create a batch file or a text file with a .bat extension, which includes all of the encoding commands that you want to use. These commands might include the names of your input and output files, profiles you want to use, and other command-line options you want to apply. There is no limit to the number of commands that you can include in a batch file, and because it is a basic text file, editing is easy.

When you are ready to run the batch file, navigate to the folder where Windows Media Encoding Script is installed, and then type the name of the batch file. For example, Mybatch.bat.

The commands in the following example are some of the commands that you might find in a batch file. The example demonstrates how to use commands to take a 640 × 480, 24-fps film source that has been telecined to 30 fps and convert it to 24 fps by using an inverse telecine filter before encoding it. The first two commands instruct the tool to use quality-based variable bit rate (-v_mode 2) to encode the source at quality settings of 95 and 97, respectively. The final two commands instruct the tool to use two-pass constant bit rate (-v_mode 1) to encode the source at 1 megabit per second (Mbps) and 500 kilobits per second (Kbps), respectively.

cscript.exe wmcmd.vbs -input C:\My-clips\Mymovie.avi -output C:\My-clips-coded\Mymovie-640x480-vbr095.wmv -v_mode 2 -v_quality 95 -v_keydist 30 -v_preproc 5
cscript.exe wmcmd.vbs -input C:\My-clips\Mymovie.avi -output C:\My-clips-coded\Mymovie-320x240-vbr097.wmv -v_mode 2 -v_quality 97 -v_keydist 30 -v_preproc 5 -v_width 320 -v_height 240
cscript.exe wmcmd.vbs -input C:\My-clips\Mymovie.avi -output C:\My-clips-coded\Mymovie-640x480-cbr2.wmv -v_mode 1 -v_bitrate 1000000 -v_keydist 30 -v_buffer 10000 -v_quality 100 -v_preproc 5
cscript.exe wmcmd.vbs -input C:\My-clips\Mymovie.avi -output C:\My-clips-coded\Mymovie-320x240-cbr2.wmv -v_mode 1 -v_bitrate 500000 -v_keydist 30 -v_buffer 10000 -v_quality 100 -v_preproc 5 -v_width 320 -v_height 240

Related topics

  • Encoding files and live events


Using profiles

A profile is a collection of command-line options tailored to the type of content being encoded, the connection speed of the intended audience, and the desired image quality of the output. The options stored in a profile include the audio and video bit rate, frame rate, video size, client connection speed, and codecs. Windows Media Encoding Script includes a number of profiles that you can use to simplify the process of setting up an encoding session. Instead of specifying each individual setting that you want to use to encode your content, you specify a profile name, and then all settings within that profile are applied to the content.

If none of the system profiles meet your needs, you can create your own profile by specifying each of the options you want to use in the command. You can append the -saveprofile option to the end of the command to save your profile and use it again. Profiles have a .prx file name extension.

The profiles that are provided with Windows Media Encoding Script are not editable. However, you can override profile settings by appending other command-line options to the command. For example, if you use the av700 profile, which has an image quality setting of 75, and you want to change the image quality setting to 100, you can use the –v_quality option to specify the change. For example:

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

Related topics

  • Windows Media Encoding Script
  • To specify a profile for a session
  • Audio and video profiles
  • Audio-only profiles
  • Video-only profiles
  • Using configuration files
  • Using command-line options


To specify a profile for a session

  1. Open a command prompt window.
  2. At the command prompt, type the path to the folder where the file Wmcmd.vbs is located. For example, type:
    cd \Program Files\Windows Media Components\Encoder
  3. Type the following command, and then press the ENTER key:
    cscript.exe wmcmd.vbs –input drive:\Path\Input_file_name -output drive:\Path\Output_file_name -profile profile_number

    For example:

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

Related topics

  • Using profiles


Audio and video profiles

Windows Media Encoding Script includes 14 system profiles for encoding content that contains both audio and video. The following table contains a brief description of each profile.

Profile name | Bit rate (Kbps) | Actual rate (Kbps) | Description
av20 | 28 | 20 | 28-Kbps modem
av32 | 56 | 32 | 56-Kbps modem
av100 | 100 | 100 | Local area network (LAN)
av225 | 256 | 225 | LAN
av350 | 384 | 350 | LAN and digital subscriber line (DSL)
av450 | 768 | 450 | LAN and DSL
av700 | 700 | 700 | Near-broadcast-quality National Television System Committee (NTSC)
av1400 | 1,400 | 1,400 | Near-broadcast-quality NTSC
av350pal | 384 | 350 | Broadband Phase Alternating Line (PAL)
av700pal | 700 | 700 | Near-broadcast-quality PAL
av100_2p | 100 | 100 | LAN and two-pass constant bit rate (CBR)
av350_2p | 350 | 350 | LAN, DSL, and two-pass CBR
av600vbr | 600 | 600 | Film and peak variable bit rate (VBR)
avq97vbr | -- | -- | Film, VBR, and quality-based VBR

Related topics

  • Using profiles


av20

  • Name: av20 (Profile_AudioVideo_Modem_28K)
  • Audio codec: Windows Media Audio Standard 9
  • Audio bit rate: 5,000 bps
  • Sampling rate: 8,000 Hz
  • Number of channels: 1
  • Video codec: Windows Media Video 9
  • Encoding mode: One-pass CBR
  • Preprocessing: None
  • Video bit rate: 15,000 bps
  • Frame width: 160 pixels
  • Frame height: 120 pixels
  • Frame rate: 15 fps
  • Delay buffer: 5,000 msec
  • Smoothness/quality: 75
  • Key frame distance: 10 sec
  • Total bit rate: 20,000 bps

Related topics

  • Audio and video profiles


av32

  • Name: av32 (Profile_AudioVideo_Modem_56K)
  • Audio codec: Windows Media Audio Standard 9
  • Audio bit rate: 10,168 bps
  • Sampling rate: 11,025 Hz
  • Number of channels: 1
  • Video codec: Windows Media Video 9
  • Encoding mode: One-pass CBR
  • Preprocessing: None
  • Video bit rate: 22,000 bps
  • Frame width: 176 pixels
  • Frame height: 144 pixels
  • Frame rate: 15 fps
  • Delay buffer: 5,000 msec
  • Smoothness/quality: 75
  • Key frame distance: 10 sec
  • Total bit rate: 32,168 bps

Related topics

  • Audio and video profiles


av100

  • Name: av100 (Profile_AudioVideo_LAN_100K)
  • Audio codec: Windows Media Audio Standard 9
  • Audio bit rate: 16,000 bps
  • Sampling rate: 16,000 Hz
  • Number of channels: 1
  • Video codec: Windows Media Video 9
  • Encoding mode: One-pass CBR
  • Preprocessing: None
  • Video bit rate: 84,000 bps
  • Frame width: 320 pixels
  • Frame height: 240 pixels
  • Frame rate: 15 fps
  • Delay buffer: 5,000 msec
  • Smoothness/quality: 75
  • Key frame distance: 10 sec
  • Total bit rate: 100,000 bps

Related topics

  • Audio and video profiles


av225

  • Name: av225 (Profile_AudioVideo_LAN_256K)
  • Audio codec: Windows Media Audio Standard 9
  • Audio bit rate: 40,000 bps
  • Sampling rate: 32,000 Hz
  • Number of channels: 2
  • Video codec: Windows Media Video 9
  • Encoding mode: One-pass CBR
  • Preprocessing: None
  • Video bit rate: 185,000 bps
  • Frame width: 320 pixels
  • Frame height: 240 pixels
  • Frame rate: 30 fps
  • Delay buffer: 5,000 msec
  • Smoothness/quality: 75
  • Key frame distance: 10 sec
  • Total bit rate: 225,000 bps

Related topics

  • Audio and video profiles


av350

  • Name: av350 (Profile_AudioVideo_LANDSL_384K)
  • Audio codec: Windows Media Audio Standard 9
  • Audio bit rate: 48,000 bps
  • Sampling rate: 32,000 Hz
  • Number of channels: 2
  • Video codec: Windows Media Video 9
  • Encoding mode: One-pass CBR
  • Preprocessing: None
  • Video bit rate: 302,000 bps
  • Frame width: 320 pixels
  • Frame height: 240 pixels
  • Frame rate: 30 fps
  • Delay buffer: 5,000 msec
  • Smoothness/quality: 75
  • Key frame distance: 10 sec
  • Total bit rate: 350,000 bps

Related topics

  • Audio and video profiles


av450

  • Name: av450 (Profile_AudioVideo_LANDSL_768K)
  • Audio codec: Windows Media Audio Standard 9
  • Audio bit rate: 64,040 bps
  • Sampling rate: 44,100 Hz
  • Number of channels: 2
  • Video codec: Windows Media Video 9
  • Encoding mode: One-pass CBR
  • Preprocessing: None
  • Video bit rate: 386,000 bps
  • Frame width: 320 pixels
  • Frame height: 240 pixels
  • Frame rate: 30.00 fps
  • Delay buffer: 5,000 msec
  • Smoothness/quality: 75
  • Key frame distance: 10 sec
  • Total bit rate: 450,040 bps

Related topics

  • Audio and video profiles


av700

  • Name: av700 (Profile_AudioVideo_NearBroadCast_700K)
  • Audio codec: Windows Media Audio Standard 9
  • Audio bit rate: 64,040 bps
  • Sampling rate: 44,100 Hz
  • Number of channels: 2
  • Video codec: Windows Media Video 9
  • Encoding mode: One-pass CBR
  • Preprocessing: None
  • Video bit rate: 636,000 bps
  • Frame width: 320 pixels
  • Frame height: 240 pixels
  • Frame rate: 30 fps
  • Delay buffer: 5,000 msec
  • Smoothness/quality: 75
  • Key frame distance: 10 sec
  • Total bit rate: 700,040 bps

Related topics

  • Audio and video profiles


av1400

  • Name: av1400 (Profile_AudioVideo_NearBroadCast_1400K)
  • Audio codec: Windows Media Audio Standard 9
  • Audio bit rate: 128,040 bps
  • Sampling rate: 44,100 Hz
  • Number of channels: 2
  • Video codec: Windows Media Video 9
  • Encoding mode: One-pass CBR
  • Preprocessing: None
  • Video bit rate: 1,272,000 bps
  • Frame width: 320 pixels
  • Frame height: 240 pixels
  • Frame rate: 30 fps
  • Delay buffer: 5,000
  • Smoothness/quality: 75
  • Key frame distance: 10 sec
  • Total bit rate: 1,400,040 bps

Related topics

  • Audio and video profiles


av350pal

  • Name: av350pal (Profile_AudioVideo_Broadband_PAL_384K)
  • Audio codec: Windows Media Audio Standard 9
  • Audio bit rate: 48,000 bps
  • Sampling rate: 32,000 Hz
  • Number of channels: 2
  • Video codec: Windows Media Video 9
  • Encoding mode: One-pass CBR
  • Preprocessing: None
  • Video bit rate: 302,000 bps
  • Frame width: 352 pixels
  • Frame height: 288 pixels
  • Frame rate: 25 fps
  • Delay buffer: 5,000 msec
  • Smoothness/quality: 75
  • Key frame distance: 10 sec
  • Total bit rate: 350,000 bps

Related topics

  • Audio and video profiles


av700pal

  • Name: av700pal (Profile_AudioVideo_NearBroadCast_PAL_700K)
  • Audio codec: Windows Media Audio Standard 9
  • Audio bit rate: 64,040 bps
  • Sampling rate: 44,100 Hz
  • Number of channels: 2
  • Video codec: Windows Media Video 9
  • Encoding mode: One-pass CBR
  • Preprocessing: None
  • Video bit rate: 636,000 bps
  • Frame width: 352 pixels
  • Frame height: 288 pixels
  • Frame rate: 25 fps
  • Delay buffer: 5,000 msec
  • Smoothness/quality: 75
  • Key frame distance: 10 sec
  • Total bit rate: 700,040 bps

Related topics

  • Audio and video profiles


av100_2p

  • Name: av100_2p (Profile_AudioVideo_LAN_100K_2Pass)
  • Audio codec: Windows Media Audio Standard 9
  • Audio bit rate: 16,000 bps
  • Sampling rate: 16,000 Hz
  • Number of channels: 1
  • Video codec: Windows Media Video 9
  • Encoding mode: Two-pass CBR
  • Preprocessing: None
  • Video bit rate: 84,000 bps
  • Frame width: 320 pixels
  • Frame height: 240 pixels
  • Frame rate: 15 fps
  • Delay buffer: 5,000 msec
  • Smoothness/quality: 75
  • Key frame distance: 10 sec
  • Total bit rate: 100,000 bps

Related topics

  • Audio and video profiles


av350_2p

  • Name: av350_2p (Profile_AudioVideo_LANDSL_384K_2Pass)
  • Audio codec: Windows Media Audio Standard 9
  • Audio bit rate: 48,000 bps
  • Sampling rate: 32,000 Hz
  • Number of channels: 2
  • Video codec: Windows Media Video 9
  • Encoding mode: Two-pass CBR
  • Preprocessing: None
  • Video bit rate: 302,000 bps
  • Frame width: 320 pixels
  • Frame height: 240 pixels
  • Frame rate: 30 fps
  • Delay buffer: 5,000 msec
  • Smoothness/quality: 75
  • Key frame distance: 10 sec
  • Total bit rate: 350,000 bps

Related topics

  • Audio and video profiles


av600vbr

  • Name: av600vbr (Profile_AudioVideo_FilmVBR_600K)
  • Audio codec: Windows Media Audio Standard 9
  • Audio bit rate: 64,040 bps
  • Sampling rate: 44,100 Hz
  • Number of channels: 2
  • Video codec: Windows Media Video 9
  • Encoding mode: Peak bit rate-based VBR
  • Preprocessing: Inverse telecine
  • Video bit rate: 536,000 bps
  • Video peak bit rate: 1.5 times the video bit rate
  • Frame width: 320 pixels
  • Frame height: 240 pixels
  • Frame rate: 24 fps
  • Peak buffer: 5,000 msec
  • Key frame distance: 10 sec
  • Total bit rate: 600,040 bps

Related topics

  • Audio and video profiles


avq97vbr

  • Name: avq97vbr (Profile_AudioVideo_FilmVBR_Quality97)
  • Audio codec: Windows Media Audio Standard 9
  • Audio bit rate: 64,040 bps
  • Sampling rate: 44,100 Hz
  • Number of channels: 2
  • Video codec: Windows Media Video 9
  • Encoding mode: Quality-based VBR
  • Preprocessing: Inverse telecine
  • Frame width: 320 pixels
  • Frame height: 240 pixels
  • Frame rate: 24 fps
  • Quality: 97
  • Key frame distance: 10 sec

Related topics

  • Audio and video profiles


Audio-only profiles

Windows Media Encoding Script includes seven system profiles for encoding content that contains audio, but no video. The following table contains a brief description of each profile.

Profile name | Bit rate (Kbps) | Actual rate (Kbps) | Description
a20_1 | 28 | 20 | FM radio mono
a20_2 | 28 | 20 | FM radio stereo
a32 | 56 | 32 | 56-Kbps modem
a48 | 48 | 48 | Near-CD quality
a64 | 64 | 64 | CD quality
a96 | 96 | 96 | CD-audiophile quality
a128 | 128 | 128 | CD-audiophile quality

Related topics

  • Using profiles


a20_1

  • Name: a20_1 (Profile_AudioOnly_FMRadioMono_28K)
  • Audio codec: Windows Media Audio Standard 9
  • Audio bit rate: 20,008 bps
  • Sampling rate: 22,050 Hz
  • Number of channels: 1
  • Total bit rate: 20,008 bps

Related topics

  • Audio-only profiles


a20_2

  • Name: a20_2 (Profile_AudioOnly_FMRadioStereo_28K)
  • Audio codec: Windows Media Audio Standard 9
  • Audio bit rate: 20,008 bps
  • Sampling rate: 22,050 Hz
  • Number of channels: 2
  • Total bit rate: 20,008 bps

Related topics

  • Audio-only profiles


a32

  • Name: a32 (Profile_AudioOnly_Modem_56K)
  • Audio codec: Windows Media Audio Standard 9
  • Audio bit rate: 32,000 bps
  • Sampling rate: 32,000 Hz
  • Number of channels: 2
  • Total bit rate: 32,000 bps

Related topics

  • Audio-only profiles


a48

  • Name: a48 (Profile_AudioOnly_NearCDQuality_48K)
  • Audio codec: Windows Media Audio Standard 9
  • Audio bit rate: 48,024 bps
  • Sampling rate: 32,000 Hz
  • Number of channels: 2
  • Total bit rate: 48,024 bps

Related topics

  • Audio-only profiles


a64

  • Name: a64 (Profile_AudioOnly_CDQuality_64K)
  • Audio codec: Windows Media Audio Standard 9
  • Audio bit rate: 64,016 bps
  • Sampling rate: 44,100 Hz
  • Number of channels: 2
  • Total bit rate: 64,016 bps

Related topics

  • Audio-only profiles


a96

  • Name: a96 (Profile_AudioOnly_CDAudiophileQuality_96K)
  • Audio codec: Windows Media Audio Standard 9
  • Audio bit rate: 96,024 bps
  • Sampling rate: 44,100 Hz
  • Number of channels: 2
  • Total bit rate: 96,024 bps

Related topics

  • Audio-only profiles


a128

  • Name: a128 (Profile_AudioOnly_CDAudiophileQuality_128K)
  • Audio codec: Windows Media Audio Standard 9
  • Audio bit rate: 128,016 bps
  • Sampling rate: 44,100 Hz
  • Number of channels: 2
  • Total bit rate: 128,016 bps

Related topics

  • Audio-only profiles


Video-only profiles

Windows Media Encoding Script includes two system profiles for encoding content that contains video, but no audio. The following table contains a brief description of each profile.

Profile name | Bit rate (Kbps) | Actual rate (Kbps) | Description
v20 | 28 | 20 | Video only, 28-Kbps modem
v32 | 56 | 32 | Video only, 56-Kbps modem

Related topics

  • Using profiles


v20

  • Name: v20 (Profile_VideoOnly_Modem_28K)
  • Video codec: Windows Media Video 9
  • Encoding mode: Two-pass CBR
  • Preprocessing: Deinterlace
  • Video bit rate: 20,000 bps
  • Frame width: 176 pixels
  • Frame height: 144 pixels
  • Frame rate: 15 fps
  • Delay buffer: 5,000 msec
  • Smoothness/quality: 75
  • Key frame distance: 10 sec
  • Total bit rate: 20,000 bps

Related topics

  • Video-only profiles


v32

  • Name: v32 (Profile_VideoOnly_Modem_56K)
  • Video codec: Windows Media Video 9
  • Encoding mode: Two-pass CBR
  • Preprocessing: Deinterlace
  • Video bit rate: 32,000 bps
  • Frame width: 240 pixels
  • Frame height: 176 pixels
  • Frame rate: 15 fps
  • Delay buffer: 5,000 msec
  • Smoothness/quality: 75
  • Key frame distance: 10 sec
  • Total bit rate: 32,000 bps

Related topics

  • Video-only profiles


Advanced encoding techniques

Using Windows Media Encoding Script, you have a number of options for fine-tuning encoding settings. This section describes a few of the options and how to use them.

Related topics

  • Windows Media Encoding Script
  • Applying preprocessing filters
  • Using CBR or VBR encoding
  • Sourcing from multichannel audio files
  • Using configuration files
  • Using command-line options


Applying preprocessing filters

Windows Media Encoding Script includes filters that enable you to improve the quality of telecined and interlaced content for playback on progressive-scan displays or to maintain the interlacing in content for playback on interlaced playback devices. By default, no filters are applied (-v_preproc 0). You should use the no filter command with content that is already in a progressive-scan format and that will be rendered in a progressive-scan display.

Related topics

  • Advanced encoding techniques
  • Deinterlacing filters
  • Inverse telecine filters
  • Interlacing filters


Deinterlacing filters

The deinterlacing filter converts interlaced video to progressive-scan format. The following table describes the commands available to you when you apply the deinterlacing filter to your video.

Command | Description
-v_preproc 1 | Preserves the size of the source video. For example, video that is 640 × 480 pixels and 30 fps is encoded at 640 × 480 pixels and 30 fps.
-v_preproc 2 | The output video is half the original video size. For example, video that is 640 × 480 pixels and 30 fps is encoded at 320 × 240 pixels and 30 fps.
-v_preproc 3 | The output video is half the original video size and the frame rate is doubled. For example, video that is 640 × 480 pixels and 30 fps is encoded at 320 × 240 pixels and 60 fps.
-v_preproc 4 | The output video is half the original vertical size and the frame rate is doubled. For example, video that is 320 × 480 pixels and 30 fps is encoded at 320 × 240 pixels and 60 fps.

Related topics

  • Applying preprocessing filters
  • Inverse telecine filters
  • Interlacing filters
  • To apply a filter to your content


Inverse telecine filters

The inverse telecine filter converts video from 30 fps to 24 fps. The following table describes the commands available to you when you apply the inverse telecine filter to your video.

Command | Description
-v_preproc 5 | Use if your content has incoherencies or if you are not certain which frame the content starts with.
-v_preproc 6 | Use if the first field in the frame is the top (odd) field with the AA telecine pattern.
-v_preproc 7 | Use if the first field in the frame is the top (odd) field with the BB telecine pattern.
-v_preproc 8 | Use if the first field in the frame is the top (odd) field with the BC telecine pattern.
-v_preproc 9 | Use if the first field in the frame is the top (odd) field with the CD telecine pattern.
-v_preproc 10 | Use if the first field in the frame is the top (odd) field with the DD telecine pattern.
-v_preproc 11 | Use if the first field in the frame is the bottom (even) field with the AA telecine pattern.
-v_preproc 12 | Use if the first field in the frame is the bottom (even) field with the BB telecine pattern.
-v_preproc 13 | Use if the first field in the frame is the bottom (even) field with the BC telecine pattern.
-v_preproc 14 | Use if the first field in the frame is the bottom (even) field with the CD telecine pattern.
-v_preproc 15 | Use if the first field in the frame is the bottom (even) field with the DD telecine pattern.

Related topics

  • Applying preprocessing filters
  • Deinterlacing filters
  • Interlacing filters
  • To apply a filter to your content


Interlacing filters

The interlacing filter maintains the interlacing in your source video. The following table describes the commands available to you when you apply the interlacing filter to your video.

Command | Description
-v_preproc 16 | Maintains the interlacing in the source video.
-v_preproc 17 | Maintains the interlacing in the source video. Use if the first field being encoded is the top (odd) field.
-v_preproc 18 | Maintains the interlacing in the source video. Use if the first field being encoded is the bottom (even) field.

Related topics

  • Applying preprocessing filters
  • Deinterlacing filters
  • Inverse telecine filters
  • To apply a filter to your content


To apply a filter to your content

  1. Open a command prompt window.
  2. At the command prompt, type the path to the folder where the file Wmcmd.vbs is located. For example, type
    cd \program files\windows media components\encoder
  3. Type the following command, and then press the ENTER key:
    cscript.exe wmcmd.vbs –input drive:\Path\Input_file_name -output drive:\Path\Output_file_name -v_preproc filter

    For example:

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

Related topics

  • Applying preprocessing filters


Using CBR or VBR encoding

You can encode content at either a constant bit rate (CBR) or a variable bit rate (VBR). Use CBR encoding when you plan to stream the content. Use VBR encoding when you plan to distribute the content for downloading and playing either locally or on a device that has a constrained reading speed, such as a CD or DVD player.

  • CBR encoding. With this option, you specify the average bit rate that you want to maintain and then set the size of the buffer. Bit rate fluctuations during encoding are constrained by the buffer size, and the image quality fluctuates to ensure that the buffer does not overflow or underflow. You can use either one- or two-pass encoding for CBR encoding.
  • Quality-based VBR encoding. With this option, the content is encoded at a specified quality (from 0 to 100). For video content, no frames are dropped. During encoding, the bit rate varies to ensure the specified quality is met. Use this option when you do not care about the bit rate but want to ensure the quality of the output. This option uses one-pass encoding.
  • Bit rate-based VBR encoding. With this option, you must specify the desired average bit rate. No frames are dropped in this mode. At any point, the bit rate may exceed the specified average bit rate but the overall bit rate will match the average bit rate. This option uses two-pass encoding.
  • Peak bit rate-based VBR encoding. This option is similar to the bit rate-based VBR option, except that you also specify the peak bit rate. The bit rate fluctuates during encoding, but does not exceed the specified peak bit rate. Use this option when the content will be played back by a device that has a constrained reading speed, such as a CD or DVD player. This option uses two-pass encoding.

    Note image Note

    • If you encode content by using a profile that does not specify either CBR or VBR encoding, or if you set up a custom encoding session and do not specify CBR or VBR encoding, one-pass CBR encoding is used by default.

Related topics

  • Advanced encoding techniques
  • Implementing a CBR or VBR encoding mode


Implementing a CBR or VBR encoding mode

The following table summarizes the command-line options that are required to implement a CBR or VBR encoding mode for video content.

Mode | Command
One-pass CBR | -v_mode 0, -v_bitrate, -v_buffer, –v_quality
Two-pass CBR | -v_mode 1, -v_bitrate, -v_buffer, –v_quality
Quality-based VBR (one-pass) | -v_mode 2, -v_quality
Bit rate-based VBR (two-pass) | -v_mode 3, -v_bitrate
Peak bit rate-based VBR (two-pass) | -v_mode 4, -v_bitrate, (-v_peakbitrate and -v_peakbuffer are optional; if you do not specify values, default values are used)

The following table summarizes the command-line options that are required to implement each CBR and VBR mode for audio content.

Mode | Command
One-pass CBR | -a_mode 0, -a_setting
Two-pass CBR | -a_mode 1, -a_setting
Quality-based VBR (one-pass) | -a_mode 2, -a_setting (the first number represents the target quality; use the format Qvalue)
Bit rate-based VBR (two-pass) | -a_mode 3, -a_setting
Peak bit rate-based VBR (two-pass) | -a_mode 4, -a_setting, (-a_peakbitrate and -a_peakbuffer are optional; if you do not specify values, default values are used)

You can mix encoding modes in a session. For example, you can use two-pass CBR encoding for your audio and quality-based VBR encoding for your video.

Related topics

  • Using CBR or VBR encoding


Sourcing from multichannel audio files

Using Windows Media Encoding Script, you can encode multichannel audio, which means you can encode audio for a surround sound playback in six channels. Your content source must be either a single six-channel WAVE_FORMAT_EXTENSIBLE file, or you can source from six mono channel .wav files.

To source from a single file, you set up a command that identifies the file as your input. You must also specify the Windows Media Audio Professional 9 codec. For example:

cscript.exe wmcmd.vbs –input C:\My-6_channel_file -output C:\My_song.wma -a_codec WMA9PRO

It is not possible to source from six mono channel .wav files directly from Windows Media Encoding Script. Instead, you can set up a multichannel audio session by using Windows Media Encoder. You can then save the session and refer to the session file in your command. For example:

cscript.exe wmcmd.vbs –wme C:\My_multichannel_session.wme

When sourcing from multichannel audio, you can also include the -a_folddown6to2 parameter in the command. This parameter specifies the folddown coefficients for playback on stereo speakers.

The user playing your content must have Microsoft Windows XP and a player that is based on the Windows Media Format 9 Series Software Development Kit (SDK); otherwise, the audio is folded down automatically to two channels for stereo speakers.

Related topics

  • Advanced encoding techniques


Using configuration files

If you have created a set of command-line options that you want to reuse, you can save the options to a file, referred to as a configuration file. A configuration file is a text file that contains the names and values of command-line options that you want to use in an encoding session. Rather than specifying each option individually at the command prompt, you can put them into a configuration file and then call the configuration file when you run Windows Media Encoding Script.

Information in the configuration file can include the input file name or audio and video devices, the profile, and any other options that you want to specify. You can also override the settings in the configuration file by typing individual options on the command line.

You can create configuration files with a text editing tool or from the command line by appending the –s_config option to your command. When you append the –s_config option, you specify a file name and all of the options in your command are collected and saved into that configuration file. Configuration files have a .weu file name extension. If you don't specify the file name extension when creating the configuration file, it is appended to the file name for you.

Related topics

  • Advanced encoding techniques
  • To call a configuration file


To call a configuration file

  1. Open a command prompt window.
  2. At the command prompt, type the path to the folder where the file Wmcmd.vbs is located. For example, type
    cd \program files\windows media components\encoder
  3. Type the following command, and then press the ENTER key:
    cscript.exe wmcmd.vbs –config drive:\Path\Configuration_file_name

    For example:

    cscript.exe wmcmd.vbs –config C:\Config-files\Myvideos.weu

Related topics

  • Using configuration files


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

  • Advanced encoding techniques


Supported pixel formats

When using the –pixelformat option, you must specify one of the following pixel formats.

  • Auto (default)
  • I420
  • IYUV
  • RGB 1
  • RGB 24
  • RGB 32
  • RGB 4
  • RGB 555
  • RGB 565
  • RGB 8
  • UYVY
  • YUY2
  • YV12
  • YVU9
  • YVYU

Related topics

  • Using command-line options


Frequently asked questions

  1. Can I use extended .avi files with Windows Media Encoding Script?

    Yes. Windows Media Encoding Script supports the extended .avi format specification and can encode .avi files that are larger than 2 gigabytes (GB).

  2. What kind of compression is applied if I don't specify a profile or other options in my encoding command?

    Windows Media Encoding Script uses the following defaults for each setting: Windows Media Audio Standard 9 and Windows Media Video 9 codecs; one-pass CBR encoding; the frame rate and frame height and width match that of the input source; one channel; an audio sampling rate of 44,100 Hz; a delay buffer of 3,000 milliseconds; smoothness setting of 75; key frame distance of 10 seconds; and the audio and video bit rates of 64 and 250 kilobits per second (Kbps), respectively.

  3. Can I transcode compressed Windows Media files with .wma and .wmv file name extensions to achieve a different bit rate?

    Yes. However, you will have better results if you encode the original source file again and specify the bit rate you want with the –v_bitrate option for video or the –a_setting option for audio.

  4. I set the –v_bitrate in one- and two-pass CBR and bit rate-based VBR modes (-v_mode 0, 1, and 3), and the bit rate of the compressed clip is significantly lower than what I specified. Is this an error?

    No. If the clip, or some segment of the clip, is easy to encode for the target bit rate (for example, the bit rate setting is very high and the resolution is low), the codec does not require all of the available bandwidth to compress the content.

  5. I set the –v_bitrate in bit rate-based VBR mode (-v_mode 3), and the bit rate of the compressed clip is significantly higher than what I specified. Is this an error?

    No. Frames are not dropped when you encode content by using the –v_mode 3 option. If the clip, or some segment of the clip, is difficult to encode for the target bit rate (for example, the bit rate setting is low and the resolution is high), the codec does require more bandwidth to compress the content.

  6. In what order does Windows Media Encoding Script clip, preprocess, and resize my content?

    Clipping is the first step and is performed on the source. By clipping first, the encoding process is more efficient because you eliminate any unwanted portions of the video before encoding them. Preprocessing, such as applying deinterlacing or inverse telecine filters comes second, followed by setting the output size of the encoded video.

  7. Can I use Windows Media Encoding Script to encode a multiple-bit-rate (MBR) file so I can stream my content to users who have various connection speeds?

    No. Windows Media Encoding Script does not support MBR encoding. Windows Media Encoder does support MBR encoding and includes several profiles to suit your needs.

  8. I used the -v_quality setting to set my image quality to 95 and then 96. I achieved the same result with both settings. Is this normal?

    Yes. Some of the -v_quality settings are mapped internally to the same image quality value. To see a change in your image quality, increase or decrease your -v_quality setting by larger increments.

  9. The statistic showing the amount of buffer that was used during my encoding session differs from the -v_buffer value that I set. Why?

    If you set a large buffer but are encoding content that is not very complex, the codecs may not use all of the buffer space that was allocated. In the rare case that you set a very small buffer, the codecs may need a larger buffer space than what you allocated. The effective buffering delay is either the buffer that you set or the buffer the codecs actually used, whichever is larger.

Related topics

  • Windows Media Encoding Script


Glossary

To find a term in the glossary, click the letter of the alphabet that is the first letter in the term you want to look up.

You can also read glossary terms within the text of Help by clicking the underlined glossary term links. After you click a glossary link, the glossary term and definition appear in a pop-up window. To close the window, click anywhere on the screen.

A | B | C | D | E | F | G | H | I | J | K | L | M
N | O | P | Q | R | S | T | U | V | W | X | Y | Z

Symbols

.prx

The file name extension of a profile.

.weu

The file name extension of a configuration file used by Windows Media Encoding Script.

.wma

The file name extension of an audio file in Windows Media Format. The audio content of the file is encoded with the Windows Media Audio codec.

.wme

The file name extension for a Windows Media Encoder session file.

.wmv

The file name extension of a video file in Windows Media Format.

Back to Top

A

aspect ratio

The ratio of the width of an image to its height.

Audio Video Interleaved (AVI)

A multimedia file format for storing sound and moving pictures in RIFF format.

AVI

See definition for: Audio Video Interleaved (AVI)

Back to Top

B

bandwidth

A network's capacity for transferring an amount of data in a given time.

bit rate

The number of bits transferred per second.

Back to Top

C

caption

Text that accompanies images or videos, either as a supplemental description or a transcript of spoken words.

CBR

See definition for: constant bit rate (CBR)

codec

An abbreviation for compressor/decompressor. Software or hardware used to compress and decompress digital media.

compression

A process for removing redundant data from a digital media file or stream to reduce its size or the bandwidth used.

configuration file

A text file used by Windows Media Encoding Script that specifies the content to be encoded and the command-line options to be invoked.

constant bit rate (CBR)

A characteristic of a data stream in which the bit rate remains nearly uniform for the duration of the stream.

See also: variable bit rate (VBR)

content

Audio, video, images, text, or any other information that is contained in a digital media file or stream.

Back to Top

D

deinterlace

To combine the interlaced fields in a video frame so that, during playback, the lines of the video frame are painted sequentially.

See also: interlace

delta frame

A video frame that contains only the changes from the previous frame. In contrast, a key frame contains all the data necessary to construct that frame.

Back to Top

E

encode

To convert audio and video content to a specified digital format.

Back to Top

F

frame rate

The number of video frames displayed per second. Higher frame rates generally produce smoother movement in the picture.

Back to Top

I

ICM

See definition for: Image Compression Manager (ICM)

IEEE 1394

See definition for: Institute of Electrical and Electronics Engineers (IEEE) 1394

Institute of Electrical and Electronics Engineers (IEEE) 1394

A high-speed serial bus standard that provides enhanced computer connectivity for a wide range of devices, including consumer electronics audio/video (A/V) appliances, storage peripherals, other computers, and portable devices.

intelligent streaming

A type of streaming that detects network conditions and adjusts the properties of a video or audio stream to maximize quality.

interlace

To display a video frame in two fields. One field contains the even lines of the frame, the other field contains the odd lines. During playback, the lines in one field are displayed first, then the lines in the second field are displayed.

inverse telecine

The process that removes the frames that were added when 24-fps film was converted to 30-fps video.

Back to Top

K

key frame

A frame of video data that contains all the data necessary to construct that frame. In contrast, delta frames contain data relating to changes from the last key frame, and do not contain enough information to construct a complete frame.

Back to Top

L

looping

In Windows Media Encoder, repeatedly playing a file until all content is encoded. For example, an audio track can be looped while a video file is being encoded.

lossless compression

Data compression techniques in which no data is lost.

lossy compression

Data compression techniques in which some amount of data is lost. Lossy compression technologies attempt to eliminate redundant or unnecessary information. Reducing the file size of an image in this way can degrade the quality of the image.

Back to Top

M

marker

A pointer to a specific place, measured in time, in a Windows Media file. Windows Media Player uses markers to go directly to a point in the file. Markers enable viewers to skip ahead or skip back to a marker in order to see a particular part of the file again.

MBR

See definition for: multiple bit rate (MBR)

metadata

Data about data. For example, the title, subject, author, and size of a file constitute the file's metadata.

Microsoft MPEG-4 version 3 codec

A video codec included with Microsoft Windows Media Encoder.

multicast

A method of distributing content in which multiple clients share a stream from a server.

multiple bit rate (MBR)

Describes a file or stream that contains the same content encoded at several different bit rates. As network traffic changes, a server running Windows Media Services can switch to a lower or higher bit rate to optimize content delivery.

Back to Top

N

National Television Standards Committee (NTSC)

A standards body that is responsible for setting television and video standards in the United States. The NTSC standard for television defines a composite video signal with a refresh rate of 60 half-frames (interlaced) per second. Each frame contains 525 lines and can contain 16 million different colors. Formerly the National Television Systems Committee.

NTFS

An advanced file system designed for use specifically within the Windows 2000 operating system. It supports file system recovery, extremely large storage media, and long file names. It also supports object-oriented applications by treating all files as objects with user-defined and system-defined attributes.

NTSC

See definition for: National Television Standards Committee (NTSC)

Back to Top

O

one-pass encoding

The ability to pass content through the encoder once. Compression is applied as the content is encountered.

Back to Top

P

PAL

See definition for: Phase Alternating Line (PAL)

PCM

See definition for: Pulse Code Modulation (PCM)

Phase Alternating Line (PAL)

The dominant television standard in Europe. Whereas the NTSC, the U.S. standard, delivers 525 lines of resolution at 60 half-frames per second, PAL delivers 625 lines at 50 half-frames per second.

pixel format

The color depth of an image, usually measured in RGB or YUV.

postroll

To extend the amount of encoded video by a specified number of frames.

preroll

To queue video by a specified number of frames so that the source tape is stabilized before encoding begins.

profile

A predefined group of settings that match content type and bit rate with appropriate audio and video codecs.

Profile Editor

A tool provided with Windows Media Encoder that creates and edits the encoding profiles needed to identify the appropriate codec, the multimedia input streams, and the number and bit rate of the encoded output streams.

publishing point

An organized memory location that translates a client request for content into the physical path on the server hosting the content. A publishing point essentially acts as a redirector.

Pulse Code Modulation (PCM)

A sampling technique for digitizing analog signals, especially audio signals. When you encode audio by using PCM, no compression is applied.

Back to Top

R

RGB

A color model that describes color information in terms of the red (R), green (G), and blue (B) intensities that make up the color.

Back to Top

S

sampling rate

The frequency at which audio or video is sampled, or recorded, into a digital format. Each sample represents the audio or video signal at a particular moment in time. The higher the sampling rate (that is, the more samples taken per unit of time), the more closely the digitized result resembles the original.

script commands

Software instructions that can be included with an encoded stream. Windows Media Player passes script commands to a device or software that interprets them. Script commands are used for such tasks as calling specific files or navigating to a specific Web site.

source

Content that you can encode. Source audio and video content can be captured and encoded from devices installed on your computer or from a file.

startup latency

The time it takes for the encoder, SDK reader, or other devices to start before encoding begins. Startup latency prevents the cutting of frames at the mark-in point.

stream

Data transmitted across a network and any properties associated with the data. Streaming digital data enables clients to begin rendering the data immediately instead of waiting for the entire file to be received.

stream format file

A file used by a player to decode a multicast stream. A stream format file includes information about the stream, the digital media content, and its associated codec.

Back to Top

T

target bandwidth

The number of bits that are transferred to users based on their network connection speeds.

telecine

The film-to-video conversion system that adds frames to video to compensate for the differences in frame rates between film and video. When converting 24 fps film to 30 fps NTSC video, an additional 6 frames per second are added.

transcode

To encode content that is already in Windows Media format, but at a different bit rate.

two-pass encoding

The ability to pass content through the encoder twice. During the first pass, the encoder analyzes the content. During the second pass the encoder applies the appropriate levels of compression, based on the complexity of the material, as determined during the first pass.

Back to Top

U

UDP

See definition for: User Datagram Protocol (UDP)

UNC

See definition for: Universal Naming Convention (UNC)

unicast

A method of providing content in which each client receives a unique stream from a server; no other client has access to the stream.

Universal Naming Convention (UNC)

The system of naming files among computers on a network so that a file on a specified computer has the same path when accessed from any of the other computers on the network. For example, if the directory C:\Path1\Path2\...Pathn on computer Servern is shared under the name Pathdirs, a user on another computer must open \\Servern\Pathdirs\Filename.ext to access the file C:\Path1\Path2\...Pathn\Filename.ext on Servern.

User Datagram Protocol (UDP)

A connectionless transport protocol in the TCP/IP protocol stack that, like TCP, runs on top of IP networks.

Back to Top

V

variable bit rate (VBR)

A characteristic of a data stream in which the bit rate fluctuates, depending upon the complexity of the data.

VBR

See definition for: variable bit rate (VBR)

Back to Top

W

Windows Media Audio codec

A codec used to compress and decompress audio streams.

Windows Media file

A file containing audio, video, or script data that is stored in Windows Media Format. Depending on their content and purpose, Windows Media files use a variety of file name extensions, such as: .wma, .wme, .wms, .wmv, .wmx, .wmz, or .wvx.

Windows Media Format

The format used by Microsoft Windows Media Technologies (or a third-party product that incorporates a licensed Windows Media technology) to author, store, edit, distribute, stream, or play timeline-based content.

Windows Media metafile

In Windows Media Technologies, a file that provides information about Windows Media files and their presentation. File name extensions for Windows Media metafiles include .asx, .wax, .wvx, .wmx, and .nsc.

Windows Media Screen codec

A codec used to compress and decompress sequences of screen images.

Windows Media Speech codec

A codec used to compress and decompress audio streams with an emphasis on speech.

Windows Media Video codec

A codec used to compress and decompress video streams.

Back to Top

Y

YUV

A color model that describes color information in terms of luminance (Y) and chrominance (U, V).

Back to Top


Legal Notice

This is a preliminary document and may be changed substantially prior to final commercial release. This document is provided for informational purposes only and Microsoft makes no warranties, either express or implied, in this document. Information in this document, including URL and other Internet Web site references, is subject to change without notice. The entire risk of the use or the results of the use of this document remains with the user. Unless otherwise noted, the example companies, organizations, products, domain names, e-mail addresses, logos, people, places and events depicted herein are fictitious, and no association with any real company, organization, product, domain name, e-mail address, logo, person, places or events is intended or should be inferred. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation.

Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property.

© 2000-2002 Microsoft Corporation. All rights reserved.

Microsoft, MS-DOS, Windows, Windows Media, Windows NT, ActiveSync, ActiveX, Direct3D, DirectDraw, DirectInput, DirectMusic, DirectPlay, DirectShow, DirectSound, DirectX, FrontPage, JScript, Microsoft Press, MSN, NetShow, Outlook, PowerPoint, Visual Basic, Visual C++, Visual InterDev, Visual J++, Visual Studio, WebTV, Win32, and Win32s are either registered trademarks or trademarks of Microsoft Corporation in the U.S.A. and/or other countries.

The names of actual companies and products mentioned herein may be the trademarks of their respective owners.