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:

Smart Codec Guide on Feb 01, 2018
In 2018, smart codecs are now mainstream. Once seemingly a marketing buzzword, now the majority of manufacturers offer smart codecs on at least...
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...
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

IP Camera Cable Labeling Guide on Sep 14, 2018
Labeling cables can save a lot of money and headaches. While it is easy to overlook, taking time to label runs during installation significantly...
October 2018 Camera Course on Sep 13, 2018
Today is the last day to save $50 on the October 2018 Camera Course, register now. This is the only independent surveillance camera course,...
VMS Export Shootout - Avigilon, Dahua, Exacq, Genetec, Hikvision, Milestone on Sep 13, 2018
When crimes, accidents or problems occur, exporting video from one's video surveillance system is critical to proving incidents. But who does it...
Door Fundamentals For Access Control Guide on Sep 12, 2018
Assuming every door can be secured with either a maglock or an electric strike can be a painful assumption in the field. While those items can be...
IP Camera Cable Termination Guide on Sep 06, 2018
Terminating cables properly is critical to network performance, but it can be a tricky task with multiple steps. Fortunately, this task is easy to...
Drain Wire For Access Control Reader Tutorial on Sep 04, 2018
An easy-to-miss cabling specification plays a key role in access control, yet it is commonly ignored. The drain wire offers protection for readers...
IP Camera Cabling Installation Guide on Aug 29, 2018
IPVM is preparing the industry's first Video Surveillance Installation book and our upcoming Video Surveillance Installation Course. We have...
Exit Devices For Access Control Tutorial on Aug 28, 2018
Exit Devices, also called 'Panic Bars' or 'Crash Bars' are required by safety codes the world over, and become integral parts of electronic access...
Inputs/Outputs For Video Surveillance Guide on Aug 24, 2018
While many cameras have Input/Output (I/O) ports, few are actually used and most designers do not even consider them. However, a good understanding...
Backup Power for Large Security Systems Tutorial on Aug 24, 2018
Choosing the right backup power system depends on system size. While small and medium systems greatly benefit from using UPS battery backup...

Most Recent Industry Reports

BluePoint Aims To Bring Life-Safety Mind-Set To Police Pull Stations on Sep 20, 2018
Fire alarm pull stations are commonplace but police ones are not. A self-funded startup, BluePoint Alert Solutions is aiming to make police pull...
SIA Plays Dumb On OEMs And Hikua Ban on Sep 20, 2018
OEMs widely pretend to be 'manufacturers', deceiving their customers and putting them at risk for cybersecurity attacks and, soon, violation of US...
Axis Vs. Hikvision IR PTZ Shootout on Sep 20, 2018
Hikvision has their high-end dual-sensor DarkfighterX. Axis has their high-end concealed IR Q6125-LE. Which is better? We bought both and tested...
Avigilon Announces AI-Powered H5 Camera Development on Sep 19, 2018
Avigilon will be showcasing "next-generation AI" at next week's ASIS GSX. In an atypical move, the company is not actually releasing these...
Favorite Request-to-Exit (RTE) Manufacturers 2018 on Sep 19, 2018
Request To Exit devices like motion sensors and lock releasing push-buttons are a part of almost every access install, but who makes the equipment...
25% China Tariffs Finalized For 2019, 10% Start Now, Includes Select Video Surveillance on Sep 18, 2018
A surprise move: In July, when the most recent tariff round was first announced, the tariffs were only scheduled for 10%. However, now, the US...
Central Stations Face Off Against NFPA On Fire Monitoring on Sep 18, 2018
Central stations are facing off against the NFPA over what they call anti-competitive language in NFPA 72, the standard that covers fire alarms....
Hikvision USA Starts Layoffs on Sep 18, 2018
Hikvision USA has started layoffs, just weeks after the US government ban was passed into law. Inside this note, we examine: The important...
Chinese Government Praises Hikvision For Following Xi Jinping on Sep 17, 2018
The Chinese government council responsible for managing China's state-owned companies praised Hikvision’s obedience to China’s authoritarian leader...

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