What is Data Rate and Bits Per Pixel

This article discusses what data rate is and why it’s important, and what bits per pixel measures and how to compute it.

 What is Data Rate?

Data rate (or bit rate) is the amount of data per second of video, usually expressed in kilobits (kbps) or megabits per second (Mbps). When I say that ESPN distributes their video at 800 kbps, this means that each one-second chunk of audio and video comprises about 800 kilobits of data.

Typically, when configuring the data rate in an encoding tool, you enter the video and audio data rates separately. That’s what you see in Figure 1, which are configuration screens from Sorenson Squeeze. That’s video on the left, audio on the right.

Figure 1. Choosing data rates for video and audio in Sorenson Squeeze.

Data rate is the most important factor in streaming video quality. That’s because all streaming codecs use what’s called “lossy” compression, which means that the more you compress, the more quality you lose. For this reason, all other file characteristics (like resolution, frame rate or codec) being equal, the lower the data rate, the lower the quality of the compressed file.

Understanding Data Rate

While data rate is an absolute number that you configure into your streaming encoding software, intuitively, we understand that it’s a relative concept. That is, a data rate of 500 kbps would look great if your video is configured at a resolution of 320×240, but would look awful if configured at 1920×1080. Adjusting the frame rate from 30 frames per second to 15 frames per second can also impact the actual quality of the video. For this reason, rather than evaluating data rate itself, it’s more useful to look at a value called bits per pixel, which incorporates data rate, frame rate and video resolution to arrive at a single value.

Bits Per Pixel

You calculate bits per pixel by dividing the per-second video data rate by the number of pixels per second in the video file. You calculate the number of pixels per second by multiplying video height x width x frame rate. For example, if a video file had a resolution of 640×360, a frame rate of 30 and a data rate of 670 kbps, the calculation would look like this:

670,000/(640x360x30)

670,000/ 6,912,000 = .097

Simply stated, there are 6,912,000 pixels per second in the video. Divide the per-second video data rate (670,000) by that number and you get .097 bits per pixel. In essence, this tells you that each pixel of video data has .097 bits assigned to it, which is an absolute value that describes how much compression is actually applied to the video file.

If you’re not mathematically inclined, there’s a very convenient, free tool called MediaInfo that runs on Windows, Mac and Linux platforms and is installed on every one of the computers in my office. You can watch a tutorial about MediaInfo and Bitrate Viewer, another tool I use a lot, here. As you can see in the screenshot below, MediaInfo provides a ton of file-specific data, including the bits-per-pixel value, which it mislabels as Bits(Pixel*Frame). No matter, same math, same result.

MediaInfo shows bits per pixel and other file-related data

Figure 2. MediaInfo provides tons of file-specific data, including the bits-per-pixel value of the file.

In general, for low-motion, talking-head video, bits-per-pixel values in the range of .1 – .15 should produce very good video quality. For example, CNN produces most of their videos at around .1. For higher-motion videos, you need a bits-per-pixel value of around .15 -.20. For example, ESPN produces most of its videos in this range.

Why the difference? Because videos with high motion, or lots of detail, are harder to compress than low-motion videos. That’s why talking-head videos encode at a higher quality than soccer matches at the same bits-per-pixel value.

This table contains some videos that I’ve downloaded and measured that you can use as a guide. 

About Jan Ozer

I help companies train new technical hires in streaming media-related positions; I also help companies optimize their codec selections and encoding stacks, and evaluate new encoders and codecs.

Check Also

How to Compare Per-Title Encoding Systems

I just completed the first of two reports on cloud-based per-title encoding features, culminating 8 …