H.264 vs MJPEG - Quality and Bandwidth Tested

Author: John Honovich, Published on Jul 28, 2010

Encoding video optimally is critical for IP video surveillance systems. Should you choose H.264 or MJPEG? While industry momentum certainly favors H.264, when and how to best use H.264 are important questions.

We believe the 3 key questions in considering H.264 vs MJPEG are:

  • How much bandwidth savings does H.264 provide over MJPEG?
  • What type of image quality differences can you expect between H.264 and MJPEG?
  • What differences in computing load will you experience between H.264 and MJPEG?

This report provides our results and recommendations on the first two questions - bandwidth and image quality.From our tests, we recommend the following 3 key criteria to understand H.26/MJPEG's impact on quality and bandwidth:

  • Determine the complexity of the scene being captured/recorded
  • Determine the streaming mode / control of the camera being used
  • Determine the ratio of total frames to I frames (for H.264)

The tests reveal no magic numbers - the answer is not 80% bandwidth savings or 10% less quality (or any other single value for X or Y). While H.264 generally reduces bandwidth consumption significantly, it depends on multiple factors (including complexity, streaming mode, frame rate and i frame rate). VBR vs CBR selection is especially important, having a especially large impact on use and performance. Finally, while H.264 can deliver the same visible image quality as MJPEG, depending on the settings you use (especially streaming mode), you can easily generate worse quality.

Inside our premium report, we examine and explain each of these elements in-depth with a series of sample videos and tutorial video screencasts. The video introduction below overviews the approach we took:

Premium members should allocate 1-3 hours to read the full report

******** ***** ********* ** ******** *** ** ***** ************ *******. Should *** ****** *.*** ** *****? ***** ******** ******** ********* favors *.***, **** *** *** ** **** *** *.*** *** important *********.

** ******* *** * *** ********* ** *********** *.*** ** MJPEG ***:

  • *** **** ********* ******* **** *.*** ******* **** *****?
  • **** **** ** ***** ******* *********** *** *** ****** ******* H.264 *** *****?
  • **** *********** ** ********* **** **** *** ********** ******* *.*** and *****?

**** ****** ******** *** ******* *** *************** ** *** ***** two ********* - ********* *** ***** *******.**** *** *****, ** recommend *** ********* * *** ******** ** ********** *.**/*****'* ****** on ******* *** *********:

  • ********* *** ********** ** *** ***** ***** ********/********
  • ********* *** ********* **** / ******* ** *** ****** ***** used
  • ********* *** ***** ** ***** ****** ** * ****** (*** H.264)

*** ***** ****** ** ***** ******* - *** ****** ** not **% ********* ******* ** **% **** ******* (** *** other ****** ***** *** * ** *). ***** *.*** ********* reduces ********* *********** *************, ** ******* ** ******** ******* (********* complexity, ********* ****, ***** **** *** * ***** ****). *** vs *** ********* ** ********** *********, ****** * ********** ***** impact ** *** *** ***********. *******, ***** *.*** *** ******* the **** ******* ***** ******* ** *****, ********* ** *** settings *** *** (********** ********* ****), *** *** ****** ******** worse *******.

****** *** ******* ******, ** ******* *** ******* **** ** these ******** **-***** **** * ****** ** ****** ****** *** tutorial ***** ***********. *** ***** ************ ***** ********* *** ******** we ****:

******* ******* ****** ******** *-* ***** ** **** *** **** report

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

*******:

