Windows Media Encoder Command Line Script Utility

Copyright (C) Microsoft Corporation. All rights reserved.


Release Notes:
==============

WMCmd.vbs is an update to the original command-line encoding utility that 
shipped with Windows Media Encoder 9 Series. This is an unofficial update,
not formally released or supported by Microsoft.

The script requires a valid installation of Windows Media Encoder 9 Series,
either 32-bit original version or new 64-bit version. 32-bit WME9 is
recommended even on 64-bit platforms.

WMCmd.vbs is subject to terms of Microsoft Windows Media Encoder 9 Series
end user license agreement (EULA).

For usage help, just type from the command-line:
	cscript wmcmd.vbs

For updates please visit http://www.citizeninsomniac.com/WMV


Frequently Asked Questions:
===========================

Q: Where can I get the latest Windows Media codecs?
A: WM codecs are distributed as a part of the Windows Media Format SDK runtime
   which is also included in the Windows Media Player setup package. The latest
   version of WM Format runtime is v11. You can get WMF11 runtime by installing
   Windows Media Player 11 or Windows Media Format SDK 11 on XP, or by installing
   Windows Vista.
   
Q: Where can I get the VC-1 codec?
A: Windows Media Video 9 (WMV9) is Microsoft's implementation of the VC-1 codec
   standard targeted at network streaming and local playback, and typically stored
   in an ASF file container. Upgrading to the latest WM Format 11 runtime will
   give you the latest versions of the WMV9 codecs that are fully compliant with
   the VC-1 Simple, Main and Advanced Profiles.
   
Q: Cscript.exe crashes when I try to use WMCmd.vbs on Windows Vista. What should 
   I do?
A: This is a known issue. Microsoft has released a hotfix that fixes the problem:
   http://support.microsoft.com/default.aspx/kb/929182
   
Q: Cscript.exe fails to initialize the WMEncoder object when I try to use WMCmd.vbs
   with 32-bit WME9 on XP/Vista x64. Is WMCmd.vbs encoding broken on Windows x64?
A: Not at all. The default script interpreter on Windows x64 is 64-bit cscript.exe. 
   WME9 x86 installs 32-bit COM objects (used by WMCmd.vbs). In order to run WMCmd,
   you need to use the 32-bit cscript.exe located in \Windows\SysWOW64 or simply 
   run the 32-bit cmd.exe command-prompt which will ensure the 32-bit version of 
   cscript.exe gets invoked. 

Q: When I try to encode multichannel audio sources to WMA Professional, I get the
   error "One or more codecs required to open this content could not be found."
   What am I doing wrong?
A: WME9 SDK was designed to only read multichannel sources which have a proper
   WAVEFORMATEXTENSIBLE header. The header needs to be present either in the AVI
   or WAV file sources, or output by the DirectShow audio decoder.
   If no other option is available, try decoding your multichannel source to
   individual mono WAV files and then combining them into a proper multichannel
   AVI with the Multichannel Combiner utility:
   http://www.microsoft.com/windows/windowsmedia/forpros/encoder/utilities.aspx
   
Q: Why does WMCmd.vbs always fail to retrieve source duration when I use an
   Avisynth script (.avs) source?
A: Because WME's AVI source plugin is unable to retrieve duration from Avisynth
   sources, WMCmd.vbs uses the WMP ActiveX control to try to retrieve the duration
   property. It briefly loads the .avs source into an invisible WMP instance and
   closes it as soon as it's able to read the duration. If even this alternative
   method fails for you, make sure you can actually play back the .avs source file
   in the standalone Windows Media Player application. Sometimes a YV12 or YUY2
   capable decoder is needed to make this work.
   
Q: Can you fix this really annoying codec/WME9/DirectShow bug?
A: No. WMCmd.vbs is just a scripted interface to the Windows Media Encoder 9 SDK.
   If something is restricted or just plain broken in the WME9 SDK - there's
   nothing I can do about it because WME9 is a legacy product (not in active
   development). I can only add functionality that's already exposed through the
   encoder SDK.

   

Changelog:
==========

10-11-2007:
-----------
* Added -v_qp option as an alternative to -v_quality for 1-pass VBR encoding
  (which is in fact a fixed QP encoding mode). Whereas -v_quality uses an abstract 
  0 to 100 scale, -v_qp maps directly to quantizer parameter values in the 1.0 to
  31.0 range (in 0.5 increments).
  
