CBR & VBR

Constant bit rate (CBR)

When referring to codecs, constant bit rate encoding means that the rate at which a codec's output data should be consumed is constant.
CBR is useful for streaming multimedia content on limited capacity channels since it is the maximum bit rate that matters, not the average, so CBR would be used to take advantage of all of the capacity.

按照固定码率进行编码.

In the case of streaming video as a CBR, the source could be under the CBR data rate target. So in order to complete the stream, it's necessary to add stuffing packets in the stream to reach the data rate wanted. These packets are totally neutral and don't affect the stream.

会填充一些无用的字节.

Constant bit rate (CBR) encoding persists the set data rate to your setting over the whole video clip. Use CBR only if your clip contains a similar motion level across the entire duration. CBR is most commonly used for streaming video content using the Flash Media Server (rtmp).

常用于rtmp.

优点:
  • 码流稳定.
  • 固定码流控制可以减少网络抖动的影响
缺点1: not allocate enough data for complex section

CBR would not be the optimal choice for storage as it would not allocate enough data for complex sections (resulting in degraded quality) while wasting data on simple sections.
The problem of not allocating enough data for complex sections could be solved by choosing a high bitrate to ensure that there will be enough bits for the entire encoding process, though the size of the file at the end would be proportionally larger.

缺点2: 无法有效适应变长编码

Most coding schemes such as Huffman coding or run-length encoding produce variable-length codes, making perfect CBR difficult to achieve.
This is partly solved by varying the quantization (quality), and fully solved by the use of padding.
(However, CBR is implied in a simple scheme like reducing all 16-bit audio samples to 8 bits.)

Variable bit rate (VBR)

As opposed to constant bitrate (CBR), VBR files vary the amount of output data per time segment.
VBR allows a higher bitrate (and therefore requires more storage space) to be allocated to the more complex segments of media files while less space is allocated to less complex segments.
The average of these rates can be calculated to produce an average bitrate for the file.

复杂的segment分配更多的空间(more space for more complex segments),
不复杂的segment分配少的空间(less space for less complex segments).

Variable bit rate (VBR) encoding adjusts the data rate down and to the upper limit you set, based on the data required by the compressor.
VBR takes longer to encode but produces the most favorable(良好的) results.
VBR is most commonly used for http delivery if video content (http progressive)

VBR可自适应码率低于上限值.
编码时,较CBR用时较长, 但编码效果更良好.

  • 可以用VBR进行编码的文件

Opus, Vorbis, MP3, WMA and** AAC** audio files can optionally be encoded in VBR.
Variable bit rate encoding is also commonly used on MPEG-2 video,MPEG-4 Part 2 video (Xvid, DivX, etc.), MPEG-4 Part 10/H.264 video, Theora, Dirac and other video compression formats.

References:
https://en.wikipedia.org/wiki/Constant_bitrate
https://en.wikipedia.org/wiki/Variable_bitrate
http://help.encoding.com/knowledge-base/article/what-is-the-difference-between-cbr-and-vbr-encoding/

你可能感兴趣的:(CBR & VBR)