*** ************ ***** ** ********** / ******* (******* ** ** MJPEG, ****-*, *.***, ***.). *** **** ******** ** *** **** and **** **** ** ***********/******** ** *********.

*** **** ********** ******* *.*** *** ***** ** **** ***** only ********** ********** ****** ** ***** ***** *.*** ********** ****** frames. *** *****, **** ***** ** ***** ** ********** ** itself, **** ** ** *** **** *********** * ****** ** JPEG ****** ******** (**** ****** ****). *** *.***, **** ** the ****** *** ********** ** ****** (****** ** * ** initizaliation *****) ***** **** ** *** ****** **** ****** ******* from *** ******** ***** (****** * ** *********** ******). **** can **** * *********** ****** ** ********* ******** ** ***** which ******* **** ***** ****.

[****: **** *********** ***** ** *** ************ ******** ****. ** is ************** *** **** ******** ******** **** ****** ** *****'* IP ***** ************ *******.]

*********** ** ******* ** **********. *** ************ ******* ** *********** patterns *** ************ ***** ******** ** ******* *****/********. *** **** complex ** *** **** ********* ****** * ******* **, *** less ****** ** ** *** * ******* ** ** ********** (or *** ****** ** ** ** ********** ****). ***** *.*** can ******** '****' **** *****, **** ********* ** ** ** important ******* ** ************* ********* ** *********** *** ***** ********.

****** ********: ** **** ****, ** **** * **** ****** ******** from*********** ******* *** *.*** *******.******** *** ********* ********. ** *** ********** **** *****, ** ******* * **** video **** ******* ********** ** ********** *** ******* (******** ********* ******** **** ******).

Criteria *: ********* *** ********** ** *** ***** ***** ********/********

******* *** *** ***** ** *.***, ** ** ********* ** know *** ********** ** **** *****. *******, ** ** **** more ********* ** ********** **** **** ***** *.***. **** ** because ********* ** *** ***** *** *.*** *** **** *********** than ***** *** ***** (**** ****** ** ******** ***** *** our *****, *.*** ********* *********** *** ****** ***** ** *** complexity).By ***** **********, ** **** *** **** ******** ** ********* in *** ***** ** ***** **** *** *** *********. *** instance, * ****** ******* ** ***** ** * ***** **** is *** **** '*******' **** * ******* *******. ** *******, the **** *****, ******, *****, ******* *** ********* ** * scene, *** **** ******* **** ***** **** **.

*** **** ******* * ***** ** *** **** ********* **** be ****** ** ******** *** **** ******* *****. **** ** inherent ** *** ******.

******* *********, *** ********** ** * ***** *** ****** ********* on *** **** ** *** ** *** **** ** ****. For ********, * ***** ** ****** ******* ** * ***** room ** * *** **** ******* ***** **** **** **** lunchroom ** ******** **** *** ****** ** ******. ** ******** the **** *******, *** ****** **** ******* **** ********* *** the ****** **** * ***** ** ****** **** **** **** the ***** **** ** **********.

**** ******* ****** *** ***** *** **** ********* ****** ****** video ************ ** **** ******* ******** *** *********** ******** (** at ***** ********** ** ********).

** *** ***** ***** ** **** *** ********* *********** ******* for * ******* ** ****** ******:*** ****** ** ********** ** bandwidth ******* ************* ******* ***** *** *.***. ** *** *****, with *****, *** ********** ** ********* ****** *** *** ***** to **** ******* ****** **** ******** ** * ****** ** 3. *******, ** *** ***** **** *.***, *** ****** ** bandwidth ****** ****** ** ***** ** *****.

*** ***** ***** ********* *** ************ ******* ***** ********** *** bandwidth ******** *** ***** *** *.*** *** ****** ******:

*** *.*** ***** ******** ******* **** *********** ** *** ***** and *.*** ********** *****. *.***'* *** **** ******** *** ********* with **** ******* ****** ** ** ********* *.***'* ******* ** compress ****** ******. ** ********, ***** **** *** ******** ****** frames ** ** ***** **** **** **** ******* ******. *******, since ***** **** **** ** ******** ********** ****** *** ***** more ******* ****** ***** ******* **** *********, ***** ********* ******* does ******** *** **** ******** **** *.***.** ** * ******* that *****'* ********* ******* *** ******** ** **** *** ****** size **** *** **** **** **********. **** ************* *** ***** MJPEG ******* ** ***** ***** *****, ****** *** ********** **** MJPEG ** ********** *****. **** *** ****** ** **** ******* the ******** ** ********* **** *** ** ********** ** ********** limited *** *****. *******, **** **** ****** **** ****** ***** of ******* **** (** ********* ************).

**** ****** *.*** ****** *********** ********* ******* ****** *** *****, the ***** ***** ** ****** ******** *** ********* ***** ************ introduces * ****** ******* **** *** *** *********** **** *****.

Criteria *: ********* *** ********* **** / ******* ** *** ****** ***** ****

*** **** ********* ****** ** ********* **** ** ************* *** use ** ******** *** **** (***) **. ******** *** **** (VBR) *** *.***. ***** *** ***** **** **** ***** ***** size *** ** **** ****** ****** *** ***** ******* ******* or ********, **** ** ******** ** ***** *** *********** *** H.264.

**** ******** *** ****, *** ** ****** **** ******** *** same ********* ***** ********** ** *** *****'* **********. ** ********* is ************ ** ***** *** **********, ******* **** ** **********.

**** ******** *** ****, *** ** ****** **** **** ********* the ********* ***** ** **** *** ******* ****** **** *** scene's **********.

** *** ***** *****, ** **** *** *** *** **** changes ******* **** *** ***** ******* *** **** *** ** always **** *** ****:

********** **** *** ****** *******. **** ** ******** ** ********** and ** ********* ********* ***** ** *** *** ** *** streaming. *** ***** ** ************ ** ********** *** **** *********** loses **** ** *** ******** **** (****** ***** ***********). ****'* key **** ** *** '*****' *** *********** **. **** ** controlled ** *** ************ ***** - *** ****** *** *****, the ******* *** *********** *** *** ***** ******* *** ***** will ******.

**** ***, ** *** ********* ** ************, *** ** ****** provider **** ****** *******. **** *** ** ************ ** *** ways - ****** ******* ******* ** * ***** ***** ** reduce *** ****** ** ****** ********. ************* **** ** **** options **** ******* *** **** *** ******* ****** **. ** the ***** *****, ** **** ******** ** ********* ************* ****** conventions, ******** *** ******* *** *** ******* ***********.

** * **** ****, **** ***, ** *** ********* ***** is '*** ****' *** *** * *** ********** *****, *** quantization ***** **** ** *******, ********* *** * **** ******** compression. *********** *** **** *** *** ****** *** *********** **** are, ** *** ********* ** **** ***** ******** ** ******* benefits *** *** ****/***********.

