Test: H.264 I vs P Frame Impact

Author: Ethan Ace, Published on Oct 02, 2013

Codecs like H.264 reduce bandwidth by only sending full frames every so often, mixing them with partial frames only capturing changes in between the full ones. They are called 'I' frames because they are the initial / full frames, followed by 'P', or predictive frames.*

Note: if you are not familiar with codecs, please read our Surveillance CODEC Guide before continuing.

I Frame Questions

Since I frames require much more bandwidth than P frames (frequently 10 or 20x more), some will argue that reducing the rate of I frames will reduce overall bandwidth significantly. For instance, instead of having an I frame each second, reduce it to 1 every 5 seconds.

On the other hand, some will argue that reducing I frames can result in quality problems because it can be harder for the processor to continue to faithfully update and represent the image if it has changed significantly since the last I frame.

We seek to answer these two questions:

  • How much bandwidth savings can you achieve by reducing the I frame interval?
  • How much quality degradation can occur by reducing the I frame interval?

The Tests Conducted

In order to answer these questions, we used five 720p cameras at various price points and performance levels:

  • Avigilon H3 1MP
  • Axis M1114
  • Axis Q1604
  • Bosch NBN-733V
  • Dahua HF3101

We aimed these cameras at a toy train set to create consistent motion, and varied I-frame levels from a default of one per second to as high as five and as low as one every four seconds.

*Some versions of H.264 also support 'B' or bidirectionally predictive frames, but these are less common in surveillance cameras and therefore excluded from this study.

****** **** *.*** ****** ********* ** **** ******* **** ****** every ** *****, ****** **** **** ******* ****** **** ********* changes ** ******* *** **** ****. **** *** ****** '*' frames ******* **** *** *** *******/ **** ******, ******** ** '*', ** ****************.*

****: ** *** *** *** ******** **********, ****** **** *************** ***** *********** **********.

I ***** *********

***** * ****** ******* **** **** ********* **** * ****** (frequently ** ** *** ****), **** **** ***** **** ******** the **** ** * ****** **** ****** ******* ********* *************. For ********, ******* ** ****** ** * ***** **** ******, reduce ** ** * ***** * *******.

** *** ***** ****, **** **** ***** **** ******** * frames *** ****** ** ******* ******** ******* ** *** ** harder *** *** ********* ** ******** ** ********** ****** *** represent *** ***** ** ** *** ******* ************* ***** *** last * *****.

** **** ** ****** ***** *** *********:

  • *** **** ********* ******* *** *** ******* ** ******** *** I ***** ********?
  • *** **** ******* *********** *** ***** ** ******** *** * frame ********?

The ***** *********

** ***** ** ****** ***** *********, ** **** **** **** cameras ** ******* ***** ****** *** *********** ******:

  • ******** ** ***
  • **** *****
  • **** *****
  • ***** ***-****
  • ***** ******

** ***** ***** ******* ** * *** ***** *** ** create ********** ******, *** ****** *-***** ****** **** * ******* of *** *** ****** ** ** **** ** **** *** as *** ** *** ***** **** *******.

***** ******** ** *.*** **** ******* '*' ** *************** ********** frames, *** ***** *** **** ****** ** ************ ******* *** therefore ******** **** **** *****.

[***************]

Key ********

***** *** ******* *** ********* **** **** ****:

  • ********** *-***** ********* ******* ** ******* ***** ******* ***********, *** a ***** ******** ** ********* ***********. ********* ** **-**% **** common **** ******** *-****** **** * ** * *** ******, while ********* ** **-**% **** ******** **** ****** **** * to *.
  • ********** *** ****** ** *-****** *** ****** ******* ** * significant ********* ** ***** ********** ****** *******, *** * **** ***** **** ** *********. ****** **** one *-***** *** ****** ** *** ***** *** ******* ********* bandwidth ** *-**%. **-**% ********** **** **** **** ******** *-****** to *** ***** **** *******.
  • ***** ********* ********* ********* ** *-***** ******** *********, *** **** versa, *** ***** ****** ** **** ****** ****** ****** ************* and ****** **** *** **** ************. 
  • **** ******'* *-***** **** ******** ********** ********** ** *-***** ********.
  • *** ***** ***-**** *** *** **** ****** ** **** **** that *** *** ******** ********* **** *** ****** ** *-******. Instead, *** ****** *********************, ******* *** ****** **** ********. *******, ******** *** ****** of *-****** ******** ** ********* ********** ******* ** ***** *******.
  • *** ***** ****** *** *** ***** *** **** **** *** I-frame *** ******, ****** ****** ***** **** ********.

