Codecs and Compression

Constant vs Variable Bitrate

Compare constant, variable and constrained bitrate rate control: how each works, what it does to quality and file size, and which suits streaming or archiving.

On this page
  1. What rate control does
  2. Constant bitrate
  3. Variable bitrate
  4. Constrained VBR: the middle ground
  5. One-pass, two-pass and quality-based encoding
  6. Choosing for different jobs
  7. How to compare results
  8. Summary table

What rate control does

An encoder has to decide how many bits to spend on each part of a video. Scenes differ a great deal in difficulty: a still interview needs few bits to look clean, while a handheld shot of moving water needs many. The rule the encoder follows to distribute bits over time is called rate control. The most common modes are constant bitrate, variable bitrate, and a compromise between them.

Constant bitrate

Constant bitrate (CBR) aims to keep the data rate roughly the same from moment to moment. Technically, encoders hold the rate near the target by managing a small buffer, so short-term variations are allowed but averaged out quickly.

Strengths:

  • Predictable bandwidth. Every second needs about the same capacity, which makes planning a network link or a live broadcast straightforward.
  • Predictable file size. Size is close to the target rate multiplied by duration.
  • Simple for real-time use. Live encoders often favour it because they must respond immediately and cannot look ahead.

Weaknesses:

  • Easy scenes waste bits. A calm scene is encoded at the same rate as a hard one, so some of the budget buys nothing visible.
  • Hard scenes starve. Because the rate is capped, complex moments may show blockiness or smearing that a higher rate would have avoided.

Variable bitrate

Variable bitrate (VBR) lets the rate rise and fall with the content. Simple scenes use fewer bits and complex scenes use more, while the encoder aims for a chosen average. The result is usually better quality for the same average rate and file size than CBR, because bits go where they matter.

Strengths:

  • More efficient. Quality is more consistent across easy and difficult scenes.
  • Good for stored files. If the file will be downloaded or played locally, brief spikes in data rate rarely cause trouble.

Weaknesses:

  • Less predictable. Peaks can exceed what a slow connection or a simple player can handle, which can lead to stalls.
  • Size is approximate. With some settings the final size is only known when the encode finishes.
  • Slower for best results. Getting the most from VBR often involves analysing the video first.

Constrained VBR: the middle ground

Many practical setups use a capped form of variable bitrate. The encoder is allowed to vary the rate, but a maximum rate and a buffer size limit how high it can climb. This keeps most of the efficiency of VBR while ensuring a stream does not exceed what a delivery system can carry. The exact option names differ between tools, so look for settings such as a target (average) bitrate together with a maximum bitrate.

One-pass, two-pass and quality-based encoding

Related choices affect how well VBR works.

  • One-pass VBR encodes straight through, making decisions without knowing what comes later. It is faster but less able to plan.
  • Two-pass VBR analyses the whole video first, then encodes with knowledge of where the difficult scenes are. It typically hits a target file size more accurately and distributes quality better, at the cost of roughly doubling the work.
  • Constant quality modes, such as CRF in x264 and x265 encoders, specify a quality level instead of a bitrate. The encoder uses whatever rate each scene requires to maintain that level. File size then depends on the content, which suits archiving and personal projects better than situations with a fixed bandwidth.

Using the same footage with different modes can produce files of noticeably different size, so these are not just labels.

Choosing for different jobs

Live streaming. Encoders for live video commonly use CBR or capped VBR because the connection to the platform has a limited, steady upload capacity. A rate that spikes beyond that capacity can cause dropped frames or stalls. Latency also matters, and real-time encoders cannot look ahead much. These limits shape live streaming, where stream latency is often as important as picture quality.

On-demand streaming. Services generally prepare several versions at different bitrates and rely on adaptive bitrate delivery. The individual versions are often encoded with a capped form of variable bitrate so the quality is steady while the peak stays within bounds. The set of versions is often called an encoding ladder.

Archiving and masters. When the aim is to preserve quality and storage space is less critical, constant quality or high-bitrate VBR is usually the better fit. Bits are spent where the image needs them, and there is no need to match a network limit.

Uploading to a platform. Because the platform will re-encode your file, it is common to upload at a generous quality. The details depend on the platform’s published guidance, which may change, so check the current recommendation. The same thinking applies to any export settings dialog: match the output to the destination.

Video calls. Real-time communication systems adjust the rate continuously to the available connection, which is closer to a live, adaptive approach than to either pure mode. This is the world of WebRTC calls.

How to compare results

If you are unsure, run a short test. Encode a representative minute of your footage with two modes at the same average bitrate and compare the file sizes and the hardest scenes. Look at fast motion, dark areas and gradients, since those are where differences show first. Keep in mind that the same setting name can behave differently across encoders, so results from one tool do not always transfer to another.

Summary table

Situation Often suitable
Live broadcast with limited upload CBR or capped VBR
Streaming library Capped VBR across several versions
Local file or archive Constant quality or VBR
Hitting an exact file size Two-pass VBR

These are common patterns rather than rules, and the best choice depends on the encoder, the content and the destination.

The complete guide to codecs and compression

What Is a Video Codec
Read the guide

Keep exploring

Guides from other topics

All topics →