Setting up the Encoder


Encoding is the process of compressing content and converting it to Windows Media Format so it can be streamed over the Internet or an intranet. Windows Media Encoder 9 Series is the tool that provides the compression and conversion function of the streaming media process.

The encoder is included on the CD at the back of this book and is available for download from the Windows Media 9 Series page of the Microsoft Web site. As part of the installation, you will receive all of the Windows Media 9 Series Audio and Video codecs and four utilities, including Windows Media Encoding Script, Windows Media File Editor, Windows Media Profile Editor, and Windows Media Stream Editor. With the exception of Windows Media Encoding Script, these utilities are launched individually from the Start menu. Windows Media Encoding Script is a command-line utility. A brief description of all utilities is provided in chapter 2.

To install the encoder, follow these steps:

  1. Download the encoder from the Windows Media 9 Series page at http://www.microsoft.com/windowsmedia. If you choose to open the installation package, then the Setup Wizard will start automatically. If you choose to download the installation package, then you’ll have to start the setup wizard manually.

  2. Accept the license agreement.

  3. Accept the default installation location or specify a different one.

  4. Click Install.

The encoder is installed with a number of quick-start templates that enable you to start encoding with minimal setup time. Quick-starts are designed for the most common encoding scenarios, such as capturing a live stream for local playback, and are completely configured except for a destination or output file name, and sometimes a source file name. The encoder also includes numerous profiles that are designed to achieve optimal results in all the typical encoding scenarios, such as when encoding for Pocket PC devices or for streaming from a Windows Media server. Profiles offer more flexibility than quick-starts and require more configuration from the user before encoding can begin. You can also customize these profiles to suit your specific needs.

When Windows Media Encoder is fully installed, you’re ready to start encoding.

Configuring an Encoding Session

It’s always a good idea to run some encoding tests on your content to determine the profiles that work best for you given your distribution method, the connection speeds of your audience, and the quality of your audio and video. You might recall from chapter 6 that the Webmaster at the Coho Winery experimented with many of the profiles to determine which ones met her needs for the on-demand winery videos. Encoding and re-encoding from the same source has no effect on the source content, which Coho Winery has safely stored on DVD. But you should always have a backup of your source content in case your encoded version gets damaged or lost. That backup could also be an additional DVD or high-quality archive, such as an uncompressed AVI file.

If you haven’t encoded before or are unfamiliar with the latest encoding profiles, choosing the right profile might be a daunting task. The choice is actually straightforward when you consider the following questions.

What Is the Resolution of the Output Video?

Think of the height and width of the output video as a collection of pixels used to display the image. Pixels are used to indicate both the width and height of an image, and are usually communicated as x y, meaning x pixels wide by y pixels high. For example, the number of pixels used to display a typical computer desktop is 1024 768 pixels.

The larger the image, the more pixels needed to display it, and the more bits needed to encode it. The more bits you use, the more bandwidth you will need to stream the encoded file. You can offset the larger image size somewhat by lowering the quality level of the encoding. But if you’ve gone to the trouble to increase the output size, it doesn’t really make sense to degrade the quality of the image that will be shown at that larger size.

The optimal output resolution really depends on what your content is and how it is being distributed. In many streaming scenarios, such as executive broadcasts or distance learning, 320 240 is a good resolution because it provides an image that is large enough to be viewed easily at a quality level that can be streamed without frame dropping or rebuffering delays, especially at higher connection speeds. Figure 7.2 shows an example of an image that is 320 240 pixels and was encoded with one-pass CBR using a video smoothness setting of 60. Video smoothness ranges from 0 to 100. 0 indicates smoother video and 100 yields clearer images. This image is streaming 29.97 fps at a bit rate of 273 Kbps.

click to expand
Figure 7.2: Streaming a 320 x 240 image at 273 Kbps.

If your users are connecting at dial-up rates, such as 28.8 or 56 Kbps, then consider using a smaller resolution such as 160 120. This is the type of user who would be viewing streaming video from the Coho site. Figure 7.3 shows an example of an image that is 160 120 pixels and was encoded with one-pass CBR using a video smoothness setting of 50. This image is streaming 15 fps at a bit rate of 52 Kbps.

click to expand
Figure 7.3: Streaming a 160 120 image at 52 Kbps.

At what Speeds are Users Connecting to Your Site?

