Microsoft DirectX 8.0 |
This article answers many frequently asked questions about Microsoft® DirectShow®. It contains the following sections:
What operating systems does DirectShow support?
DirectShow supports Microsoft® Windows® 9x, Microsoft® Microsoft® Windows® 2000, and Microsoft® Windows® Me.
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, how to access the interfaces they expose, and how to properly manage reference counts on those interfaces. Filter developers may require a bit more COM knowledge. For more information, see the topic entitled Programming DirectX with C/C++ under the Introducing DirectX 8.0 node in this help file.
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 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 application.
The previous version of DirectShow was 6.0. It originally shipped with the DirectX Media SDK. When the DirectX Media SDK was deprecated, DirectShow moved to the DirectX SDK, and so DirectShow's version number jumped from 6.0 to 8.0.
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 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?
The primary function of this list is to provide a forum where Developers and content creators using Microsoft's audio and streaming video technologies (DirectSound, DirectMusic, DirectShow) can exchange information and ideas. The list caters for all levels of DirectX expertise, from novice to advanced developer.
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 email to LISTSERV@discuss.microsoft.com with a message body of subscribe directxdev. To subscribe to DirectX A/V, send an email 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, DirectShow does not have its own dedicated book; however, it 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 videoinstead, 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.
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:
How do I know what codec a media file is using?
Do the following:
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. Also, some DirectShow filters act as wrappers for codecs or hardware devices, with each codec or device appearing as a distinct filter. For more information, see Enumerating Devices and Filters.
I'm having trouble building my custom graph by adding and connecting filters programmatically. How can I get help with this?
First try building everything with the Filter Graph Editor (GraphEdit). The tool will allow you to simulate lots of possibilities quickly and correct problems visually. GraphEdit is always a great place to build the graph before attempting to build it with source code.
Additional information: When you do an intelligent connect between the source and the video renderer, you are instructing DirectShow to insert a set of filters between the source and renderer that will do the correct media type conversions. The source filter has one output, which contains audio and video. Therefore, some filter must be added which will split (demultiplex) the audio and video into separate streams. So what you need to do is connect the audio renderer to the audio pin on the demultiplexer. Depending on the source media type, the demultiplexer being used could be one of several filters. For AVI, the AVI splitter will do the job. For MPEG2, it will be the MPEG2 Splitter or MPEG-2 Demultiplexer. If you're using smart connect, you'll have to find the demultiplexer, find its audio pin, and then connect that to the renderer.
If you want the easy way:
This will do the equivalent of "Connect" in cases where you have a renderer for the output type already in the graph, but will add the renderer if you don't have one. So you'd have both the audio and video connected.
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 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 using 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. For more information, see Simulating Graph Building with GraphEdit.
How can I determine the number of pins on a filter?
Call the IBaseFilter::EnumPins method, and then call the IEnumPins::Next method until it returns a value other than S_OK. For more information, 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.