Best Practices for Encoding


Encoding is a complex task, involving tradeoffs between delivery bit rate, frames per second, buffer size, video quality, and other factors. The encoder includes many predefined destination, video, and audio settings (profiles) that have already taken this balance into consideration. You can easily encode content using a predefined profile. However, if you want to customize the settings, use the following information to decide which changes will provide the best results in your scenario.

  • Use a frame size that can be streamed efficiently and played back over common Internet bandwidths. Lowering the screen resolution decreases the amount of data to capture. A resolution of 320 x 240 pixels is adequate for streaming over the Internet.

  • Use a frame rate that is appropriate for the content. For example, if you are encoding screens, use a low frame rate, such as 5 fps. On the other hand, when sourcing from high-motion content, use 30 fps. There is often a tradeoff between image quality and frame rate.

    Ideally, you would increase the frame rate to keep pace with the image quality. But as you increase the resolution and frame rate, you also increase the demands on your encoding computer. If your computer can’t meet those demands it will start to drop frames. In that case, you should decide which setting is more important, and adjust the other accordingly. For example, if maintaining the frame rate is more important, then decrease the image quality setting.

  • Adjust image quality, depending on the content. You can adjust the image quality to be smoother or more clear. Increasing the clarity can affect the frame rate, depending on the video. For example, if your video contains a lot of motion, increasing the clarity may decrease the frame rate. In addition, increasing the clarity results in a higher bit rate requirement and may also necessitate increasing the buffer size.

  • Use a larger buffer in order to avoid intermittent buffering delays. The bit rate and quality of content will fluctuate within the confines of the buffer size. Using a larger buffer allows the codec more content over which to normalize the quality level. This can result in better quality, but the user must wait longer for the video to start, as a player waits to play until its buffer is filled.

    Typically, the buffer delay matches the time, in seconds, of the buffer size set in the encoder. However, if you plan to stream from a Windows Media server, you can set a larger buffer size in the encoder. A feature in Windows Media Services, called Fast Start, enables a player to fill its buffer faster than real time, assuming there is sufficient bandwidth. This means that the initial buffer delay may be much shorter. For example, when a user attempts to play back 56-Kbps encoded content on a DSL or cable modem, the start-up delay may be only a second or two, even if the buffer size set during encoding was much longer.

  • Increase the distance between key frames. A key frame (also known as an I-frame) is an element in a video file that contains all of the data needed to display a single frame of video. The intermittent frames that occur between key frames only include data for changes, or deltas, from the previous key frame.

    For low-motion content, such as a speaker at a podium, a setting of 20 seconds is typically appropriate because very little is changing within the scene. For higher-bit-rate content, such as a sporting event where the entire frame changes very quickly, you should lower the key frame distance so key frames are generated more frequently. The encoder will generate a key frame automatically before the time interval specified if there is enough change within the scene to warrant it.

  • Use a high bit rate. A higher bit rate achieves better image quality. If the bit rate setting is too low, the codec will drop frames to produce a higher-quality image, although this may not be visible to the viewer. (Note that if you are encoding low-motion video, the actual bit rate may be significantly lower than the expected bit rate.)

  • Use the appropriate codec. For example, when your audio source is voice or primarily voice, use the Windows Media Audio 9 Voice codec. For a screen capture session, use the Windows Media Video 9 Screen codec.

  • Use two-pass encoding when possible. You will typically achieve higher quality with two-pass encoding, because the encoder has the opportunity to analyze the content during the first pass. Two-pass encoding is a function of the codec and is used in conjunction with CBR and VBR encoding modes.

  • When encoding high-bit-rate on-demand content, capture to an uncompressed AVI file first. Capturing an uncompressed frame is much less CPU intensive, and you can use a two-pass VBR encoding mode (bit rate-based or peak bit rate-based) to achieve higher quality. When encoding content into an uncompressed file, you need plenty of available hard drive space to accommodate the large file size.

  • Only use the deinterlace and inverse telecine filters when necessary. Deinterlacing content or removing extra frames with the inverse telecine filter consumes CPU resources and can cause quality degradation when used inappropriately, such as applying the inverse telecine filter to content that was not previously telecined.

  • Consider the Player versions that your users will use to view your content. Content encoded with the Windows Media 9 Series codecs (except for the Windows Media Audio 9 codec) is not supported in Windows Media Player version 6.4. Content encoded with the Windows Media Audio 9 codec may have glitches or silence during playback in Windows Media Player version 6.4.




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