If your users are connecting over a range of connection speeds, you might want to consider encoding a single piece of content at multiple bit rates. A good rule of thumb is to group low and high bit rates into two separate MBR streams. For example, 28.8, 56K, and ISDN connections would be served by one MBR stream, while LAN, DSL, cable, and other broadband connections would be served by a second MBR stream. Grouping the MBR streams in this way requires extra storage space because the file is as large as the aggregate streams. Grouping also enables you to save CPU power during the encoding process because the codecs don’t have to calculate the compression ratios for a large range of connection speeds.

New to Windows Media Encoder 9 Series is the ability to customize the output resolution of each stream in an MBR file. Now, when configuring the encoding session you can specify the resolution that’s ideal for each bit rate in your profile. The higher bit rates would have a larger resolution, such as 320 240, and the lower bit rates would have something smaller, such as 160 120. Customizing the image size in this way enables you to better serve all of your audiences without having to encode content multiple times. MBR encoding is appropriate only when delivering live or on-demand content in a unicast stream.

Because visitors to the Coho Winery Web site have connection speeds ranging from 28.8 to 100 Kbps, all content will be encoded at multiple bit rates. The Webmaster has decided to create one MBR file that includes all narrowband bit rates such as 24, 37, 49, and 57 Kbps. Because the audio will consist primarily of voice-over, all audio will be encoded at voice quality, which is approximately 4 Kbps.

After the content is in place and the Webmaster has had time to review the client usage logs, she will decide whether to encode an additional MBR stream that is made up of higher bit rates to reach those users with broadband access.

Did Your Content Originate on Film or Videotape?

This question determines the kind of filter to apply to your content during the encoding process. Inverse telecine filters can remove extra frames that were inserted when the original content (which was shot on film) was processed for transfer to videotape. The deinterlace filter can blend the even and odd fields of an interlaced frame to create a progressive frame when the source content originated on videotape.

When determining which filter to use for your content, remember these rules of thumb:

  • Any content that was recorded with television or video cameras is interlaced. Interlaced content requires the deinterlace filter in order to blend the odd and even fields and remove editing artifacts so the content can be displayed effectively on a progressive-scan display, such as a computer screen. The Coho Winery content originated on videotape before being put through an editing process. Therefore, the Webmaster will use the deinterlace filter when encoding winery content.

  • Content that was shot on film and then converted to videotape is put through a telecine process in order to boost the number of frames per second from 24 to 30. This is also known as the 3:2 pulldown method. Freshly telecined content has an interlaced, coherent 3:2 pattern. Any video editing that is performed after the film has been telecined can break the coherent 3:2 pattern. These pattern breaks are called incoherencies. When content that was shot on film is converted to video and subsequently edited, you should use the inverse telecine filter to repair the incoherencies that were introduced during the editing process.

  • Content that was shot on videotape and is intended for playback on interlaced devices, such as televisions, should retain its interlacing during the encoding process. This is not done by default. Rather, you must specify that you want to retain the interlaced format when setting up your encoding session and make sure you use the Windows Media Video 9 codec. If your source video is mixed (progressive and interlaced) and you choose to retain interlacing, the output video will also be mixed.

Should You Use VBR or CBR Encoding?

If your content is to be streamed, use CBR encoding. CBR encoding enables you to accurately estimate the size of the encoded video and set the bit rate at which the content will be encoded. This bit rate remains constant throughout the entire clip. In order to maintain the constant bit rate, the quality of the clip will fluctuate depending on the complexity of the material being encoded. For example, if you have encoded a clip that includes high motion and static images, the images might be clear while the motion appears blurred. This is because more bits are needed to encode the motion than are available at the specified bit rate.

The Coho Winery content consists of crowd scenes, landscape shots, and workers involved in the wine-making process. It contains relatively low motion and will be streamed from a Windows Media server. For these reasons, and because the winery is sourcing from DVD, most content could be encoded using one-pass CBR. But there is a second alternative. The winery can capture the content and, using a capture card utility, save it as an uncompressed AVI file first. Then, using the AVI file as the source, the Winery Webmaster could convert the content to WMV by using two-pass CBR.

You might recall that the Webmaster experimented with encoding AVI files in the previous chapter. She also experimented with encoding directly from DVD to Windows Media Format. After capturing to AVI, she used two-pass CBR encoding. When encoding directly to WMV, she used one-pass CBR. She found that capturing to AVI first and then using two-pass CBR resulted in better quality video. This better quality can be achieved with two-pass CBR because the encoder reads through the content first in order to collect data about its complexity, and then allocates bits more precisely during the second pass based on the information gathered. Liking this quality difference, the Webmaster decided that all winery content would be captured to AVI first and then encoded into the Windows Media Format using two-pass CBR.

