Windows Media SDK and Encoding Tools

Windows Media SDK and Encoding Tools

Thus far in this book, we ve been able to compile and build all our examples using only Microsoft Visual Studio .NET and version 9 of the DirectX SDK. In this final chapter, you ll have to download and install two more packages from Microsoft s Web site: the Windows Media Format SDK and the Windows Media Encoder, a tool that provides a GUI for conversion of existing media files into Windows Media. (Both of these can be found at http://www.microsoft.com/windows/windowsmedia/download.) We need the Windows Media Encoder application only for the convenient Profile Editor tool that comes with it. For our application development, only the Windows Media Format SDK is actually required because it contains both the Windows Media 9 Series codecs and the latest versions of the DirectShow WM ASF Reader and WM ASF Writer.

Although we could integrate complete profile editing capabilities into our application using the Windows Media Format SDK, for our purposes it is much more convenient to use the one provided by Microsoft. Once you install both the Windows Media SDK and Windows Media Encoder, launch the Windows Media Profile Editor. Load an existing profile (these should be installed along with the Encoder), and you should see something like that shown in Figure 15-1.

figure 15-1 the windows media profile editor, which allows you to examine and edit all the settings in a profile

Figure 15-1. The Windows Media Profile Editor, which allows you to examine and edit all the settings in a profile

The profile loaded in the figure (with the filename d0_vbr_hd.prx) defines a high-definition, high-quality video stream with variable bit-rate encoding. To view the specifics of the encoding, click on the tab that displays the bit-rate value, as shown in Figure 15-2.

figure 15-2 the tab where specific encoding preferences are set

Figure 15-2. The tab where specific encoding preferences are set

You can see that a 5009-Kbps video stream is configured for 1280 720, HD dimensions, with a frame rate of 29.97 fps, which is standard for broadcast television. This is definitely adequate for playback of a video it exceeds the standards for DVD video but no audio channel is defined. To define an audio channel, select the General tab again, select the Audio check box, and select a mode and codec for the audio stream, as shown in Figure 15-3.

figure 15-3 adding an audio stream to the profile

Figure 15-3. Adding an audio stream to the profile

Note that once the basic features of the stream have been established, the bit rate of the combined stream changes and the name of the bit-rate tab changes to match. The bit-rate tab allows you to fine-tune the format of the audio stream. You can select a bit rate from 320 Kbps (for better-than-CD quality) down to 5 Kbps, which would sound like a very bad mobile phone call! Once you select the encoding particulars for the audio stream, you can write this profile back to disk by selecting the General tab and clicking Save And Close. If you want to save these settings as a new profile, you can select Export.

A single profile can define encoding that delivers multiple streams. This might be useful, for example, if a single file (such as a news clip) is aimed at a variety of users who are connected over modems, mobile links, ISDN, and high-speed broadband links. When you load a multiple bit-rate profile (d2_cbr_film.prx) into the Profile Editor, you get a tab for each bit rate in the stream, as shown in Figure 15-4.

figure 15-4 defining multiple streams and multiple bit rates in a single profile to target streaming content to a variety of connections and devices

Figure 15-4. Defining multiple streams and multiple bit rates in a single profile to target streaming content to a variety of connections and devices

Once again, you can modify the characteristics of any bit rate in the profile, or you can add new bit rates to the profile by clicking the Add button on the General tab. When you click the Add button, a dialog box will ask you for the target bit rate. You can give any value you like, all the way from 1 bps to 100 Gbps although neither extreme is likely to work well! If you specify a bit rate that is too low relative to other variables, such as video rectangle size and key frame interval, the end result might be less than satisfactory, assuming the Windows Media Format SDK even accepts the profile as valid and tries to compress a file based on it. Creating profiles is an art, and you ll probably spend some time tweaking yours until they yield the best results.



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