Microsoft DirectX 8.1 (C++)

DirectShow FAQ

This article answers many frequently asked questions about Microsoft® DirectShow®. It contains the following sections:

General Questions

What operating systems does DirectShow support?

DirectShow supports Microsoft® Windows® 9x, Microsoft® Windows® 2000, Microsoft® Windows® Me, and Microsoft® Windows® XP Home Edition and Windows XP Professional.

How much COM knowledge do I need to program with DirectShow?

For application development, you need to understand the basics of working with COM objects: how to instantiate them, access the interfaces they expose, and manage reference counts on those interfaces. Filter developers may require a bit more COM knowledge.

What formats does DirectShow support?

See Supported Formats in DirectShow.

Is there a DirectShow Hardware Compatibility List (HCL)?

No. DirectShow uses Microsoft® DirectDraw® and Microsoft® DirectSound® hardware capabilities if they are available. When no special hardware is available, DirectShow uses GDI to draw video and the waveOut* multimedia APIs to play audio.

What languages can I use to write a DirectShow application?

DirectShow is designed primarily for C++ development. (You can also use C.) With Microsoft® Visual Basic®, you can access a large subset of the DirectShow API, but support for Visual Basic is not complete. DirectShow supports script-based DVD applications, using Microsoft® JScript® or Visual Basic Scripting Edition. It is also possible to write DirectShow applications using Borland Delphi; however, the SDK documentation does not address this topic.

For more information, see the following topics:

What compiler do I need for DirectShow development?

Any compiler capable of generating Component Object Model (COM) objects should work once the compiler's environment has been configured correctly. If you use a compiler other than Microsoft® Visual C++®, you might need to rebuild the base class libraries, because of differences between compilers.

How does DirectShow relate to Microsoft® Windows Media™?

See Windows Media Applications.

How does DirectShow relate to the other components in Microsoft® DirectX®?

Internally, DirectShow uses DirectSound and DirectDraw when the hardware supports it. The Video Renderer and Overlay Mixer filters use DirectDraw 3 and DirectDraw 5 surfaces. The Video Mixing Renderer (Windows XP Home Edition and XP Professional only) uses DirectDraw 7 surfaces. It does not use the new Microsoft® Direct3D® APIs. You do not need to use the other DirectX APIs to write a DirectShow application, although it is possible to combine them. For an example, see the Texture3D Sample.

How does DirectShow relate to Microsoft® ActiveMovie®?

ActiveMovie was the original name for DirectShow. The term ActiveMovie is no longer used.

Is DirectShow limited to multimedia applications?

The default components included with DirectShow are designed for multimedia. However, the DirectShow architecture is useful for other kinds of data-streaming solutions.

Is the source code to the GraphEdit utility available? Can GraphEdit be redistributed?

No, the source is not available, and Graphedt.exe is not redistributable.

Do DMOs replace DirectShow filters?

Microsoft® DirectX® Media Objects (DMOs) can be used in a DirectShow application. For encoders, decoders, and effects, you are encouraged to write a DMO instead of a DirectShow filter. For other purposes, a DirectShow filter might be more appropriate. For more information, see DirectX Media Objects.

Where can I get more information about DirectShow?

While it is expected that various members of the Microsoft DirectX development team will review and possibly comment on list topics, DirectXAV is not intended as a Microsoft support forum and there is no guarantee that Microsoft personnel will respond directly to inquiries. Often, your best source of help will be other members of the DirectXAV community who have faced similar issues themselves in the past.

Topics that are appropriate to this list include: compositional techniques using DirectMusic Producer; audio, music or streaming video programming techniques; sound design techniques; general issues or information about the relevant APIs; code snippets; suggestions; hints and tips; device driver quality; future feature requests; real-life experiences using the APIs, etc.

To subscribe to DirectX DEV, send an e-mail to LISTSERV@discuss.microsoft.com with a message body of subscribe directxdev. To subscribe to DirectX A/V, send an e-mail to LISTSERV@discuss.microsoft.com with a message body of subscribe directxav.

I'm facing a difficult problem in developing my application/filter. Where can I get developer support?

You should contact DirectX SDK support for specific developer support issues:

Is there a good book that explains DirectShow?

Currently, there is no book devoted entirely to DirectShow. However, DirectShow is discussed briefly in some existing DirectX books, including:

Although DirectShow is mentioned in these books, the best source of information is the DirectShow documentation set and sample code provided with the DirectX SDK.

How do I contact Microsoft with feedback and bug reports?

The address for general DirectX issues is directx@microsoft.com. Send bug reports to dxbugs@microsoft.com.

I have some ideas on how Microsoft could improve DirectShow.

Microsoft welcomes suggestions, questions, and comments. Let us know what you think. What are we missing? What areas would you most like to see improved? What types of tutorials and samples would you most like to see? Your input will help us to prioritize future work. If you have questions or suggestions pertaining to the new DirectShow documentation, please send a message to askdshow@microsoft.com.

I'm playing an AVI format file with Windows Media Player. I can hear the audio, but there doesn't seem to be any video—instead, I just see black. What's wrong?

Probably the file was encoded with a codec that is not present on your system. Although the AVI file format is common, AVI files can be created with many different codecs (coder/decoder). If you try to play an AVI file that uses an unsupported codec, you might hear the audio component, but the video will display as a black screen or the screen contents will remain unchanged.

Note   The Windows Media Player often attempts to download and install a codec if it is not present on your system.

Some common codecs included in Windows 2000 are Radius Cinepak, Duck TrueMotion, Intel Indeo, Microsoft RLE, and Microsoft Video 1. To view the list of video codecs on your system in Windows 2000, do the following:

  1. Open Control Panel.
  2. Click Sounds and Multimedia.
  3. Click the Hardware tab.
  4. Select Video Codecs.
  5. Click Properties.
  6. Click the Properties tab.

How do I know what codec a media file is using?

Do the following:

Programming Questions

How do I build my application? What libraries and header files do I need?

See Setting Up the Build Environment.

GraphEdit displays a lot of filters that aren't documented. What are these filters?

GraphEdit enumerates all of the filters that are registered on your system in a filter category. This might include filters installed by third-party applications, or installed by other Microsoft technologies, such as Windows Media or NetMeeting. Also, some DirectShow filters act as wrappers for codecs or hardware devices, with each codec or device appearing as a distinct filter. The Microsoft H.263 Video Codec is used by NetMeeting and is no longer supported in DirectShow. For more information, see Enumerating Devices and Filters.

I'm having trouble building my custom graph programmatically.

First try building the filter graph with GraphEdit. This tool enables you to simulate lots of possibilities quickly. GraphEdit is always a great place to test out the graph before attempting to build it with source code.

For more information about graph building, see the following articles:

How can I detect whether DirectShow is installed on a given machine?

Call CoCreateInstance to create an instance of the Filter Graph Manager. If this call succeeds, DirectShow is installed on the machine. The following code shows how to do this:

IGraphBuilder *pGraph;

HRESULT hr = CoCreateInstance(CLSID_FilterGraph,
    NULL, CLSCTX_INPROC_SERVER,
    IID_IGraphBuilder, (void **) &pGraph);

How do I change a filter's settings without displaying the property page?

Most filters expose one or more interfaces for setting properties on the filter. Consult the reference page for the filter in question. (See DirectShow Filters.)

Why can't I use the ASF Writer and ASF Reader filters?

You must provide a software certificate when you build your application. For more information, see Creating ASF Files in DirectShow and the Windows Media Format SDK. Also, you cannot use these filters in GraphEdit.

Can DirectShow notify an application of its current playback position on a regular basis?

There is no callback notification of position. Use a timer and retrieve the current position by calling the IMediaSeeking::GetCurrentPosition method.

I wrote a filter. How do I install it?

See How to Register DirectShow Filters.

Can I test my filter with GraphEdit?

While you are developing a filter, GraphEdit can help you to visualize the connections between filters. It can also provide a quick test of a filter's functionality. However, it is not meant as a robust test platform.

How can I determine the number of pins on a filter?

See Enumerating Objects in a Filter Graph.

At what privilege ring do filters run?

Filters run at ring 3, although some filters control streaming devices that run at ring 0. For more information, see How Hardware Devices Participate in the Filter Graph.