TCP vs UDP for Video Surveillance

By: Ethan Ace, Published on Mar 11, 2015

TCP or UDP?

What should you use for video surveillance?

TCP and UDP are both in use in the video industry today, each with strengths and weaknesses when it comes to live viewing, playback, error correction, artifacting, and more, though many users do not know the difference between the two or how choose one or the other.

*** ** ***?

**** ****** *** *** for ***** ************?

*** *** *** *** both ** *** ** the ***** ******** *****, each **** ********* *** weaknesses **** ** ***** to **** *******, ********, error **********, ***********, *** more, ****** **** ***** do *** **** *** difference ******* *** *** or *** ****** *** or *** *****.

** **** ******, ** share *** **** ******** of *** ********* ** video *******, *******, ****** and *** *************.

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

Key ******** ** ****

**** ** * ***** summary:

  • *** ***** ** **** frames **** ********* ** insufficient *** ***** ****** needs.
  • *** ***** ** ***** image **** ********* ** insufficient *** ***** ****** needs.
  • ******* ******* *********** ******* TCP *** ***.
  • ********* *** ******** *** live ***** ********* **** congested ********.
  • **** ******* ***** ** be ******** **** ***.
  • ******** ***** ***** ** have ***** ****** **** TCP.
  • **** ** ******* ******* both *** *** *** *** ********* ** ** *** user ************ (**** *** or *** ***).
  • ***** **** ************* ** what ************* ** ******* they ******* *** *** or *** (******* ** Avigilon, *****, ******* *** Milestone ******).

Impact ** ***** *******

** *** ******** *****, we **** *** ********** in ***** ******* ***** TCP **. *** **** a ********* *** **/* connection. ****: *** * brief ****** ** *** differences ******* ***** *** protocols,*** *** ******** *****.

**** ***** ***, ****** all frames ******, *** *******. Stuttering ** *******, **** the ******* ******* **** one ***** ** *** scene ** *******.

*******, ** *** **** scene ***** ***, ** can *** *********** ******* *** artifacts ** **** ** gaps ** ***** ***** frames **** ******* *** no ***** *** ********.

** ****** ***** *** clips ** ****** ** this *****. ***** *** also******** ***** ******* (** MB .*** ****).

**** ***** ** ** extreme *******, **** ***** ********* and ****** **** ********* *** demonstration ********. *******, **** small ******* ** ****** loss *** *********** ********* can **** *********** ****** on ***** *******.

Impact ** *******

** ****** ******* ***** both *** *** *** in ******** ******* *** found ****** ********** ******* the *** ** * dedicated *******. ******* ******** 250-300ms *** ******, ********** of ********. ***'* ************** design, **** ** ***** correction, *** *********** ***** overhead *** ****** ****** in * ****** *******.

*******, ** ********* (**** as ****** ******** **** large ******* ** *******) or ******* (**** ** those ***** *****-*** ******** links, *.*. **** ************), UDP *** ******* ***** latency *********.

Use ** ************

** ** *****, *** and *** *** ******* very ********* ** ********* surveillance ********, ** ***** correction *** *** ********** overhead *** **** ****** to **** **** ****.

*******, ** *********-********** ************ such ** ****** ******* or ******* ********* *** the ********, *** *** UDP **** ****** ********** and *************:

**** *******: *** ********* for Smoother *******

** **** ******* ************, it ** **** ********* that ********* ******* ****** notification ** ******, ****** UDP's ***** ******** **** useful. ******* ******** *** cause ******* ******, *** events ********* **** **** than * ******* ** frames, ******** *** ******** to ********* **** *** occured ********** ** ******* video. 

*******, ** **** ********* are ** ** ******** and ******* **** ******* the ***** *** ********* can ** ********* (**** as *******), *** ****** possible ** *** (**** in ******** *****) *** ** preferred ** ***, ** more ****** ****** *** frames *** ****.

*********: *** ********* ** ****** Errors

**** ********* * ****** via * *** ********* connection, **** ** ***** or ***, *** ** preferred. **** ***** ** ensure **** *** ****** of ***** *** ******** and ******** ** *****.

** *** ** **** for *********, **** ********* may ****** *** **** of **** ***** *** to **** *******. ** the *** ******* **** video, ** *** ******* it **** *** ******'* edge ******* *** **** in *** ****, * process ********* ********* *** TCP, ****** ***** *********.

VMS/Camera ***************

*********, ** ******* ******* both *** *** *** protocols, *** ****** ******* a ****** ********* *** switching ******* *** ***. Instead, *** *** ********** ***** protocol ****** ** ****, in **** ***** *************, and ** ****** *** manual *********.

**** ** ******* ***/*** support ** ****** *****:

******** ******* ******

******** ****** ** ****** control ** ******** *********. UDP ** **** ** default *** **** *****, both **** ****** ** recorder *** ******** ** client ******.

***********

***** ****** ** ****** control ** ******** ********* in **** *****. *** of *** ** *** is ********** ** *** camera's *******, ***** ** manufacturer ***************. *******, ** ONVIF *** **** ******* protocol *** ** ******** selected ** ********* "#*********=*" to *** ** ******* when ****** *** ******, where * ** *** or ***, **** ** this *******:

******* ******** ******

******* ****** ****** ************* of ********. ** *******, cameras *** *** ** "auto", ***** ******** ** use ********* ***, **** unicast ***, **** ***, to *******, ** ***** of ********. ** ********* is ***********, ******* *** is ****. ** *** is ********** ***********, *** is ****. **** ** found ** **** ******'* video ****** *****:

********* ********

** *******, ********* ******** connects ** ******* ***** TCP. *** ** ********* in **** ******* (*** the ******** **** ***** below), *** *** *** cameras ******* **. **** simply ** *** ***** it ** ** ********. Connections **** ****** ** client *** *** *** only.

TCP *** ***

************ ******* ******** (***) *** **** ******** ******** (***) *** *** *** **** widely **** ******* *********. Both ***** **** **** into ****** *** ******* for ************ *** ********, but **** *** *** differences **** **** **** more ** **** ******** for ******** ********: 

**********-******** **. **************

*** ******** * ********** be *** ** ******* the *** ************* *******, performed *** * ********* process, ****** **** *** be ****. **** ************ begins, each *** ** ******* is ********* ** ******** before *** **** *** is ****, ********** ** ensure *** ******* ******, and ** *** ****** order.

** ********, *** **** not ******* * ********** be ******* ***** ** transmitting. ******* *** ****** sent ** *** ********* without ********** ***** *********. Because ** ****, ****** **** and ****** *** **** common ** ***.

***** ********

**** ***** ***, *************** *** sent ** *** ********* device ***** ***** ************, ensuring *** **** *** received, *** ** *** proper *****. ******* ***** were *** ******** ******** are *************, ***** *** data ** ******** ****.

******* *** ** **************, no ***** ******** ** correction ** *********. *** sender **** *** **** or ***** ** *** if *** ********* *** received *** ******* ** one ***, ** ****** continues ******* *** **** set. ******* *** ****** out ** ***** ** not ** ***, ******* errors, *** ** ************ is ***** ** *** sending ****** ** ****** lost *******.

**** **** *********.

***** **** ** **** * * question ****

Comments (16)

How many hops did you simulate?

It appears the testing was LAN-only. In modern LANs hops aren't really going to have a measurable impact, unless you're doing some kind of PHY bridging (eg: wired to wireless to wired) and even then it's usually not a first order consideration.

A better test (IMO) would have been to load up a network to 60% capacity and show the effects of TCP and UDP or to calculate the additional overhead of TCP and approximate how many streams it would take before that started to becomes a significant impact (eg: the equivalent of 3 more video streams).

Still, this was a great example of the basic differences between the two streaming options and the trade-offs.

In the past I have seen instances where UDP or TCP would cause, or even fix streaming issues.

For example, if I was streaming H.264 through VLC using a UDP connction I may see artifacting as shown in the example above (packet loss, delay, etc). However when flipping to a TCP connection, the artifacting may go away completely (due to packets being retransmitted if lost or delayed).