* Encoder registry settings are now removed immediately after the encoder session
  is started because the codec only reads them once at the beginning of the encode
  so there's no reason for them to hang around until the end of the encoding session.
  This ought to improve parallel encoding jobs interoperability too.

* The script no longer indiscriminately destroys existing encoder registry settings.
  At the beginning of each encoding session it saves the existing registry settings
  and then restores them at the end. This improves usability in cases where one set
  of advanced encoder settings is set externally (manually or via PowerToy) while
  another is used from the command-line.
  
* Deprecated -v_percopt in favor of new -v_adz option because valid range for
  -v_percopt didn't make much sense. -v_percopt will continue to work as before but 
  it is no longer documented. -v_adz value range now matches that of "Perceptual
  Option" (Adaptive Dead-Zone) in WMV9 PowerToy. If both -v_percopt and -v_adz are
  specified, -v_percopt values will override -v_adz values.
  
* Redefined and fully documented -v_preset quality presets. They should now better
  reflect their speed and quality rankings.
  
* Made -v_compopt 1 into an Advanced Profile exclusive option because some of its
  components were exclusive to Advanced Profile. It's best to be on the safe side.

5-21-2007:
----------
* Added -log option for redirecting all text output to a file.

* Updated some descriptions for advanced video settings.

* Added a FAQ section to this release document.
 

4-14-2007:
----------
* IMPORTANT CHANGE: Remapped -v_mslevel (Motion Search Level) values to
  correctly reflect the codec implementation. 0 is now the default luma search
  and 3 and 4 are adaptive chroma modes.

* Added an -a_input option that allows specifying an alternative audio source
  to the one present in the main -input source. This makes it possible to use
  separate video and audio source files from the command-line, as it's always
  been possible in the WME9 GUI.

* Updated the documentation, expanded sections on dquant and perceptual
  optimization options. Very useful options for preserving fine detail.

* Fixed a bug where simultaneous encoding jobs would get simultaneously killed
  as soon as one encoding job finished.


3-22-2007:
----------
* Added a -v_preset option that introduces 5 intuitive video quality presets:
  Fast, Good, Better, Best and Insane. Unlike the -v_compopt 1 preset that
  is defined within the codec, -v_preset values are defined in the script and
  can be easily changed and refined in future versions.

* Added -v_complexity as an alias for -v_performance expressed on a 0-5 scale.

* Fixed bug that sometimes caused the script to hang or overwrite certain
  parameters when an external configuration file (-config) was loaded.

* Improved the unknown source duration workaround by having the script 
  automatically add the new file extension (like Avisynth .avs) to the list of
  formats WMP is allowed to play. No more security dialogs on first launch!

* Added profile compliance checking for advanced WMV9 settings - will not set
  certain registry keys if Simple or Main profiles are selected.

* Added code to check if WMEncoder object is initialized correctly before
  proceeding with encode.

* Removed the -help? option which launched WME9 CHM help file from cmd line.

* Removed old Complex Profile (CP) support entirely - translates to AP now.

* Changed Lookahead maximum value to 30.

* Updated the documentation, corrected some vague and erroneous descriptions.


8-25-2006:
----------
* Fixed a bug in configuration saving (-s_config) and loading (-config) functions
  that prevented command-line parameters containing quotation marks from being
  processed correctly.

* Added code to check whether specified video profile (-v_profile) is supported
  by the video codec used (-v_codec). For example, can't use SP or MP with WVC1.


5-19-2006:
----------
* Added support for WVC1 encoding (WMV9 Advanced Profile video codec).

* Added support for WMA10 Professional low-bitrate encoding and changed
  WMA codec identifiers to be version-agnostic (i.e. WMASTD instead of
  WMA9STD)

* Added command-line parameters for advanced video settings otherwise exposed
  only through the registry. For details, see:
  http://www.microsoft.com/windows/windowsmedia/howto/articles/codecadvancedsettings.aspx

* Added support for Avisynth (.avs) script sources and worked around a related
  duration bug in the source plugin.

* Rewrote the encoding progress screen so that it estimates encoding time, ETA
  and encoding speed. 

* Added command-line parameters for music centric metadata such as album, 
  track number, release year, genre, etc. 

* Added metadata summary to the output screen.

* Added documentation for the new advanced video settings to the inline help.

* Reorganized inline help documentation and grouped settings in a more 
  intuitive way. 

* Fixed bug where encoder script would sometimes hang at the end of encoding 
  process. 

* Improved error handling for bad source files.

