Video Quality / Compression Tutorial

Author: IPVM Team, Published on Jul 17, 2012

While CODECs, like H.264, H.265, and MJPEG, get a lot of attention, a camera's 'quality' or compression setting has a big impact on overall quality. In this training, we explain what this level is, what options you have and how you should optimize it.

To start, review these two images, (A) and (B):

a vs B

And answer this question before continuing:

If your gut feel is that this is a trick question you are right. With the information presented, the best answer is likely that it cannot be determined. In this case, technically the correct answer is 'neither - they are the same resolution'. We used the same camera for each image and simply lowered the quality level for the 'B' image (while keeping everything else the same, including resolution - 720p - and CODEC - H.264).

The fact that two exact shots with the same resolution can look significantly different has a number of important implications. Inside, we explain why, covering:

  • Quantization levels
  • Bandwidth vs. quality loss
  • Image quality examples
  • Manufacturer differences
  • MBR/VBR/CBR impact
  • Smart codec impact
  • Recommendations

Quantization Levels

Regardless of codec used (MJPEG, JPEG2000, MPEG-4, H.264), all IP cameras offer quality levels, often called 'compression' or 'quantization'.

H.264 quantization is a measured on a standard scale which varies from 0 to 51, with lower numbers meaning less compression, and thus higher quality. If this seems counterintuitive to you, it is understandable, but these measurements were agreed upon in H.264 standards.

Get Video Surveillance News In Your Inbox
Get Video Surveillance News In Your Inbox

Key Tradeoff: Bandwidth Vs. Quality Loss

The key tradeoff in setting quantization is determining how much 'loss' you are willing to accept for a particular decrease in bandwidth. Recall that all production surveillance video compression is 'lossy', meaning that some information will be lost when video is compressed.

The decision which must be made is how much information loss is acceptable. Increase compression/lower the quality level and you save on bandwidth, but reduce quality. Increase quality/reduce compression and you may gain usable details, but use more bandwidth and reduce storage time.

Demonstrated in Pictures

The image below shows the impact of changing quality levels. In order to show this, we took examples from two scenes (indoor / simple and outdoor / complex) and adjusted bitrate. The Average DRF (quantization) levels below, underlined in red can be seen decreasing in both scenes as bitrate goes up. Inversely, image quality increases, with less pixelation and blocking on objects. Note that we used a CBR stream to simply show the effects of bitrate.

Manufacturer Approaches

All manufacturers set default quality levels. Even if you never touch these settings, the manufacturer will make a choice for you. However, with the vast majority of professional cameras, configuration options are available to let advanced users adjust this.

Below, we look at a few manufacturers to better demonstrate their approaches. Readers should see our IP Camera Manufacturer Compression Comparison test for full details of 10+ manufacturers compression scales and how to default these cameras to "average" compression.

Axis

Axis currently uses two different web interfaces, as many of their cameras have not yet transitioned to their new HTML5 based UI. Both new and old web UIs refer to quality as "Compression", with higher numbers being more compressed/lower bandwidth. Beware of this, as inexperienced users may simply increase the scale thinking it increases image quality.

The new web interface uses a slider/manual entry:

While the old interface simply allows free entry:

Regardless of UI, Axis Compression 30 equates to ~28 on the quantization scale.

Bosch

Bosch's codec setup bases quantization on P-frames, with I-frames allowed to vary by a specific amount ("I/P-frame delta QP" below). So if P-frames are set to 25 and I-frames set to -6, I-frames will use a minimum of 19 quantization.

Hikvision

Hikvision's compression settings are under the video/audio tab, on a scale of "lowest" (most compression) to "highest" (least compression), defaulting to "Higher." These settings are mapped to specific quantization levels, ranging from ~20-35.

Important: MBR/VBR/CBR Impact

Most surveillance deployments use variable bit rate streaming (VBR), which varies bandwidth in order to maintain a pre-set quality level, sometimes with a maximum bit rate cap (called MBR). The levels set above define the quantization level the camera is targeting, e.g., an Axis camera will target quantization level 28, with bitrate increasing and decreasing as necessary.

