-->
Save your seat for Streaming Media NYC this May. Register Now!

Tutorial: Using Windows Media Registry Keys

A version of this article appears in the November 2006 issue of Streaming Media magazine. Click here for your free subscription.

After a relatively quiet 2005, 2006 brings some big improvements to Windows Media codecs to deliver better bang for the bit for on-demand and live streaming. This article looks at the new and enhanced codecs and some ways to take advantage of the new technologies.

The biggest news has been the standardization of the Windows Media Video 9 codec as VC-1, or SMPTE Standard 421M. This means that the standard for the codec is widely available, including reference source code for both encoding and decoding. Behind the scenes, there have been substantial enhancements in the video codecs themselves, improving both performance and compression efficiency.

Many quality improvements are gained automatically by installing the new codec, while others can be obtained by tweaking the registry key settings, described below. While overall performance is improved, the biggest improvement is that the video codec is now 4-way threaded instead of 2–way threaded. Thus, it can saturate a dual-core, dual-socket workstation, doubling performance on modern hardware.

Windows Media Video 9 (WMV3)
The mainstream video codec for streaming and other web use in Windows Media has been and remains our old friend Windows Media Video 9 (WMV 9). Windows Media Video 9 includes the Simple and Main profiles of VC-1, and uses the four-letter code (FourCC) of "WMV3," representing the third major version of the codec (yes, WMV3 is the same as WMV 9).

For computer playback, Main Profile is what you want to use. Simple Profile is a limited version that allows playback on low-power devices, like cell phones.

Windows Media Video 9 Advanced Profile (WVC1)
The initial implementation of Windows Media Video 9 Advanced Profile (WMV9 AP or WVC1) was introduced in the Windows Media Format SDK 9.5, and is bundled with a number of tools today.

That said, the only reason you’d be using any WMV 9 AP for streaming is if you were trying to deliver natively interlaced content. When delivering at 640x480 or higher from interlaced source, leaving the content interlaced can provide twice the motion as deinterlacing to 30p, but at a lower bit rate than converting up to 60p. While you’ll want to have video bit rates north of 1Mbps for interlaced to pay off, it can provide a vivid, smooth video. The decoder automatically takes care of converting the video to progressive for computer playback.

Note that WMV 9 AP decoding is only built into WMP 11, although the decoder is available through automatic codec download back to WMP 9. It isn’t supported for Mac as of Flip4Mac 2.1, but Telestream is looking to add support in future versions.

Registry Key Options
Just installing the new codecs provides a good amount of performance and quality improvements. But to squeeze out the most bang for the bit, there are a number of registry key settings that can be used to change the codecs’ behavior dramatically.

For those not familiar with registry keys, you can use a simple GUI app mentioned below to make modifications. For those who prefer using a command-line encoder instead of changing registry keys, you can download the WMCmd encoder linked at the bottom of this article.I list the keys used if there are more complex options—if nothing is listed, it follows the rule where a value of 0 equals "off" and a value of 1 equals "on."

Compression Optimization Type
Compression Optimization Type is your one-stop shop for choosing overall settings to optimize your encoding mode. The 0 mode is tuned for performance, while 1 optimizes for video quality. It provides a big boost in compression efficiency, but can be two to four times slower. Note that this mode turns on some settings that aren’t compatible with Simple Profile encodes, so it shouldn’t be used if targeting Simple Profile.

If you’ve got the time, on-demand content should start with option 1, and add other options as needed. For webcasting, 1 may be too slow to use on older hardware. As always, test your settings with appropriate test content before trying to encode a live event.

All the settings except for Encoder Complexity can be overridden by using a different value for those parameters.

NumBFrames
This parameter sets the number of B-Frames used. By default, WMV 9 only uses I-Frames (keyframes) and P-Frames (predicted frames, based on the previous P- or I-Frame). A B-Frame is unique in that it can reference both the previous and subsequent frames, but no frame is based on it. This means B-Frames can be more efficient to encode (especially when coupled with B-Frame Delta QP below), and means that they provide scalability on decode. For example, in a file without B-Frames, if the decoder can’t decode a particular frame, all frames after it are dropped until the next I-frame. However, when there are B-Frames, the decoder can just drop those, keeping all the P-Frames. This would yield a lower frame rate, but still preserves motion.

For most web content, one or two B-Frames are appropriate. At higher data rates, one B-Frame is normally the optimal choice. Three or more are rarely useful.

B-Frames are somewhat slower to encode than other frame types. Also, B-Frames are less efficient at encoding whole-frame changes, like a cross-dissolve or fade to or from black. But one B-Frame is a safe default for most content.

Force B-Frame Delta QP
QP is a measurement of how compressed the frame is, and is represented by a delta value of 0–31 in the registry key. The B-Frame Delta QP parameter reduces the quality of B-Frames relative to I- and P-Frames. Using the value of one, B-Frames are compressed a little more than the surrounding I- and P-Frames. Since other frames are never based on B-Frames, B-Frame image data is essentially "thrown away" immediately after they’re displayed. By slightly reducing the quality of the B-Frames, bits are saved for the I- and P-Frames, improving their quality, which is then carried forward to frames based on them. This can be a good win in quality, especially if there are long static shots or a long gap between I-Frames.

Reducing the QP of B-Frames by one, perhaps counterintuitively, can actually improve quality of the B-Frames, since it helps the quality of the frames on which the B-Frame is based. The only drawback is the potential for a slight visible change in image quality with very slow motion. There is a greater risk of this as the number of B-Frames increases.

Streaming Covers
Free
for qualified subscribers
Subscribe Now Current Issue Past Issues