DirectShow Registry Settings (Windows CE 5.0)

Send Feedback

The registry stores information necessary to configure the system for applications and hardware devices. The registry also contains information that the operating system continually references during operation.

Note   The default registry values vary depending on which Catalog items are included in your OS design. For more information, see Default Registry Settings.

Windows Media Video Codec Performance

This registry subkey allows you to adjust Windows Media video codec playback performance and quality for x86 processors only. This subkey is not available for other architectures.

By default, each frame from a Windows Media video stream undergoes some level of post-processing after it is decoded.

The level of post-processing depends on the level of CPU performance. This post-processing smoothes the video frame by deblocking the image to smooth artifacts that are inherent to the digital compression process, and by deringing the image to correct for certain motion artifacts.

The amount of post-processing directly affects your target device's CPU usage. You can adjust the level of post-processing that the Windows Media video codec performs with the following registry subkey.

[HKEY_LOCAL_MACHINE\Software\Microsoft\DirectX\DirectShow\WMVDecoder]
    "PostProcessing"=dword:FFFFFFFF

The following table shows the allowable settings for the PostProcessing named value.

Setting Description
FFFFFFFF Automatic. The Windows Media codec automatically sets the level of post-processing based on the incoming data and your target device's CPU.
0 Disabled. All post-processing is disabled. This will product the highest frame rates during playback, but at the expense of video quality.
1 Fast deblocking. The codec will run each frame through a coarse deblocking filter.
2 Full deblocking. The codec will run each frame through a fine deblocking filter.
3 Fast deblocking and deringing. The codec will run each frame through a coarse deblocking filter and through a deringing filter.
4 Full deblocking and deringing. The codec will run each frame through a fine deblocking filter and also through a deringing filter. This setting has the highest CPU usage. It produces the highest quality image for each individual frame however the overall frame rate may be degraded.

Audio and Video Thread Priorities

If DirectShow is using a very high percentage of your target device's CPU when decoding video, you may experience choppy audio and video performance if other threads with higher priorities need to use the CPU.

If you must maintain smooth audio or smooth video playback at all times then you can use the registry subkey HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DirectShow\ThreadPriority to fine tune the priorities for the audio and video threads.

The following table shows the named values for this subkey.

Value : type Description
Highest : REG_DWORD Default setting is the hexadecimal value F9, identical to the remapped value of THREAD_PRIORITY_HIGHEST (249).

This registry value sets a new thread priority for DirectShow threads running with a priority of THREAD_PRIORITY_HIGHEST.

AboveNormal : REG_DWORD Default setting is the hexadecimal value FA, identical to the remapped value of THREAD_PRIORITY_ABOVE_NORMAL (250).

This registry value sets a new thread priority for DirectShow threads running with a priority of THREAD_PRIORITY_ABOVE_NORMAL.

Normal : REG_DWORD Default setting is the hexadecimal value FB, identical to the remapped value of THREAD_PRIORITY_NORMAL (251).

This registry value sets a new thread priority for DirectShow threads running with a priority of THREAD_PRIORITY_NORMAL.

BelowNormal : REG_DWORD Default setting is the hexadecimal value FC, identical to the remapped value of THREAD_PRIORITY_BELOW_NORMAL (252).

This registry value sets a new thread priority for DirectShow threads running with a priority of THREAD_PRIORITY_BELOW_NORMAL.

Video : REG_DWORD Default setting is the hexadecimal value FB, identical to the remapped value of THREAD_PRIORITY_NORMAL (251).

This registry value sets a new thread priority for the video rendering thread in DirectShow.

The setting for Normal does not affect the video rendering thread.

The named values Highest, AboveNormal, Normal, and BelowNormal are all associated with standard operating system thread priority levels.

DirectShow threads that are identified with the standard operating system thread priorities will run at the priority levels specified by these registry settings instead of the normal values. These settings only affect threads that are owned by DirectShow. They do not affect the global OS priority levels and they do not affect threads owned by Windows Media Player.

