Share via


Encoding with CBR, MBR, and VBR

Windows Media Encoder SDK banner art

You can encode your content at a constant bit rate with one or more bit rate streams, or at a variable bit rate.

Constant Bit Rate (CBR) Encoding

CBR encoding is good for streaming content or when you need to control the final file and buffer size of the content. The advantage of CBR encoding is that the bit rate and size of the content are known before encoding, so you can predict the final size and bandwidth requirements of the encoded content. However, for content that varies in complexity, the encoding quality is not constant. Results can also be inconsistent from one stream to the next. In general, quality variations are more pronounced at lower bit rates.

With CBR encoding, you specify the average bit rate that you want to maintain and then set the size of the buffer. The bit rate will fluctuate across the stream; however, the fluctuations are constrained by the buffer size. The content quality also fluctuates to ensure that the buffer does not overflow or underflow. (If you want to guarantee the quality of the encoded output, use quality based VBR encoding.) The size of the buffer determines the amount of initial delay when the content is played, but using CBR encoding ensures that the content is streamed smoothly, assuming that the bit rate is compatible with the client connection speed. If possible, use two-pass CBR encoding to reach a higher quality without losing the advantages of CBR encoding. Two-pass encoding is not supported in all scenarios.

Multiple Bit Rate (MBR) Encoding

If you are streaming your content from a server running Microsoft Windows Media Services, you can include multiple bit rates in the stream and deliver it as a unicast. An MBR stream provides users with better-quality content during times of network congestion. The Windows Media server and player determine which stream suits the current network bandwidth conditions, and that stream is sent to the user.

When you set up an MBR stream, you specify the bit rates to include. If you use audio and video sources, it is not necessary to use MBR encoding for both; for example, you can stream audio at one bit rate but include multiple bit rates for video.

The more bit rates you select, the larger the aggregate bandwidth for live stream distribution from the encoding session to a Windows Media server is required. To estimate the aggregate bandwidth of an MBR profile, calculate the sum of each source bit rate. Also keep in mind that encoding an MBR stream uses more processing power for the encoding computer.

Variable Bit Rate (VBR) Encoding

VBR encoding is good for content that is downloaded and played either locally or on a device that has a constrained reading speed, such as a CD or DVD player. Peak VBR encoding is also good for streaming. The advantage of VBR encoding is that it compensates for changes in the complexity of the content (such as switching between slow and fast motion).

You can use the following VBR modes:

  • Quality based VBR (WMENC_PVM_UNCONSTRAINED). You specify a desired quality level (from 0 to 100), then during encoding, the bit rate fluctuates according to the complexity of the stream. A higher bit rate is used for intense detail or high motion, and a lower bit rate is used for simple content. The advantage of quality based VBR encoding is that the quality remains consistent across all streams for which you specify the same quality setting. The disadvantage is that you cannot predict the file size or bandwidth requirements of the encoded content. Quality based VBR encoding uses one-pass encoding. If you are encoding audio content, you can use the Windows Media Audio 9 Lossless codec. Lossless encoding produces superior quality results, while also providing some compression of the data.
  • Bit rate-based VBR (WMENC_PVM_BITRATE_BASED). You specify the desired average bit rate. At any point, the bit rate may exceed the average bit rate but the overall bit rate does not exceed the average bit rate. Bit rate-based VBR encoding uses two-pass encoding. In the first pass, the data complexities are analyzed. Then, in the second pass, the quality level is set to achieve the average bit rate. The advantage of bit rate-based VBR encoding is that the compressed stream will achieve the highest-possible quality level while staying within a predictable average bandwidth.
  • Peak bit rate-based (VBR WMENC_PVM_PEAK). You specify the desired average bit rate and the peak bit rate. The encoding process determines the image quality that can be achieved without exceeding the peak bit rate. The bit rate does fluctuate during encoding, but does not exceed the specified peak bit rate. Use this option when you plan to distribute the content for playback on a device that has a constrained reading speed, such as a CD or DVD player. Peak bit rate-based VBR encoding uses two-pass encoding, and cannot be output to a live broadcast (only archived to a file).

The quality based, VBR encoding mode is not recommended for use in a streaming scenario due to the high bit-rate peaks in the content. In a streaming scenario, when all players reach the point in the stream with a high bit rate at approximately the same time, there is a large peak in demand that may exceed the network capacity, resulting in a negative playback experience.

For information about which codecs support two-pass encoding, see Feature Requirements.

See Also