Image ******* ******

** **** *****, ** **** *-***** ********'* ****** ** ***** quality *** ** ******* ******* *************. ********* ****** *******:

  • * *-***** *** ******
  • *.* *-****** *** ******
  • * *-****** *** ******
  • * *-***** ***** * *******
  • * *-***** ***** * *******

***** ****** **** *** ******* ********* ** ***** ******* ** the ****** ** *-****** ** *******, ** **** ** *** minimal ***** **** **********.

Bandwidth ****** 

**** ********** *** **** ******* * ******, ********* ******** ****** all *******, *** ********, ** ***** ** **** *****:

*** ***** ***** ***** *** *** ******* *** ***** ***********:

** ********, ********** *** ****** ** * ****** ** **** there **** ******** **** ** * ******, ************* ********* *********:

 

**** ***** ***** *** *********** ** ********* **** ********** **** one *-***** *** ****** ** *.* *** *. ***** **** Dahua *** *** ***** *** ****** *****, ** *** ******** from ***** *****. ****, *** *** ***** ***** *****'* *********/*********** performance.

P-frame *********/****

*** ****** *****, ***** *************, *********** *** ******:

  • *****, **** *** ********** ******** ** *-****** ** **** ***** (moving **** **** ** *****). *-****** *** ***** ** *** taller **** *****, ***** *-****** *** *****/***.
  • ******, *** *-***** **** ** **** ****** ******* ********** ********** regardless ** *-***** ********. **** *** **** ** **** *** relatively *** ****** ***** ****, *** ** * **** ****** scene ******* **** * ***** *****.

Bosch ***-*** *********** 

