Chapter 15: Windows Media Applications

Chapter 15

Windows Media Applications

Throughout this book, whenever we ve wanted to reduce the size of an audio or video file, we ve used the Microsoft Windows Media Audio and Video codecs through the WM ASF Writer. The reason is obvious: Windows Media provides state-of-the-art compression quality, and the format is supported by Windows Media Player, which ships with every PC. (Windows Media Player is also available for the Macintosh operating system, and Microsoft is trying to ensure that all major computing platforms support Windows Media playback.)

Just before this book went to press, Microsoft introduced Windows Media 9 Series (code-named Corona ), which sets a new industry standard for audio and video compression. The core of Windows Media 9 Series is a new suite of codecs, including the WMA Pro codec for cinema-quality compression, the Image Codec for pan-and-scan imagery ( la Ken Burns s documentaries), and codecs that deliver improved performance on low bit-rate audio and video streams. Windows Media 9 Series allows you to encode high-quality audio or video samples at very low bit rates (comparatively) with little loss in quality. It thus opens up a whole new level of applications. For example, using Windows Media 9 Series encoding, a single DVD can contain a whole feature-length movie in high-definition (1280 768) resolution something that s impossible with standard MPEG-2-encoded DVDs.

How good is the compression in Windows Media 9 Series? It can be as much as 30 percent better than MPEG-4, which is considered the benchmark standard for compression techniques. This means we re likely to see Windows Media encoded files become ubiquitous on computers and on the Internet. Many CD and MP3 players already support Windows Media formats for audio compression. (For full stats, check out the details on the Microsoft Windows Media Web site at http://www.microsoft.com/windows/windowsmedia/9series/nextwave/quality.aspx.) With the release of Windows Media 9 Series, Microsoft announced new licensing terms that effectively allow third parties to use certain components of Windows Media Technologies independently of other components. Most significantly, the new terms allow third parties to place audio or video encoded with Windows Media codecs into any file container. This means the ASF file format and the Windows Media codecs are independent of each other, and you can program directly to the codec Microsoft DirectX Media Objects (DMOs) without going through the Windows Media Format SDK. (See Windows Media Audio and Video Codec Interfaces on MSDN for more information.)

DirectShow supports Windows Media 9 Series through two filters, the WM ASF Reader and the WM ASF Writer. You don t need to know much about Windows Media and its API to play back a Windows Media encoded file within a DirectShow application; you can use a Filter Graph Manager to do the work. Just call the IGraphBuilder method RenderFile, and let it build the filter graph for you. If you add the Video Mixing Renderer (VMR) filter to the graph, it will be used as the renderer, opening up further possibilities for on-the-fly processing at playback time.

WM ASF Reader vs. Windows Media Source Filter

ASF, Windows Media Video, and Windows Media Audio go back a few years. Before the Windows Media Format SDK was released, DirectShow support for Windows Media playback was provided through the Windows Media Source Filter. This filter is used by Windows Media Player 6.4, which still ships with Windows and is widely used on Web pages around the world. To not break existing applications, the Windows Media Source Filter was maintained as the default source filter in both DirectX 8 and DirectX 9. In other words, if you called RenderFile with myVideo.wmv, the Filter Graph Manager used that filter as the source filter. If you wanted to use the newer WM ASF Reader, you had to add it explicitly to the graph. This situation was not ideal; with Windows Media Format 9 Series SDK, the developers made the WM ASF Reader the default filter for ASF files, without breaking existing applications. This means that with Windows Media 9 Series runtimes installed, if your application calls RenderFile with myVideo.wmv, the WM ASF Reader is used, but if Windows Media Player 6.4 is hosting the filter graph, the Windows Media Source filter is used.

Using the WM ASF Writer to create ASF files containing Windows Media based content is only a bit more complex because of certain options available to you before you encode a file. We ve used the WM ASF Writer previously in this book, but we ve used only its default settings for the sake of simplicity; in the process, we ve glossed over some of the more sophisticated features of Windows Media. This chapter covers all the techniques you ll need to master to create a full range of Windows Media files from within Microsoft DirectShow applications. Now that you ve mastered the secrets of audio and video capture using DirectShow, Windows Media 9 Series can provide an extremely high-quality and efficient output, storage, and distribution format for your work.



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