For information on Windows CE thread priorities see Priority Levels.

The following code sample shows the default values for this registry subkey.

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DirectShow\ThreadPriority]
    "Highest"=DWORD:F9
    "AboveNormal"= DWORD:FA
    "Normal"= DWORD:FB
    "BelowNormal"= DWORD:FC
    "Video"= DWORD:FB

Note   The default settings for the DirectShow thread priorities will provide satisfactory results for almost all target devices and these values should not be changed unless absolutely necessary.

Adjusting the thread priorities from their default values can be very risky because the adjustments can cause unexpected performance problems for other applications running concurrently with your DirectShow application. Such problems can be notoriously difficult to test for, diagnose, and resolve.

If you have to adjust the DirectShow audio and video thread priorities, make sure the DirectShow priorities are higher than the audio and video driver priorities in your OS design. Also make sure the audio priority is higher than that of the software mixer. Failing to take these steps almost always result in audio and video playback performance problems.

Video Renderer Settings

You can control the settings of the video renderer with the registry subkey HKEY_LOCAL_MACHINE\Software\Microsoft\DirectX\DirectShow\Video Renderer.

The following table shows the named values for this subkey.

Value : type Description
MaxBackBuffers : DWORD The default setting is 1.

This value controls the number of back buffers the video renderer can use.

Do not set this value greater than 2.

Depending on the quality of the surface flipping implementation in the display driver, the value 0 can sometimes provide the best performance.

SurfaceTypes : DWORD This value defines the types of video surfaces that the video renderer uses.

It is a bitwise combination of the DirectShow DirectDraw Surface (AMDDS) definitions shown in the table below.

Always set this to a hexadecimal value, not a symbolic constant.

If you set this value to 0x00 (AMDDS_NONE), the video renderer will use GDI.

UseOverlayStretch : DWORD The default setting is 1.

This value controls aspect ratio preservation in the overlay area.

Set this value to 1 to stretch the video image to fill the overlay area.

Set this value to 0 to preserve the aspect ratio of the video image.

UseScanLine : DWORD The default setting is 0.

This value defines whether the video renderer will use GetScanLine to determine when to blit or flip.

This is typically an expensive operation, so it is turned off by default.

Set this value to 1 to turn it on.

KeyColor : hex This value defines the color key when playing back video using an overlay on a non-palletized display, a display with a color depth greater than 8 bpp.

This is a hexadecimal RGB value.

KeyIndex : hex This value defines the color key when playing back video using an overlay on a palletized display, a display with a color depth less than or equal to 8 bpp.

This is a hexadecimal value ranging from 0 to 2^(color depth) - 1.

The following table shows the AMDDS values for use with the SurfaceTypes named value.

Flag Hexadecimal value Description
AMDDS_NONE 0x00 No support for Device Control Interface (DCI) or DirectDraw.
AMDDS_DCIPS 0x01 Use DCI primary surface.
AMDDS_PS 0x02 Use DirectDraw primary surface.
AMDDS_RGBOVR 0x04 RGB overlay surfaces.
AMDDS_YUVOVR 0x08 YUV overlay surfaces.
AMDDS_RGBOFF 0x10 RGB off-screen surfaces.
AMDDS_YUVOFF 0x20 YUV off-screen surfaces.
AMDDS_RGBFLP 0x40 RGB flipping surfaces.
AMDDS_YUVFLP 0x80 YUV flipping surfaces.
AMDDS_ALL 0xFF Use all available surfaces.
AMDDS_DEFAULT 0xFF Use all available surfaces.
AMDDS_YUV 0xA8 (AMDDS_YUVOFF | AMDDS_YUVOVR | AMDDS_YUVFLP)
AMDDS_RGB 0x58 (AMDDS_RGBOFF | AMDDS_RGBOVR | AMDDS_RGBFLP)
AMDDS_PRIMARY 0x03 (AMDDS_DCIPS | AMDDS_PS)

MPEG Splitter Settings

