CBR (Constant Bit Rate) and VBR (Variable Bit Rate) are two different rate control methods used in video encoding for streaming video over the internet. As the names suggest, CBR aims at keeping the number of bits constant while sacrificing video quality, while, VBR varies the number of bits delivered each second in order to favor video quality.
Both CBR and VBR have very specific and important use-cases and in this article, we go into the details of both and why they are used in video streaming. And, before we dive into the definitions of CBR and VBR, we take a few minutes to understand what “bitrate” really means and how it ties into video and frame complexity.
With an understanding of scene complexity and bitrates, its very simple to understand the basics of CBR and VBR and where to use them.
Without further ado, let’s go!
Table of Contents
Bitrates and Scene Complexity
When you transcode a video, you typically specify a bitrate and a resolution. The bitrate could be something like 1500 kbps or 2.4 mbps (kilo/mega bits per second). What this means is that the encoder is supposed to encode 1 second of video using 2.4 mega bits of data.
This is almost like a contract between the encoder and the player trying to stream the content. When the player is told that every second of video “costs” 1.5 megabits, then the player can ensure that it has enough space in its buffer for that much data.
If the encoder “advertises” its bitrate as 1.5 megabits/sec, but, produces video at 6 megabits/sec, then the player will be under serious trouble in terms of buffer management and playback.
An encoder distributes bits amongst all the frames in 1 second of video based on the scene complexity. A complex scene with a lot of motion and texture will need more bits, while a simple scene might need fewer bits to produce video of acceptable video quality. An encoder, thus, has to “look ahead” and decide how to distribute its bit budget to balance the bitrate constraints and video quality.
With this understanding, let’s move ahead and understand what CBR and VBR are all about.
CBR (Constant Bit Rate)
In CBR encoding, the bit rate (the amount of data transmitted per second) remains constant throughout the entire video. This means that the same amount of data is transmitted for every second of the video, regardless of the complexity of the scene.
Why is this important, though? Why would an encoder aim at maintaining the bitrate constant instead of favoring the video quality?
CBR encoding is useful for situations where a consistent level of quality is important, such as in live broadcasts or real-time video conferencing. However, it can result in inefficient use of bandwidth, as some scenes may not require as much data as others to maintain the same level of quality.
Note: You can go here to learn how to produce CBR videos using FFmpeg.
In cases where video quality is the primary concern, it may be better to use a variable bitrate (VBR) encoding method, which adjusts the bitrate based on the complexity of the video content.
VBR (Variable Bit Rate)
In contrast to CBR encoding, we see that VBR encoding adjusts the bit rate based on the complexity of the scene.
In other words, in VBR encoding, the bitrate of the video stream is allowed to vary based on the complexity of the frame. This means that more data is transmitted for complex scenes, and less data is transmitted for simpler scenes. VBR encoding can result in a more efficient use of bandwidth, as it allocates more data to the parts of the video that need it most. However, the quality of the video may fluctuate as the bit rate changes throughout the video.
Also, it should be worth noting that there is another option called “Capped VBR“ where a bitrate (maximum) constraint is placed on top of VBR to ensure that the players are not surprised by very large bitrates from the encoder.
When to use CBR?
CBR can be useful in certain situations, such as when you need to ensure that a video file meets specific size or bandwidth requirements. For example, if you need to upload a video to a website or streaming service that has a maximum file size limit, using CBR encoding can help you stay within that limit.
Another potential use case for CBR video encoding is when you need to ensure a consistent level of video quality across a range of devices and internet connections. Since the bitrate is constant, the video quality will also be consistent, which can be important if you are distributing a video to a wide audience.
CBR encoding may not always be the best choice, however. It can result in a less efficient use of available bandwidth, which can lead to lower video quality compared to other encoding methods.
When to use VBR?
There are several use cases for VBR video encoding and the primary among them are :
- High-quality video production:
- VBR encoding can be a good choice if the primary goal of encoding is to generate high quality video.
- It allows the bitrate to increase in areas of the video where more information is needed to maintain a high level of quality, and decrease in areas where less information is needed.
- This can result in a more efficient use of bandwidth (more bits in the important scenes) and result in a high quality output.
- Streaming video using ABR:
- VBR encoding can be useful when streaming video over the internet, since it can adapt to changes in network conditions and maintain a consistent level of quality.
- However, one has to be careful to not overshoot the maximum bitrates advertised in the HLS/DASH manifests. If you do not stay within the limits of the advertised bitrates, then the players could suffer buffer over/underflows.
- File size optimization:
- If you need to reduce the file size of a video without sacrificing too much quality, VBR encoding can be a good option.
- It can be more efficient than CBR encoding in terms of file size, while still maintaining a high level of video quality.
It’s worth noting that VBR encoding may not be the best choice in all situations. For example, if you need to ensure that a video file meets specific size or bandwidth requirements, CBR encoding may be a better choice. Ultimately, the best method of video encoding will depend on your specific needs and the characteristics of the video content.
Conclusion – CBR vs. VBR
In general, CBR aims at keeping the number of bits constant while sacrificing video quality, while, VBR varies the number of bits delivered each second in order to favor video quality.
Krishna Rao Vijayanagar
Krishna Rao Vijayanagar, Ph.D., is the Editor-in-Chief of OTTVerse, a news portal covering tech and business news in the OTT industry.
With extensive experience in video encoding, streaming, analytics, monetization, end-to-end streaming, and more, Krishna has held multiple leadership roles in R&D, Engineering, and Product at companies such as Harmonic Inc., MediaMelon, and Airtel Digital. Krishna has published numerous articles and research papers and speaks at industry events to share his insights and perspectives on the fundamentals and the future of OTT streaming.