Last time, we drew an analogy between bitrate in computer science and density in physics. We saw how moving to quantities per unit allowed us to achieve the desired result more efficiently. If we don’t have scales but have a ruler, knowing the density allows us to “weigh” the unweighable. If we don’t have time to wait for the video camera to record the entire 2-hour football match to find out how much storage space the whole recording will take, then knowing the bitrate allows us to calculate the required space almost instantly: we just need to multiply two numbers—the bitrate and the match duration.
However, this approach only works under one condition: our subject must be homogeneous—meaning its density must be constant, or, translating to bitrate, the bitrate must not depend on what is happening in the digital picture at that time—meaning it must also remain a constant value (CBR—Constant Bitrate).
In reality, things aren’t that simple. Humans always strive for optimization. We want to record as much as possible, with the best possible quality, while using as little space on the SSD / HDD / “flash drive” as possible.
Therefore, at some point, people started thinking: if a scene has few details, a uniform background (e.g., the sky), or nothing is happening (a static scene, a lull in the match), then why save the same thing over and over? If, however, the frame shows a crowd of people against a varied background, or a forest with small leaves, heavy rain, snow, or someone running, driving, or fighting quickly, then, conversely, a large amount of data needs to be saved as frequently as possible to capture all the details.
This leads us to variable bitrate (VBR—Variable Bitrate)—an encoding method where the codec (a program or a chip in the camera) dynamically changes the number of data bits allocated per second of video depending on the complexity of the scene—spatial (detail in the frame) or temporal (motion in the frame).
The advantages of variable bitrate are that we now get more consistent picture quality and, on average, use less disk space to store the video.
The disadvantages are that it becomes impossible to predict how much space the file will occupy, since we don’t yet know what exactly will happen in the match over the next 2 hours—how dynamic it will be and how precisely the bitrate will change during our recording.
Food for Thought
Okay, we replaced constant bitrate with variable bitrate and gained in picture quality and, most likely, in the storage volume needed for the entire recording.
But what volume of storage do we actually need for recording a two-hour match? After all, that was our initial problem!
Answer
We cannot give a precise answer to this question, but we can provide an upper bound estimate. And to learn about what an upper bound estimate is, read on.