However, if cameras are set to constant bit rate, quality level is NOT configurable because the bit rate, by definition is 'constant', with quality level automatically adjusted to keep bandwidth the same. For instance, if you have a CBR video stream set at 1Mb/s looking at a white wall, the camera may use a 'high' quality level since it is easy to compress. However, if the lights are turned off and a hand is waved in front of the camera, it may need to drop down to 'low' quality to maintain the same 1Mb/s constant bit rate as compression is more difficult.

For more on the key points of these streaming modes, see our CBR vs VBR vs MBR - Surveillance Streaming tutorial.

Smart Codec Impact

Further complicating things, in the past few years, camera manufacturers have introduced smart codecs, which allow image quality to vary based on activity in the scene. So a person or vehicle moving through a parking lot will be higher quality, while parked cars and trees in the background are lower quality. Generally speaking, these codecs allow for similar or better image quality compared to standard (non-"smart") codecs, but at much lower bitrates, with 25-30% lower bandwidth common, and as much as 90% lower possible.

However, we strongly recommend readers test smart codecs in the scene where the camera will be installed, as some negative image quality effects may be seen. For example, in one of our tests, higher levels of smart codec settings caused blurring/smearing/artifacts in the scene, visible in the subject and background below. Settings should be carefully adjusted to avoid these issues.

Readers should also see our Smart Codec Guide for more information on these and other considerations.

What Should You Use?

Ultimately, the most important question is: what quality setting is necessary in the camera's application?

Unfortunately, it is impossible to give a universal answer as:

  • The right level is a subjective judgment call. Changing from a quantization level of 30 to 29 or 42 to 41 produces no magical difference. Often the changes are nearly imperceptible and debatable.
  • The right level depends on the complexity of the scene. More complex scenes (like an intersection) will typically benefit from a higher quality levels than a simple scene (like a stairwell). The smaller the elements being observed (like a person across an intersection), the more higher quality levels can capture meaningful details.

However, based on our tests, we offer two key recommendations:

  • Quantization ~28 is the "sweet spot": Based on years of ongoing testing, we have found 28 to offer the best tradeoffs between bandwidth and image quality. Many manufacturers default to 28-30, though users should see our IP Camera Manufacturer Compression Comparison for more details on how to standardize others.
  • Use smart codecs (but carefully): Because of their drastic bitrate reductions in many scenes, we smart codecs be used wherever possible, as users may be able to increase image quality where necessary, while bitrates remain lower than typical codecs.

11 reports cite this report:

Resolution Tutorial on Dec 28, 2017
Understanding video surveillance resolution can be surprisingly difficult and complex. While the word 'resolution' seems self-explanatory, its use...
IP Camera Manufacturer Compression Comparison on Nov 27, 2017
Despite the use of standards-based video compression (H.264/H.265), our tests show that default image quality settings for different manufacturers...
Hikvision H.265+ Tested on Jun 27, 2017
Hikvision, which in the past few years released H.264+ (see test results) has now released H.265+, that claims even greater bandwidth savings. We...
The PPF / PPM Video Surveillance Guide on Dec 23, 2016
Pixels per foot / Pixels per meter is the most fundamental and valuable, though imperfect, metric for specifying video surveillance image...
Video Surveillance Bandwidth Guide on Dec 16, 2016
Bandwidth is one of the most fundamental, complex and overlooked aspects of video surveillance. Many simply assume it is a linear function of...
Smart Codec Guide on Nov 29, 2016
In 2018, smart codecs are now mainstream. Once seemingly a marketing buzzword, now the majority of manufacturers offer smart codecs on at least...
Sony and Samsung Breaking VBR on Oct 21, 2016
For years, users have known variable bitrate (VBR) as one thing only: bandwidth varies, compression stays the same. This is not an accident but an...
Video Surveillance Commissioning / Install Checklist on Feb 08, 2016
This 60+ point checklist helps end users, integrators and consultants verify that video surveillance installation is complete. It covers the...
Axis Zipstream Claims Average 50% Savings on Mar 25, 2015
Axis claims that its new Zipstream compression technology can "lower bandwidth and storage requirements by an average 50% or more." That is quite...
Tested: Lowering Bandwidth at Night is Good on Dec 29, 2014
Bandwidth spikes in low light are commonplace, with increases of 300 to 500% over daytime normal. IPVM recommends lowering bandwidth levels at...
Resolution vs Compression Tested on Nov 24, 2014
They are not the same thing. Unfortunately, too many industry people conflate them. Worse, resolution and compression can silently undermine each...