You can control the number and size of the buffers available on the input pin of the MPEG-1 Stream Splitter Filter with the registry subkey HKEY_LOCAL_MACHINE\Software\Microsoft\Multimedia\DirectShow\MPEG Splitter.

This subkey is used by the upstream asynchronous file source filter during pin negotiation, see File Source (Async) Filter.

The following table shows the named values for this subkey.

Value : type Description
BufferCount : DWORD The default setting is 4.

This value controls the number of buffers used by the MPEG-1 Stream Splitter Filter.

BufferSize : DWORD The default setting is 10000.

This value defines the size, in bytes, of each buffer.

Encoder Quality Settings

You can establish quality levels and associated parameters for image encoding with the registry subkey HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DirectShow\ImageSink\Quality\<Quality Level>\<File Extension>\<Parameter Name>. This subkey is used by the IImageSinkFilter to obtain parameter values that are passed on to the image encoding factory.

The quality level, file extension, and parameter name are all integral to the path of the registry subkey. The following table shows the named values for a parameter. Each of these values corresponds to a member of a StructEncoderParameter structure.

Value : type Description
GUID : REG_BINARY No default setting.

This value is the GUID that identifies the encoding parameter.

NumberOfValues : DWORD No default setting.

The number of parameters values contained in the Value value.

Type : DWORD No default setting.

A value that identifies the parameter's data type.

Value : DWORD No default setting.

The value of the parameter. If NumberOfValues is greater than 1 then this value must be provided a binary data that encodes all of the values.

The following example shows a registry entry that sets one value for the Compression parameter when encoding a JPEG file at quality level 0.

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DirectShow\ImageSink\Quality\0\jpg\Compression]
"GUID"="0xe09d739d-ccd4-44ee-8eba-3fbf8be4fc58"
"Value"=dword:00000003
"Type"=dword:00000004
"NumberOfValues"=dword:00000001

Memory Usage and Performance During Streaming

The following registry entry can be used to control how much memory is allowed for the buffer during streamed playback:

HKEY_CURRENT_USER\Software\Microsoft\Netshow\Player\

This entry gives you a choice between memory usage & performance. For very high bit-rate High Definition video files, you need to allow a very large amount of memory to avoid running out of buffer when a long stream of hard frames arrive.

The registry keys are just multipliers of the pre-roll value set in the file. They should be specified as percentage numbers. So, a number of 300 means a multiplier of 3x. 1 means 0.1X.

Value : type Description
PrerollMinMultiplier: DWORD This is the low watermark. A freeze will be issued if the buffer goes below multiplier * pre-roll value.
PrerollMaxMultiplier: DWORD This is a high watermark, buffering will be limited to the amount specified by pre-roll * multiplier.

Settings for the MPEG-2 Program Stream Multiplexer Filter

The following registry entries can be used to make a recommendation for the number and size of MediaSamples allocated for the connection between the MPEG-2 Program Stream Multiplexer Filter and the DVR Engine Sink filter:

[HKEY_LOCAL_MACHINE\Software\Microsoft\Dvr\DvrPsMux]

Value : type Description
OutputBufferCount: DWORD The number of samples. This should be chosen based on system memory constraints and performance requirements.
OutputBufferSize: DWORD This value is the most important. if you expect to process video streams that are larger than the MPEG-2 video constraints specified in the DVD-Video spec (section 5.4.1.2), then you will want to increase the media sample size to a value greater than the default of 128Kb.

You need to choose a sample size that is big enough to hold a complete I-frame (plus any audio data that may accompany it).

These values are not set by default. If you add them, they will be used to recommend the number and size of media samples allocated for the connection between the MPEG-2 Program Stream Multiplexer Filter and the DVR Engine Sink filter.

Additional Resources for DirectShow Registry Settings

The following list contains topics that provide in-depth discussions about other DirectShow registry Settings:

The following list contains programming elements that can add, delete, enumerate, or represent DirectShow registry settings:

See Also

DirectShow Application Development | DMO Wrapper Filter

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.