[an error occurred while processing this directive]

An advanced user's tool: GRAPH EDIT

Today's Windows' multimedia architecture is based on DirectShow, which works basically as a collections of filters with input(s) and/or output(s) for data. Every multimedia component is represented by a DirectShow filter. This includes audio/video compressors/de-compressors, but also the input/output of your soundcard, along with many others. By connecting filters together, you create data paths for multimedia data, eventually resulting in an action (for example a video compression conversion).

Microsoft's DirectShow SDK (Software Development Kit) comes with a great application called Graph Edit, which allows you to graphically build filter graphs, thus manipulate directly every multimedia component of your system!

  1. Using GraphEdit
  2. Filter manipulation
  3. Full graph-creation example
  4. Possibilities of GraphEdit
  5. Description of some DirectShow filters
  6. The Dolby Digital downmixing

1. Using GraphEdit

When you open GraphEdit, you find yourself in front of an empty workspace. You should start by adding the filters you wish to use, using the Graph -> Insert Filters menu.

   

This opens a filter-selection dialog, where you can choose filters from. Filters are separated into many categories.

   

The following tables describes the most commonly used categories :

 
Filter category Description
Audio Capture sources All your audio inputs (like your soundcard's AUDIO IN)
Audio Compressors
 
Audio compressors like MP3 or PCM (uncompressed)
Audio Renderers Your soundcard's WaveOut and DirectSound outputs
DirectShow Filters This contains all filters that do not fall into specific categories. Most filters are found here.
Midi Renderers All your midi equipment, like WaveTable outputs and software synthesisers.
Video Capture Sources Your video capture card's input (if DS compatible)
Video Compressors Video compressors like DivX and Indeo.
 

When expand one category and double-click on a filter, it creates a box in the workspace, which represents the selected filter.

2. Filter manipulation

To create a data path, you have to interconnect filters. This is done by linking an output pin to an input pin with the mouse. Note that you can only interconnect pins of the same type (you will get an error message otherwise). Sometime, GraphEdit will automatically add intermediate filters when you try to connect pins of incompatible types. That is, it will search for possible intermediate filters that will make the pins compatible. If you do not want this behaviour, you can de-activate it in the Graph -> Connect Intelligent menu.

Filter can be delete by selecting them (normal single-click) and pressing the delete key. Some filters/pins have properties that can be modified. This can be done by right-clicking on the filer/pin and choosing 'properties'.

Also, part of the graph can be generated automatically downstream, by right-clicking an output pin and choosing 'render'. This will place all necessary filters to completely render the pin according to default behaviour (which is usually "playback"). When the graph is done, it can be run by pressing the "play" button in the application's button bar.

3. Full graph-creation example

In this example, we will crate a filtergraph to make an AVI conversion. First, we decide what exactly we want the graph to do:

 

Start by placing a DirectShow Filters -> File Source (Async.) and select the input MPEG file (Loto-quebec MPEG.mpg). Parse the stream using a DirectShow Filters -> MPEG-I Stream Splitter.
Then place a DirectShow Filters -> MPEG Video Decoder in the video data path.

   

Next, bring two DirectShow Filters -> Infinite Pin Tee Filter. Connect one of them with the audio output of the stream splitter and the other with the output of the video decoder. These are used to duplicate the data. Place also a Video Compressors -> Divx ;-) MPEG-4 Low-Motion in the video data path.

Then, use a DirectShow Filters -> AVI Mux to connect the Divx output and MPG audio data. Connect the AVI Mux's output to a DirectShow Filters -> File Writer. Provide with a filename when prompted to (Loto-quebec DivX.avi).

To decode the MPG audio and save it to disk, start by connecting the output 2 of the audio path's tee filter to a DirectShow Filters -> MPEG Audio Decoder. Finish the path with a DirectShow -> WAV Dest followed by a DirectShow Filters -> File Writer. Enter the wave file's name when prompted (loto-quebec Audio.wav).

Note: If you do not have the "WAV Dest" filter, you can find it in the download section.

Finally, to monitor the video-only progress (watch video in real-time as it gets converted), connect the video path's tee filter to a DirectShow -> Video Renderer.

Now that the graph is completed, all you have to do is to press the PLAY button to start the process.

You can download the sample materials:

  Captured with PowerDVD     Captured with PowerDVD  
  Loto-quebec MPEG   Loto-quebec Audio   Loto-quebec DivX  

4. Possibilities of GraphEdit

This example should have given you an good idea of all what you can do with GraphEdit. Possibilities are only limited by your imagination … It filtergraphs interest you, I encourage you to "play around" with them to familiarise yourself.

It is also possible to add new filters to your existing filter collection. Filters are files with AX extension (sometimes DLL extension). To "register" a new filter, you must use a command-line utility called RegSvr32, that you can find in your windows\system directory (\\Windows\system under Windows 98 or \\WINNT\system32 under Windows NT/ 2000).

5. Description of some DirectShow filters

This table provides a descriptions for DirectShow for which the title is not fully self-explanatory.

 
DirectShow Filter Description
Color Space Converter Automatically performs color space conversion (auto-detects color space type)
Infinite Pin Tee Filter
 
Duplicates its input as many times as you want
Line 21 Decoder Decodes the 21st line of a NTSC frames(a line that contains non-video information)
Null Renderer A do-nothing, pass-through filter
Overlay Mixer Overlays video data on the display
WAV Dest Convert an audio stream data type to allow file writing on disk
 

6. The Dolby Digital downmixing

We have added an extra example to show how to downmix Dolby Digital AC-3 to Dolby Surround. This is done simply with the iviaudio.ax (Intervideo filter provided with WinDVD).

The filtering is as simple as Open the AC-3 file and Parse, then Downmix with InterVideo Audio Decoder for a WAV format and Save it:

Configure the InterVideo filter for downmixing:

   

 


[an error occurred while processing this directive]
[an error occurred while processing this directive]