Related Reports

Installing Dome Cameras Indoors Guide on Jul 16, 2018
IPVM is producing the definitive series on installing surveillance cameras. This entry covers one of the most common scenarios - installing dome...
Last Chance - July 2018 IP Networking Course on Jul 12, 2018
Registration ends today, Thursday. Register now. This is the only networking course designed specifically for video surveillance...
GDPR For Access Control Guide on Jul 03, 2018
Electronic access control is common in businesses plus organizations are increasingly considering biometrics for access control. With GDPR coming...
Replacing / Switching Access Control Systems Guide on Jun 28, 2018
Ripping out and replacing access control systems is hard for important reasons. Because users typically hold on to access control systems for as...
2018 Mid-Year Surveillance Industry Guide on Jun 28, 2018
2018 has been an explosive year for the video surveillance industry, with the industry becoming a global political issue, with the expansion of...
Installation Hardware for Video Surveillance - Indoor Fasteners on Jun 22, 2018
As part of our Installation for Video Surveillance series, in this note, we cover drywall anchors. A key part of installing security hardware is...
Four Major Outdoor Camera Install Problems on Jun 14, 2018
Over 140 integrators told us the top four camera installation mistakes that lead to unexpected problems and failures. Their comments often...
China Public Video Surveillance Guide: From Skynet to Sharp Eyes on Jun 14, 2018
China is expanding its video surveillance network to achieve “100%” nationwide coverage by 2020, including facial recognition capabilities and a...
Access Control - Time & Attendance, Mustering and Mantraps Guide on Jun 13, 2018
Electronic access offers features that traditional mechanical locks cannot. While these features may not be as fundamental as keeping doors secure,...
Introducing Effective PPF (ePPF) - Improving Video Surveillance Designs on Jun 11, 2018
Pixel density (PPF / PPM) is the best metric the industry has to define and project video quality. It allows simple communication of estimated...

Most Recent Industry Reports

Amazon Ring Alarm System Tested on Jul 16, 2018
Amazon Ring is going to hurt traditional dealers, and especially ADT, new IPVM test results of Ring's Alarm system underscore. IPVM found that...
Hikvision Wins Chinese Government Forced Facial Recognition Project Across 967 Mosques on Jul 16, 2018
Hikvision has won a Chinese government tender which requires that facial recognition cameras be set up at the entrance of every single mosque...
Installing Dome Cameras Indoors Guide on Jul 16, 2018
IPVM is producing the definitive series on installing surveillance cameras. This entry covers one of the most common scenarios - installing dome...
Security Sales Course Summer 2018 on Jul 13, 2018
Based on member's interest, IPVM is offering a security sales course this summer. Register Now - IPVM Security Sales Course Summer 2018 This...
US Tariffs Hit China Video Surveillance on Jul 13, 2018
Chinese video surveillance products avoided tariffs for the first two rounds. Now, in the third round, many video surveillance products will be...
Last Chance - July 2018 IP Networking Course on Jul 12, 2018
Registration ends today, Thursday. Register now. This is the only networking course designed specifically for video surveillance...
4 Most Difficult Camera Installs (Statistics) on Jul 12, 2018
Heavy housings, cumbersome brackets, heavy ladders required, and tricky field of view requirements will cause difficulties no matter the camera...
Axis Perimeter Defender Video Analytics Tested on Jul 12, 2018
Axis 'high security' video analytics offering is Perimeter Defender, OEMed / developed with Digital Barriers. But how good is Perimeter Defender?...
Hikvision Fights Ban - Claims 'Red Scare', Hires 14 Term Ex-Congressman on Jul 11, 2018
Hikvision is fighting back against the House Bill Ban of their products. Hikvision has hired one of the biggest lobbying firms, led by a 14 term...
Arecont Acquisition By Costar on Jul 11, 2018
Arecont Vision acquisition by Costar Technologies has been approved by the court, concluding the bankruptcy process triggered by Arecont's...

The world's leading video surveillance information source, IPVM provides the best reporting, testing and training for 10,000+ members globally. Dedicated to independent and objective information, we uniquely refuse any and all advertisements, sponsorship and consulting from manufacturers.

About | FAQ | Contact