Back to Glossary
Video

Bitrate

What Is Bitrate?

Bitrate is the amount of data a video uses for each second of playback, counted in bits per second. Video rates are usually given in kilobits per second (kbps, thousands of bits) or megabits per second (Mbps, millions of bits).

Bits are not bytes. A byte holds eight bits, so a video at 8 Mbps fills 1 MB for every second it plays, and a file’s average bitrate is its size in bits divided by its length in seconds. The video compression page uses that to estimate a file’s size before export.

For a lossy encoder, the bitrate is a target. More bits per second let it keep more detail, while too few show up as blurred texture and visible block edges. How many a video needs depends on its resolution, frame rate, amount of motion and codec.

What Is the Difference Between CBR and VBR?

They are two ways for an encoder to spend a bitrate. A third way skips the bitrate and holds a quality level instead.

Constant bitrate holds the rate steady

With CBR the encoder keeps close to the same number of bits every second, whatever the picture does. A calm shot gets more data than it needs and a busy one less, but the steady rate is what live streaming platforms ask for.

Variable bitrate follows the picture

With VBR the encoder spends more bits on detailed, fast scenes and fewer on simple ones, while the whole file averages out at the target. It is the default mode of the browser’s video encoder, and the file size still follows from the average.

Constant quality ignores the bitrate

In a quality mode the encoder holds a level of detail and lets the bitrate rise and fall with the content. The picture stays even from scene to scene, and the file size is known only once the encode finishes.

Follow a video’s bitrate second by second

Play the clip, or pick a second on the trace, to see how many bits its video track used there.

The clip is a screen recording with no audio track, so it plays without sound.

kbps Video track bitrate, per second
Second
459 kbps 57,400 bytes from 0 to 1 s
Average
340 kbps 309,109 bytes over 7.27 s

This second opens with the clip’s only key frame, 25,868 bytes on its own, coded without reference to other frames.

The clip was encoded with x264 in its constant quality mode (CRF 26), not exported from CE.SDK.

From 0 to 1 s the video track used 459 kbps. The clip averages 340 kbps.

Why Does One Video Have Several Right Bitrates?

The job sets the number as much as the resolution does. Here is the same 1080p video at 30 fps in three published recommendations, one for uploading, one for streaming live and one for delivery to viewers.

8 Mbps

YouTube upload

encoded at a variable bitrate

14 Mbps

YouTube live stream in H.264

sent at a constant bitrate

6 to 7.8 Mbps

Apple's HLS streaming ladder

its two 1080p H.264 versions

Which Bitrate Mode Should You Use?

The right mode depends on what happens to the file after export. A conference app, for example, can stream its talks live at a constant bitrate and export the recordings attendees download at a variable one.

  Use Why
Videos people download or keep Variable bitrate around a target Bits go where the picture needs them, and YouTube asks for VBR on uploads
Live streams to a platform Constant bitrate at the platform's number YouTube's live settings ask for CBR at a set figure per resolution
Master copies for later editing Constant quality Every scene keeps the same detail, and MDN's archiving example uses a quality setting
Video for many devices and networks Several bitrates of the same video The player switches between them as the connection changes, and Apple requires several for HLS

How Bitrate Works in CE.SDK

When your users export from CE.SDK’s video editor, your app sets the bitrate through videoBitrate, which takes an exact figure or one of two named modes. The same option applies to MP4 and WebM exports. To meet an upload limit, read the video’s length, take off the audio and divide, as in the code below, or try figures first in the video compression calculator.

Auto picks a rate from size and frame rate

At 30 fps, 'Auto' gives 5 Mbps for 720p, 8 Mbps for 1080p and 40 Mbps for 4K, the same on every platform. CE.SDK’s docs recommend it for exports in the browser. It reads the size and frame rate of the export itself, so a 1080p page exported with targetWidth: 1280 and targetHeight: 720 gets 5 Mbps at 30 fps. Without a framerate option, the export uses the scene’s frame rate, which is 30 fps in a new scene.

The default, System, depends on the platform

In the browser, 'System' lets the browser’s encoder choose, and CE.SDK’s docs warn that some browsers pick a rate so high that a long export runs out of memory. On iOS, Apple’s VideoToolbox decides, and on Android it uses the same formula as Auto.

A number sets an exact target

Pass bits per second, such as 8_000_000 for 8 Mbps, when the file has to meet a platform’s figure or fit a size limit. CE.SDK’s compress guide suggests 2 Mbps for video on the web and 8 Mbps for HD downloads. A negative number is rejected, and 0 means the default.

Audio has a bitrate of its own

Leave audioBitrate at 0 and CE.SDK picks 128 kbps for stereo. Chrome and Edge on Windows encode AAC only at 96, 128, 160 or 192 kbps, and any other value fails the export there. In our test exports, that track always ran at a sample rate of 48 kHz.

Fit an export under a size limit
const limitBytes = 25_000_000; // a 25 MB upload limit
const seconds = engine.block.getDuration(page);
const audioBitrate = 128_000;
// Keep 5% back for the MP4's container data and its cover image.
const videoBitrate = Math.floor(
  (limitBytes * 8 * 0.95) / seconds - audioBitrate
);
const blob = await engine.block.exportVideo(page, {
  mimeType: 'video/mp4',
  videoBitrate,
  audioBitrate
});
if (blob.size > limitBytes) {
  // Lower the bitrate or the output size, then export again.
}
Export to MP4 guide

FAQs

No. For 1080p uploads, YouTube suggests 8 Mbps up to 30 fps, rising to 12 Mbps from 48 fps up, so twice the frames get about one and a half times the data. CE.SDK's Auto mode uses the same two figures.

A file encoded at a variable bitrate has one average over its whole length and short stretches that run well above it, the peaks. Streaming specs limit both: Apple's HLS authoring spec asks that the peak of an on-demand video stay within twice its average.

For uploads, YouTube recommends 128 kbps for mono sound and 384 kbps for stereo. For live streams it asks for 128 kbps stereo. Either way, audio adds far less to the file than the video track does.

A stream needs its bitrate as steady download speed. When the viewer's connection delivers less data per second than the video uses, the player runs out of picture and pauses until enough has arrived.

Yes. The profile and level of an H.264 export set the highest bitrate it may use. CE.SDK starts from the Main profile and level 5.2, and your app can pick others.