But VBR encoding is compelling as well. The winery can foresee creating promotional CDs or DVDs containing higher-quality video content, screen savers, and demo tracks from artists participating in the Art Series events. VBR encoding is perfectly suited to this kind of content that is delivered on physical media.

In VBR encoding, the bit rate fluctuates to match the complexity of the content being encoded. For example, an automobile race would be encoded at a higher bit rate than a reporter delivering a newscast. When content is encoded for CD or DVD delivery, you can use a special VBR mode that constrains the amount of variation in the bit rate according to the reading speed of the playback device. In this mode, called peak bit-rate-based VBR, the encoder reads through the content twice to determine the image quality that can be achieved without exceeding the peak bit rate. While the bit rate does fluctuate during encoding, it does not exceed the specified peak bit rate. This is the mode the winery will use to encode content for the promotional CDs. This is also the mode that you should use if you must stream VBR content because you allow for some bit rate fluctuation in order to improve quality but set a limit on how much fluctuation can occur. See chapter 2 for more information about the CBR and VBR encoding modes.

Should You Encode Using Push or Pull?

This question is relevant when you are broadcasting a live stream from an encoder. When setting up the encoder for a live stream, you have the option to either push the stream from the encoder to the server or use the server to pull the stream from the encoder. Pushing a stream from the encoder is useful if the encoder is behind a firewall or if you want to initiate the connection from the encoder to a remote server.

Some companies don’t allow connections across a firewall to be initiated externally. In these instances, it is useful to have the encoder initiate the connection from inside the firewall and push data out to the Windows Media server.

Here are some scenarios where pulling is best:

  • When there are multiple distribution servers, all connecting at different times. Each server can initiate the connection with the encoder when the server is ready to stream.

  • When it is important to minimize bandwidth usage between the server and the encoder. For example, you can configure your publishing point to start automatically upon client request, which means that the server does not initiate the connection with the encoder until the first client connects.

  • When the server is behind a firewall.

The push and pull options are only available for live broadcasts. Since the Coho Winery content is on-demand only, they will encode to file, and then use the file as a source when creating a publishing point on the server.

Using the New Session Wizard

Once you’ve considered all of the questions above, you are ready to run the New Session Wizard to configure your encoding session. Four wizards are available, depending on whether you’re broadcasting live, capturing content from a device, converting content to Windows Media Format, or capturing screen images. Figure 7.4 shows the opening screen where you choose your session configuration option.

click to expand
Figure 7.4: The New Session Wizards.

You can also create a custom session, which allows you to set all of the encoding properties without the assistance of a wizard.

The Coho Winery Webmaster chooses the Convert a file option and proceeds through the wizard. The first step is to choose the input and output file options, as shown in figure 7.5.

click to expand
Figure 7.5: Choose your input and output files.

The next step is to choose the method of distribution for the encoded content. The method you choose determines the settings that are available to you. For example, choosing Windows Media hardware profiles would enable you to use peak-constrained VBR, but Pocket PC would not. In figure 7.6, the Coho Webmaster chooses Windows Media server because she intends to stream the content over the Internet to desktop computers.

click to expand
Figure 7.6: Choose the method to use for distributing your content.

Once the file names and distribution method have been determined, it’s time to select the compression settings. Coho Winery, you’ll recall, is encoding an MBR stream for narrowband users. The Webmaster will choose the bit rates for the MBR stream from the dialog box shown in figure 7.7.

click to expand
Figure 7.7: Choose the audio and video profiles and bit rates for your content.

The final step in the configuration is to enter metadata about the content. This metadata is optional, but can include title, author, copyright, rating, and description. The Coho Winery Webmaster provides the information shown in figure 7.8. Figure 7.9 shows Windows Media Encoder after session configuration is complete.

click to expand
Figure 7.8: Entering display information is optional.

click to expand
Figure 7.9: Encoder control panel.




Microsoft Windows Media Resource Kit
Microsoft Windows Media Resource Kit (Pro-Resource Kit)
ISBN: 0735618070
EAN: 2147483647
Year: 2005
Pages: 258

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