▶ Video & streaming

Video bitrate: CBR, VBR and CRF explained with examples

What bitrate measures, how quality and file size change with CBR, VBR and CRF, and which rate control mode to use for archiving, the web and live streams.

Bitrate is the amount of data used to represent one second of video. It is measured in kilobits or megabits per second (kbps, Mbps) and, together with the codec, it is the parameter that decides both visible quality and file size. Working out the size is simple: a 10-minute video at 5 Mbps takes about 600 seconds times 5 megabits, that is 3,000 megabits, roughly 375 megabytes, excluding audio.

Why bitrate alone tells you little

Two videos at the same bitrate can look very different. What matters:

  • the codec: AV1 at 3 Mbps can look better than H.264 at 5 Mbps;
  • resolution and frame rate: more pixels per second require more data;
  • the content: a static interview compresses far better than a football match;
  • the encoder and preset: slower settings find more efficient compression.

This is why the way the encoder distributes bits over time matters as much as the total amount.

CBR: constant bitrate

With Constant Bitrate the encoder keeps the data rate as fixed as possible, for example 6 Mbps at every moment.

When it is needed: - live streams on platforms that ask for a steady flow; - transmission over channels with fixed bandwidth and a small buffer.

The problem: simple scenes waste bits, complex ones run short. A shot of a meadow moving in the wind can fill with blocks precisely because the encoder cannot exceed the ceiling.

VBR: variable bitrate

With Variable Bitrate the encoder gives more data to difficult scenes and less to easy ones, while keeping a stated average. A maximum and a buffer size are often set as well, to avoid peaks the player could not handle.

There is also a two-pass version: in the first pass the encoder analyses the whole video, in the second it distributes bits already knowing where they are needed. It is the right solution when you must hit a precise final size, such as a file that has to stay under an upload limit.

CRF: constant quality

Constant Rate Factor, typical of the x264 and x265 encoders and of AV1 encoders with equivalent names, flips the perspective: you do not ask for a bitrate but for a quality level. The encoder uses as many bits as needed to keep that perceived quality, and the file size becomes a consequence.

In x264 the scale runs from 0 (lossless) to 51; lower values mean higher quality. Commonly used starting points:

CRF value (x264) Typical use
17-18 quality almost indistinguishable from the original
20-23 good compromise for archiving and the web
26-28 light files, visible artefacts on complex scenes

For x265 the equivalent values are a little higher, and other encoders use different scales: always test on a representative excerpt.

The limit: with CRF you do not know the file size in advance. A video full of motion can weigh three times as much as a static one of the same length.

Capped CRF: the best of both worlds

For streaming a combination is often used: CRF for quality, plus a maximum bitrate and a buffer so as not to exceed the available bandwidth. With FFmpeg and x264 it looks like this:

ffmpeg -i master.mov -c:v libx264 -crf 21 -maxrate 6M -bufsize 12M -c:a aac -b:a 160k output.mp4

In easy scenes the file stays light; in difficult ones quality rises up to the stated ceiling. It is a good choice for videos published online.

Which mode to choose

  1. Personal archive or working master: low CRF, size matters little.
  2. Video for your website or a platform: CRF with a maximum bitrate.
  3. File that must meet a precise limit: two-pass VBR with a calculated bitrate.
  4. Live stream: CBR or VBR with a tight cap, following the platform's guidance.

To calculate the bitrate for a given file size, simply invert the initial formula: size in megabits divided by duration in seconds, minus the audio bitrate. A 200-megabyte file for 4 minutes means 1,600 megabits over 240 seconds, about 6.6 Mbps in total; take away 160 kbps of audio and roughly 6.5 Mbps remain for the video.

Common mistakes

  • Copying another video's bitrate: without knowing codec, resolution and content, the number means nothing.
  • Raising the bitrate to «improve» an already compressed file: lost detail does not come back, you just get a heavier file.
  • Using CBR for archiving: it wastes space on simple scenes and loses quality on difficult ones.

In short

  • Bitrate measures data per second; size = bitrate times duration.
  • CBR is useful for live streams but distributes bits poorly.
  • VBR adapts bits to scenes; two-pass VBR hits a precise size.
  • CRF fixes quality and lets file size vary.
  • For the web, CRF with a maximum bitrate is a solid compromise.
MM
Marco Marzaduri

Marco Marzaduri works in cybersecurity, digital forensics and web development. A computer science graduate, he combines rigorous technical analysis with attention to the people who use technology.

Read also