** *** ** ****** ******** ***** *** ******* ** ****** the ******* ******* ** * ***** ***** **** **** ** done ******* ** ******** *** ************ *****

******* *** ************ ***** ** ** *** ***** ** *** H.264 ***** *** **** ***** **** ***** *****. ** *** video *****, ** **** *.*** *** ******* ** ******** *** rates. ***** * ****** ********, ** **** *** *** ************ level ****** *** *** **** ** ********** **** ******* ** visible ***** *******.

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

Should *** *** *** ** ***?

******** ** ******* ** *** *** ** *** *** *.*** is ******* *** **** ********* ******** ** ***** *.***. *** choice *** *********** ******* ** ********* *******, ****** ******* *** infrastructure ********.

** *** *** ***, *** ******** *** ******** ** **** infrastructure - ************ ** ******* ****** ** ****** *** ****** that **** ** ***** ***** ******** **** **** ********** ******* (e.g., ********, *******) *** **** **** ********* (*.*., ******* ******* VMS ********, ******* **********). **** ************** ***** *** * ****** multiplication ** ***** ******* ***** ****** ****.

*** *** ***** ********* ** ***** *** *** (*) ********* quality *********** ** (*) ************** ************. ** *** *** *** CBR **** *** *** *** **** *****'* **********, *** **** lose ****** ****** ** ******* ****** (** ********* *****). ** you *** *** *** **** *** ****, *** **** ***** storage *** ******* **** ********** ********* **** ****** *** **** video.

*** *** *** ******** ********* *** **********. **** ***, *** can ** ********* **** *** ******* ** **** ***** **** be **********. ****, *** ***** ****** ** ******* *** ********* will ** ********* ** *** *** **** **** **** *** fall ** ***** *** *****'* **********.