****** *** ***** ******* ** *** ****, *** ***-**** *** not ******** ********* **** *-***** ******** *** *********, ******* ******* approximately ****** ****** * **/*. ******** **** ****** ** * stream ********, ** ********** **** *** ****** *********** *** *** additional *-****** ************ ************. ******* ************ *** ** *******:

  • * *-***** *** ******: ~** 
  • *.* *-****** *** ******: ~**
  • * *-****** *** ******: ~**

**** **** ************ ******** ********* **** ****** **** *** *-***** per ****** ** *** ***** *** ** **** *******, ****** around **.

Comments (14)

"Decreasing the number of I-frames per second results in a significant reduction in image quality for moving objects, but a very small gain in bandwidth"

Not sure I understand why image quality would degrade depending on the interval of I-Frames ? As each P frame is encoding the difference from the last P or I frame, why does reducing the I-Frames reduce image quality ? Are you seeing this consistent across all cameras ? Are you also seeing it consistent across Variable Bitrate settings and Constant Bitrate settings ?

P frames are naturally lower quality than I frames since they're using other frames as reference, as opposed to being a full capture as I frames are. It creates the artifacts you see behind moving objects, since the prediction of what is changed in each P frame (the moving object(s)) is imperfect. So in time you'll see the artifact trail grow longer and longer.

It is consistent across all cameras, as well as VBR and CBR. Using VBR, bandwidth will increase and decrease as you raise and lower I frame frequency. Using CBR, the camera should be able to use a slightly lower quantization level if you reduce I frames, but you'll still get artifacts from P frames.

Bear with me here, just trying to get my head straight ;) So the artifacts will build up over the span of the GOP because each P frame is 'estimating' what changed from the I Frame. The 'estimation' is then encoded/compressed which in itself also introduces artifacts. ??

That is correct. So if you have a car moving through a scene, for example, the encoder will see the car as a change. So it keeps the static parts of the background from the previous frame, and transmits only the changed areas (the car, as well as where the car used to be, which is now empty space). This will never be perfect, because objects are in motion. And since successive P frames reference the previous P frame for changes, it gets steadily worse until the next I frame is sent, which you can see as a "clearing" in the video.

Got it. Never really stopped and thought about this thoroughly before. All our video is typically H264 30fps with I-Frames set at 1 sec intervals.

1 second I frame intervals is common for VMS systems, so typically one would not see a quality problem. However, some systems or users try to 'cheat' with longer I frame intervals.

Nice report but please try to establish early in the report what frame rate is being used when making the comparisons. After reading the report it seems 15FPS was used for these measurements?

15 FPS was used because it allowed for the most flexible configuration of higher/lower I frame intervals. I'll add a note about framerate, though, thanks.

Thanks. It just helps knowing all the parameters up front when reading the numbers.

What about testing the B-frames influence on video quality and bandwidth?

This should be interesting a well.

Interesting report, Ethan. Did you consider CPU usage in your experiment? I'm wondering how much influence (in terms of CPU usage %) increasing and reducing the I-frame interval would have.

We didn't initially consider it. But looking at clips now in VLC, it's marginal at best. The difference between 1 I-frame per second and 5, for example, is one percent CPU usage, at most. Reducing from 1 per second to 1 every 4 seconds decreases it by one at most. Those are the most extreme examples, and the effects are practically negligible.

Interesting analysis.

I often have to use low-bandwidth connections to remote cameras - T1, or approx. 1.5Mb symetrical - which is the typical business data connection in North America. xDSL is usually worse, as it's the upstream that matters for remote monitoring. And, most often these links are also used during business hours for other mission-critical applications, so you can't use all the bandwidth - assume 750Kbs is all you have. Now, try to monitor a couple/three 1MP cameras.

I did a lot of 'experimenting' with compression and frame rates, and discovered not all VMS software packages allow for user selection of the key frame refresh interval (KFRI) or (I-frame interval, or
GOV rate, or whatever the camera manufacturer calls it). In particular, Milestone's non-Enterprise solutions fix the KFRI at a minimum of 1 frame per second. So, at low frame rates - say, 1 FPS - well, that's JPEG, one full I-frame per second, and a lot of data for each image. Doing the math, it's clear that several 1MP images won't fit in 750Kbs!

Other VMS solutions (Video Insight, Exacq, for example) do indeed keep the camera settings (if available) intact in the video steam connected. I've used Axis' 'default' GOV rate of 32 (1 I-frame per 32 frames, as I understand it) at 1 FPS and got quite acceptable results, for scenes with little active motion - an occasional vehicle moving through,for example. The artifacting is all in the 'static' parts of the image, so the object of interest - the moving vehicle - is pretty well covered in the P-frame, even at 1 FPS. In fact, I never had a customer 'complain' about the artifacting, and it appears to be 'self-annealing' in subsequent P-frames. I was able to get 2-3 1MP cameras at 1 FPS each in an average of 150-175Kbs for static images, and jumping to 300-400Kbs if a lot of motion occured. Pretty incredible - usable HD video over a T1. Nighttime was typically twice the bandwidth (video noise), but other business services were not running, so I could hit the 'hard stops' of bandwidth utilization, and use the entire 1.5Mbs.

Anyway, I went to local storage for other reasons also impacted by the bandwidth (local and remote simultaneous viewing/stream generation) which generated a different set of problems for a low bandwidth connections, (and cost more) but were the best compromise in my instance.

Take-away here is make sure that the VMS is actually pulling streams at the KFRI (I-frame ratio) you think it is....

There is a lot of good information here that could be applied when testing a camera set up. I found it interesting that the Bosch NBN-733V bandwidth did not increase with the number of I frames, but adjusted the quantization. I've never worked with a Bosch camera, but I wonder if there are other cameras that exhibit this same behavior.

Login to read this IPVM report.
Why do I need to log in?
IPVM conducts unique testing and research funded by member's payments enabling us to offer the most independent, accurate and in-depth information.

Related Reports on Bandwidth

Dahua Dual Imager Dome Camera Tested (HDBW4231FN-E2-M) on Nov 07, 2018
Dahua has introduced a dual-imager dome model, the HDBW4231FN-E2-M, with two independently positionable sensors including integrated IR, not found...
Winter 2019 IP Networking Course on Nov 05, 2018
This is the only networking course designed specifically for video surveillance professionals.  Lots of network training exists but none of it...
Cloud Video Storage Usage 2018 on Oct 31, 2018
Storing email and documents in the cloud have long been common, with on-site email or file servers increasingly eliminated. However, what about...
Video Quality / Compression Tutorial on Oct 17, 2018
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...
Last Chance - October 2018 Camera Course on Oct 04, 2018
Today is the last day to register for the October 2018 Camera Course, register now. This is the only independent surveillance camera course,...
Axis 4K vs. 5MP Camera Shootout (Q3518-LVE + Q3517-LVE) on Oct 04, 2018
Axis has released the 4K counterpart to their 5MP Q3517-LVE (see our test). Axis claims of both these cameras: Simply put, AXIS Q3518(17)-LVE...
SNMP / Network Monitoring For Surveillance 2018 on Aug 21, 2018
Surveillance systems typically rely on the the VMS to report issues, but this most often just means knowing a camera is "down" with no warning or...
Eagle Eye Networks Cloud VMS Tested on Jul 26, 2018
Eagle Eye has become one of the most significant players in the industry in the past few years: Eagle Eye's Owner Acquired Brivo Eagle Eye...
Powerline Networking For Video Surveillance Advocated By Comtrend on Jun 08, 2018
Powerline networking, using existing electrical wiring, has been around for many years. Indeed, over the years, some video surveillance providers...
H.265 / HEVC Codec Tutorial on Jun 07, 2018
H.265 support has improved significantly in 2018, with H.265 camera/VMS compatibility increased compared to only a year ago, and more manufacturers...

Most Recent Industry Reports

Integrator Credit Card Alternative Divvy on Nov 13, 2018
Most security integrators are small businesses but large enough that they have various employees that need to be able to expense various charges as...
Directory of Video Intercoms on Nov 13, 2018
Video Intercoms, also known as Video Door-Phones or Video Entry Systems, have been growing in the past decade as more and more IP camera...
Beware Amazon Go Store Hype (Tested) on Nov 13, 2018
IPVM's trip to and testing of Amazon Go's San Francisco store shows a number of significant operational and economic issues that undermine the...
Magos Radar Company Profile on Nov 12, 2018
Magos America General Manager Yaron Zussman admits when he first came across Magos, he asked himself: "What's innovative about radar?" Be that as...
Genetec Privacy Protector Tested on Nov 12, 2018
Genetec has built Kiwi Security's Privacy Protector into Security Center, an analytic which anonymizes individuals in cameras' fields of view...
Chinese Government Increases Hikvision Ownership on Nov 12, 2018
The Chinese government - Hikvision's controlling shareholder - is increasing its ownership of the video surveillance giant amid sharp stock price...
Axis: "No One Wants To Buy A Camera" on Nov 09, 2018
Axis has, in its own description, made a bold declaration: The industry is changing so rapidly that the following statement might seem bold but...
Video Surveillance Hard Drive Size Statistics 2018 on Nov 08, 2018
What is the most common hard drive size for video surveillance? 150+ integrators answered: What size hard drive do you most commonly use? What...
Axis 2N Intercom Tested on Nov 08, 2018
Axis expanded its video intercom business buying Czech-based 2N in 2016. Despite competing against owner Axis' intercoms, 2N recently registered as...
Haven Targets School Security with Lockdown Lineup on Nov 08, 2018
Haven, a US startup founded in 2014 as a residential-focused company, has now raised funding and is offering a lineup of commercial grade locks for...

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