However, there is no right or wrong way to do it. Choose the right protocol for your environment (if it's even changeable). It was interesting to see the VMS results and what they have available.

Based on your comments, I would think that (assuming network bandwidth and server capacity was not an issue), multi-streaming two otherwise identical streams, one for live view via UDP and one for recording via TCP, would be ideal.

But since you don't actually say that I'm wondering if there is a reason, like maybe most cameras or VMSes can't support such a configuration? Or?

Most do not support it. Genetec's stream setup lets you pick UDP or TCP per stream, and assign each stream to specific uses, so you could do it there.

Others only allow you to set UDP or TCP per camera, and others, as mentioned, not at all.

Hi Ethan, I found your article particularly useful in the context of video surveillance.

The article noted that choosing TCP may lead to the video stuttering and the subject jumping from one point in the scene to another. By contrast, UDP may provide smoother viewing of live video but can lead to smearing. However in watching the TCP and UDP videos, it seemed to me that the UDP video was not only smeared but was not smooth. It appeared to be jerky and the subject seemed to jump from one point in the scene to another with a vague ghost image joining the two points. Based on these sample videos, I don't think I would ever want to choose UDP. TCP might be jumpy but at least it is crystal clear. UDP seemed jumpy and smeared.

If a poll was run, I wonder whether TCP or UDP would be more popular for low bandwidth networks?

"If a poll was run, I wonder whether TCP or UDP would be more popular for low bandwidth networks?"

I don't think enough people know or have ever considered which to choose. I am sure there are some but I doubt there would be enough to make the poll useful.

I'd agree, and also mention that oftentimes there is no option to choose. It would be a purely hypothetical question, not practical, since many or most VMSes make the selection for you. You're probably using UDP without even knowing!

Thanks John. I'm sure you're right but I found your answer funny too.

Hi Ethan, the article states the following about recording video:

When recording a camera via a low bandwidth connection, such as cable or DSL, TCP is preferred. This helps to ensure that all frames of video are received and recorded in order.

This makes it sound as though recorded video won't suffer from stuttering or the subject jumping from one point to another in the scene. However the quizz asks:

If using TCP on a congested network, where frames are delayed, what best describes the effect it will show while playing back video?

Several negative effects are provided as possible answers. If all the frames of video are received and recorded in order, then playing back the video should not show any negative effect which seems to contradict the quizz question. I am confused by what is meant and would appreciate your clarification. Thank you for your help.

If all the frames of video are received and recorded in order, then playing back the video should not show any negative effect which seems to contradict the quizz question.

How so? Even if the video is recorded perfectly, the playback stream itself will still be affected by a congested network.

One way to tell if the degradation is due to the way the stream was recorded or just a playback issue is by replaying the same clip over and over. If it plays back the same section every time the same way, (including stuttering) then it's the recorder, if it's doesn't it's a playback issue.

Hey Luke,

The question is referring to a specific instance, playback.

So regardless of what happened with the video getting to the recorder, if there are delays on the network while trying to play back the data from the recorder you can see negative effects just on playback (that may or may not have been there on the recorded video).

Keep in mind that anytime data traverses a network it will require bandwidth to do so.

If there are questions about 'where' the symptom started, I agree with 'B'. You can playback the video multiple times to see if the problems are consistent or not. Or you can go directly to the server where the data resides and playback from there (if available), so the data does not need to traverse the network during playback.

Hi Matt and "B", thanks for setting me straight. I mixed up a couple of points which led to my misunderstanding.

The article referred to recording over a low bandwidth connection and went on to say that using TCP would help to ensure that all frames of video are received and recorded in order. I then wrongly thought the quizz question was about playing back that video locally after it had been recorded from a remote source. Now you've both helped me to realize where I made my mistake. Thanks very much. I understand this article properly now.

This was great info and never really explained this well during camera manufactorers trainings Thanks.

Hi Ian,

I agree. Most manufacturer trainings that I've experienced don't get into this level of detail.

Many times, cameras will support both and provide what the VMS or client is asking for. So there is no 'reason' for them to address this in their own training.

They are mostly interested in getting you to know their product and how to use/sell it.

My understanding on this is that if realtime viewing isn't a critical issue, I choose TCP. Only if I need live realtime (with little or no delay) I'd use UDP.

TCP has error correction so it is more likely that we get all of the video.

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

Genetec Beats Milestone For IHS #1 on Jun 21, 2019
For years, Milestone has touted that they are the #1 VMS. Now, Genetec has beaten them in IHS rankings. But what is this? Even other manufacturers...
Exacq Remote Cloud Access Tested on Jun 20, 2019
Remote cloud access has been missing from most VMSes (including Exacq and Milestone). Now, Exacq, after releasing Cloud Drive Storage earlier in...
Repositionable Multi-Imager Camera Shootout - Avigilon, Axis, Dahua, Hanwha, Hikvision, Panasonic, Vivotek on Jun 19, 2019
Repositionable multi-imager cameras are one of the fastest growing segments in video surveillance, with a slew of new offerings being recently...
Sighthound Transforms Into Enterprise AI Provider Profile on Jun 14, 2019
Sighthound is now rapidly expanding its R&D team, building an enterprise AI service. This may come as a surprise given their origins 6 years...
Farpointe Data Conekt Mobile Access Reader Tested on Jun 13, 2019
California based Farpointe Data has been a significant OEM supplier of conventional access readers for years to companies including DMP, RS2, DSX,...
Embattled $400 Million China Funded Philippines Surveillance System Proceeds on Jun 13, 2019
An embattled 12,000 camera surveillance system project that will cost ~$400 million will proceed.  The project contract was awarded, had its...
Manufacturer Favorability Guide 2019 on Jun 12, 2019
The 259 page PDF guide may be downloaded inside by all IPVM members. It includes our manufacturer favorability rankings and individual...
Camera Course Summer 2019 - Register Now on Jun 12, 2019
Register for the Summer 2019 Camera Course.  This is the only independent surveillance camera course, based on in-depth product and technology...
Favorite Wireless Manufacturers 2019 on Jun 12, 2019
Many wireless options exist for video surveillance but how are integrator's overall favorites? 170 integrators answered the question: What is...
Carnegie Mellon AI Startup Zensors Profile on Jun 11, 2019
Zensors is a startup formed by Carnegie Mellon graduates from a Carnegie Mellon research project, offering customized models per camera that they...

Most Recent Industry Reports

Hikvision Colorvu Camera Tested on Jun 24, 2019
Hikvision says their new ColorVu line captures "vivid chromatic images in darkness", with unconventional white light illuminations whereas most...
China Subway Facial Recognition System Examined on Jun 24, 2019
A China city of 6+ million people has installed facial recognition-enabled gates in subways, allowing commuters to enter stations by simply showing...
HID Mobile Tested on Jun 21, 2019
HID Global is one of the largest access brands, but their mobile access has had challenges. Indeed, the company has already restructured their...
Genetec Beats Milestone For IHS #1 on Jun 21, 2019
For years, Milestone has touted that they are the #1 VMS. Now, Genetec has beaten them in IHS rankings. But what is this? Even other manufacturers...
Risk of Amazon Alexa Guard: No Battery Or Cell Backup on Jun 20, 2019
Amazon positions its Alexa Guard Service as a "smart home security system" and says it can help you "keep your home safe". However, the...
Exacq Remote Cloud Access Tested on Jun 20, 2019
Remote cloud access has been missing from most VMSes (including Exacq and Milestone). Now, Exacq, after releasing Cloud Drive Storage earlier in...
Briefcam Buys Frost Award* on Jun 20, 2019
Frost 'awards' are well-known and widely disrespected. Now Briefcam is touting their win. The way it has worked for many years is that Frost...
IFSEC 2019 Show Report on Jun 19, 2019
The UK's largest trade show, IFSEC, is underway and IPVM has been examining what is new and happening at the show. Inside, we cover: Huawei...
Repositionable Multi-Imager Camera Shootout - Avigilon, Axis, Dahua, Hanwha, Hikvision, Panasonic, Vivotek on Jun 19, 2019
Repositionable multi-imager cameras are one of the fastest growing segments in video surveillance, with a slew of new offerings being recently...
Genetec Synergis Cloud Link - Complex, Costly and Confusing on Jun 18, 2019
Genetec's Synergis Cloud Link is complex, costly and confusing compared to competitor access control architectures. Inside this note, we examine...

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