*** *** ******* *** *** ** **** ** ***** ************** planning **** *********. ******** **** ** ******** *** *********** ***** case ********* ** **** ******* ********.

***** *** *** *** *** *** *** **** ********** *** streaming *.***, ************* ************** *** ** ******** ** ******* *** two. ** *** *****, ** ***** * '******' ********** **** may ** ** ********:

  • ****'* ***, **** *** ** * *** **** *** *** for *** ********** ***** ****/**********, **** ******** '****-****' **** *** rate ******* *** ****** * *** **** **** *** ** significantly ******. *** ********** ** **** *** ******* ********** *** bit **** ** **** *** *** ** ******* ******** ***** to ********** *******. ***** **** ***** *****, ** *** ** an ********** ******** ** *** **** ******** **** ******* ** meet *** ********** *** ****.
  • ********* ****** * ********* ***** **** ******* *** ******* *** rates. ** ****, **** ** * *********** *** **** **** a ********** ***** ** *** *****. **** ******** **** *********** to ****** ****** ********** ******. *******, ** *** *****, **** feature *** *** ****** ** **** ** *********.

Criteria *: ********* *** ***** ** ***** ****** ** * ******

* *** **** ** *.***'* ***** ***** **** * ******. These *** *** ***** **** **** '********' *** ******** ** changes **** *** **** ******** ** * ******. ***** *** size ** * ****** *** **** (********* ** ***** **********/*******), usually * ****** *** *** ******* **** * ******. ** the ***** *****, ** **** *** **** ** * *** P ****** ** * ****** ********:

[****: ***** *** * ****** ** **** *** *** ************ majority ** ***** ************ *.*** *************** **** *** * ****** currently.]

