Using Windows Media for File Storage

Using Windows Media for File Storage

For a final example using GraphEdit, we ll adopt a more streamlined approach to file storage. Although the high resolution of AVI files is attractive, AVI files quickly fill up an entire disk with video data. Windows Media is an alternative solution for video storage; it s as much as several hundred times more efficient for the storage of A/V streams in disk files.

To convert your existing AVI-creating filter graph into one that creates Windows Media files, remove the AVI Mux and File Writer filters from the filter graph. Now you need to add a renderer filter that will create a Windows Media Advanced Streaming Format (ASF) stream. You ll find the WM ASF Writer in the list of DirectShow filters. When you insert the filter, it will ask you to select an output file name. Use the name DVCAM.ASF for the output file. Now connect AudOut00 from the DV Splitter to the Audio Input 01 pin of the WM ASF Writer filter, and connect the Capture pin of the Smart Tee to the Video Input 01 pin of the WM ASF Writer. Intelligent Connect will automatically add a DV Video Decoder as an intermediate step between the Smart Tee and the WM ASF Writer. You should get a filter graph that looks like Figure 2-18.

When you click Play, the monitor window will once again show the live feed from the camcorder. After you click Stop, look for the file DVCAM.ASF. It should be much smaller. For example, a 10-second AVI file comes in at around 40 MB. A 10-second ASF file should be about 250 KB. These ASF files can be played in the Windows Media Player, or you can use the Render Media File capability inside GraphEdit.

figure 2-18 dv capture filter graph that produces smaller asf files

Figure 2-18. DV capture filter graph that produces smaller ASF files

Setting Filter Properties

The WM ASF Writer offers a wide range of options for the degree of file compression in its output files. These options are accessible to the DirectShow programmer through COM, but they re also available to the GraphEdit user. Right-click the WM ASF Writer and select Filter Properties. You ll see the properties dialog box shown in Figure 2-19.

figure 2-19 the filter properties dialog box for the wm asf writer renderer filter

Figure 2-19. The filter properties dialog box for the WM ASF Writer renderer filter

In the Profile drop-down list, you can select from a broad array of compression techniques. The WM ASF Writer filter will create a 256-Kbps stream by default, but streams from 28.8 Kbps (suitable for modem users) all the way up to 1500 Kbps (for use on LANs) can be created. The greater the bandwidth, the better the image quality and the larger the files.

Most DirectShow filters have properties that can be examined from GraphEdit, and each pin on a filter has its own pin properties, also accessible through a right-click of the mouse. The pin properties are interesting to look at because you can see which media types an output pin can transmit and which media types an input pin can receive. It s an easy way to determine whether two filters are compatible. You can also examine the pin properties of connected pins, which will show you the actual media type of a pin-to-pin connection.



Programming Microsoft DirectShow for Digital Video and Television
Programming Microsoft DirectShow for Digital Video and Television (Pro-Developer)
ISBN: 0735618216
EAN: 2147483647
Year: 2002
Pages: 108
Authors: Mark D. Pesce

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net