*** **** * ****** ***** *** ** * ******, *** more ********* ******* **** *.*** ********. *** ********, * ***** with **** * * ***** *** ****** ******** *** **** bandwidth **** * ***** **** ** * ****** *** ****** (meaning ***** ***** ** ** * ***** *** ** * frames *** ********. *******, **** ******* ******* **** *****, ****** the *** * ***** ********* *** * **** ***** ********* reduction ******** ** *****. ** *** ***** *****, ** *********** these *********:

******* *** *** ***** ** ***** ****** ** * ****** can ** ********* *** ** ***** ******. ** ******* **** on **** *** ** ****** ************ ******** *** **** *** VMS ******* ** *********. ** *** **********, *** **** ****** I ***** **** ** * *** ****** (********** ** *** many ****** *** ****** ***** *** ********). *******, ************ ************ on * * ***** *** * ******* *** **** ****** Station ******** ** * * ***** *** ** * ****** (meaning **** ** *** ****** ** * ***, ** * frame **** **** ** ****/********* ***** ** *******).

*** ******* **** ** **** ******* * ***** ********* ** improve ***** ******** / *******. *** ****** *** * ***** interval, *** **** ****** ***** **** ** ****** ** ******** in ********** **** ** ******** *****. ***** * ****** **** 'describe' * **** ** *** *****, ** ** ********* *** possible ** ******* * **** ***** **-****** ***** ** * frame *******. **, *** ******* ** * ***** ** **** generated ***** ** *******, **** *** ****** ********* ********.

Sample *********** **** ********* ******* ************ ****

********* * ******** ****** ** **** ***** ** *.*** ******* or ********* ******** ** ***** ** *************. ** ******** ********* design ******** **** *** ************ ***** ***** ** ********** *** address.

** *** ***** ******* ** *** ******, ** ******* * setting ************ **** *********** ********* ********* ** *** *** ******* parameters ** ***** ******** ***********: (*) ***** **********, (*) * frame ****, (*) ***** **** *** (*) *** ** ***.

Scene ********** *********

Daytime ****** - H.264 bandwidth was 200 Kbps. By contrast, MJPEG bandwidth was 11.8Mbps, a 59x difference, and a 98% bandwidth savings. Image quality between both codecs were similar; we did not note any significant variances.

Daytime ****** **** ******** - H.264 bandwidth was 790 Kbps. MJPEG bandwidth was 13.71Mbps, a 17x difference, and a 94% bandwidth savings. No significant image quality differences observed.

Daytime ******* - H.264 bandwidth was 2.63 Mbps. By contrast, MJPEG bandwidth was 39.23Mbps, a 15x difference, and a 93% bandwidth savings. No significant differences in image quality observed.

Night ****** (* ***) - H.264 bandwidth was 720 Kbps. By contrast, MJPEG bandwidth was 13.27Mbps, a 18x difference, with a 95% bandwidth savings. Although both images look similar in quality, the MJPEG scene has a little more visible noise, while the H.264 image is a little softer.

Night ****** (***** *****) - H.264 bandwidth was 2.92 Mbps. By contrast, MJPEG bandwidth was 15.15 Mbps, a 5x difference, and 81% bandwidth savings. A totally black image in itself is not a complex scene, but the random camera noise on screen (which vary between vendors) raises the complexity significantly. Although it is not apparent on the exported clips or screencaps, we witnessed the MJPEG scene suffer from significantly more camera noise than the H.264 scene.

Night ******* - H.264 bandwidth was 1.89Mbps. By contrast, MJPEG bandwidth was 17.57 Mbps, a 9x difference, with 89% bandwidth savings. No significant image quality differences observed.

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

30fps, ** * ****** *** ****** ****** ******* - In this scenario, H.264 bandwidth was 3.48 Mbps. By contrast, MJPEG bandwidth was 11.8 Mbps, which shows a 3x difference. Although having a maximum I frame ratio, this scenario did not show any visible quality gain, but still having a bandwidth savings of 71% from the MJPEG scenario.

30fps, * * ***** *** ****** ****** ******* - In this scenario, H.264 bandwidth was 280 Kbps. By contrast, MJPEG bandwidth was 11.8 Mbps, which shows a 42x difference, and a 98% bandwidth savings. This being a default i frame configuration for many camera vendors, this scenario has no significant variances in MJPEG image quality.

Frame **** *********

1fps, * * ***** *** ****** ******* ******* - This scenario shows the H.264 bandwidth at 1.1Mbps. Contrasting this to a 1fps MJPEG scenario, with bandwidth consumption at 1.3 Mbps, a 1.2x difference, and 15% bandwidth savings. No obvious visual differences in quality. Contrast this to the example above for 30fps, 30 i frames. While the ratio of I frames to total frames is the same (1:1), the scene above is indoor daytime - delivering significantly enhanced bandwidth reduction because of the relatively simpler scene.

30fps, * * ***** *** ****** ******* ******* - H.264 bandwidth was 2.63 Mbps. Contrasting this to a 1fps MJPEG scenario, with a bandwidth consumption of 39.23 Mbps, a 15x difference, and 93% bandwidth savings . Quality wise, no obvious visual differences, but h264 clip is running slightly less frames at 27.99fps.

CBR ** *** *********
CBR ***** ***** ******* ******* - In this scenario, H.264 bandwidth was 2.24 Mbps. By contrast, MJPEG bandwidth consumption was 16 Mbps, a 7x difference. H.264 bandwidth savings was 86%. However, H,.264 stream exhibited clear visual degradation compared to the MJPEG stream.
CBR ***** ***** ******* ******* - In this scenario, H.264 bandwidth was 3.1 Mbps. Contrasting it to the same 16Mbps MJPEG scenario, shows a 5x difference, 80% bandwidth savings. Comparing to the previous scenario of 2Mbps, video quality was significantly improved and matched the visible quality of MJPEG.
VBR ***** ******* ******* - In this scenario, H.264 bandwidth was 2.63 Mbps. By contrast, MJPEG bandwidth was 6X. H.264 bandwidth savings was 84%. H.264 stream quality exhibited no deficincies relative to MJPEG.
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.

Other Reports on IP Cameras

IP Cameras Default Passwords Directory on May 28, 2016
Finding an IP camera's default password can be tedious or aggravating. And keeping up with changes in newer firmwares can be difficult, especially...
2016 Surveillance Camera Book Released on May 24, 2016
This is the best, most comprehensive security camera training in the world, based on our unprecedented testing. Now, all IPVM PRO Members can get...
Camera Course Spring 2016 on May 05, 2016
Here is what is new for the 2016 course: HD analog: Expanded coverage on non-IP HD offerings Smart CODECs: How many camera manufacturers are...
Network Ports for IP Video Surveillance Tutorial on Jan 20, 2016
Network ports are critical for remote video viewing and recording and without proper configuration, IP video will not work.  In this tutorial, we...
H.265 / HEVC Codec Tutorial on Jan 19, 2016
H.265 / HEVC has been promised for many years as the next big CODEC and the successor to H.264. Now with many H.265 IP cameras starting to ship,...
IP Camera Pricing and Markups Statistics 2015 on Dec 11, 2015
100+ integrators told IPVM their average IP camera pricing and markups. In this note, we share statistics on: The average IP camera pricing for...
Camera AoV / Focal Length Comparison on Nov 24, 2015
Use the IPVM Camera Calculator to better understand the tradeoffs between different Angle of Views (AoV) / focal lengths. The video below shows...
How a Security Camera is Made on Nov 18, 2015
While in China, we toured factories, seeing how cameras were made. In the 15 minute video inside, we show step by step how a camera is made /...
IP Camera Trolling - Cybersecurity Showcase on Nov 09, 2015
If you want to convince your customers about the importance of cybersecurity and the risk of being the next Hikvision, Foscam or Trendnet, show...
Network Connectors for IP Cameras Guide on Nov 05, 2015
Fewer installation tasks are as nuanced as terminating cables and attaching connectors. Fortunately, this task is easy to manage and get right if...

Most Recent Industry Reports

Axis OrwellLabs Exploit Tested on Jul 29, 2016
Another exploit has been reported for Axis cameras (OrwellLabs AXIS Authenticated Remote Command Execution), less than a month after Axis critical...
Hikvision 12MP IR 360 Tested on Jul 28, 2016
Hikvision has released their latest IR panoramic camera, the DS-2CD63C2F-IV, with a 12MP sensor.  To find out, we bought one of these new models...
Surveillance Recording Mode Statistics 2016 on Jul 28, 2016
Continuous? Motion? Boost? What recording should be used? What is used? This report compiles data from 90 integrators on storage modes most...
Nuvico Shutting Down - The Chinese Conclusion on Jul 27, 2016
Nuvico is shutting down. And this is the end game of the Hikvision and Dahua race to the bottom. [premium_content] Who is Nuvico? Nuvico, never...
Anixter Touts Selling to End Users on Jul 27, 2016
Anixter's track record of selling to end users inspires much negativity in the industry. But Anixter's CEO has a different take on it. In this...
Access Control Does Not Want ONVIF on Jul 27, 2016
ONVIF has become a major force in video surveillance. Despite its well deserved criticisms, ONVIF is widely embraced by video surveillance...
Imaging Developer Claims Massive Low-Light Improvements on Jul 27, 2016
In the early days of megapixel, binning was a crutch used to compensate for poor low-light performance.  Low-light sensitivity improvements have...
Hikvision Desperate And Destructive Slashing on Jul 27, 2016
Now a 20% across the board price cut. Hikvision has taken their price slashing to a whole other level. And it is bad news, for Hikvision and their...
Pivot3 Says Big Growth Despite 3 Top Execs Out on Jul 26, 2016
Pivot3's significant turnover continues, with 3 more executives out. However, Pivot3 responded to us saying this is all a normal part of their...
Panasonic Embraces Advidia OEMing of ACTi, Dahua and Hikvision on Jul 26, 2016
Clever move or surrender? When Panasonic bought Video Insight in 2015, the focus clearly was their VMS. But Video Insight also offered their...

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