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

Anyvision Facial Recognition Tested on Aug 21, 2019
Anyvision is aiming for $1 billion in revenue by 2022, backed by $74 million in funding. But does their performance live up to the hype they have...
Dahua 4K Camera Shootout on Aug 20, 2019
Dahua's new Pro Series 4K N85CL5Z claims to "deliver superior images in all lighting and environmental conditions", but how does this compare to...
Installation Course - Register Now on Aug 15, 2019
Register Now for the September 2019 Video Surveillance Install Course. This is a unique installation course in a market where little practical...
Biometrics Usage Statistics 2019 on Aug 13, 2019
Biometrics are commonly used in phones, but how frequently are they used for access? 150+ integrators told us how often they use biometrics,...
Proactive CCTV "Only Affordable Video Archiving Solution" Profile on Aug 12, 2019
Proactive CCTV is claiming to offer "the only affordable video archiving solution on the market", reducing the storage typically required for H.265...
Milestone "GDPR-ready" Certification Claim Critiqued on Aug 12, 2019
Milestone is touting that its latest XProtect VMS is "GDPR-ready" with a 'European Privacy Seal'. However, our investigation raises significant...
Axis Door Station A8207-VE Tested on Aug 07, 2019
Axis newest door station, the A8207-VE, claims to deliver "video surveillance, two-way communication, and access control" in a single device. But...
Avigilon Blue VSaaS Tested on Aug 05, 2019
Avigilon says Blue is a "powerful integrator cloud service platform", easy to set up and configure, quickly scale business, by leveraging cloud...
Hikvision 4K Camera Shootout on Aug 02, 2019
With their latest Smart Series 5 cameras, Hikvision is claiming cameras "fully loaded" with "state-of-the-art technology for high performance and...
Cisco Settles False Claims Act Suit For Video Surveillance Vulnerabilities on Aug 01, 2019
Cisco entered the video surveillance market in 2007 and suffered for many years through a variety of its own errors and arrogance. The conclusion...

Most Recent Industry Reports

Dahua 4K Camera Shootout on Aug 20, 2019
Dahua's new Pro Series 4K N85CL5Z claims to "deliver superior images in all lighting and environmental conditions", but how does this compare to...
ZK Teco Atlas Access Control Tested on Aug 20, 2019
Who needs access specialists? China-based ZKTeco claims its newest access panel 'makes it very easy for anyone to learn and install access control...
Uniview Beats Intel In Trademark Lawsuit on Aug 19, 2019
Uniview has won a long-running trademark lawsuit brought by Intel, with Beijing's highest court reversing an earlier Intel win, centered on...
Verkada People And Face Analytics Tested on Aug 16, 2019
This week, Verkada released "People Analytics", including face analytics that they describe is a "game-changing feature" that "pushes the...
Dahua OEM Directory 2019 on Aug 16, 2019
US Government banned Dahua OEMs for dozens of companies. The following directory includes 40+ of those companies with a graphic and links to...
Installation Course - Register Now on Aug 15, 2019
Register Now for the September 2019 Video Surveillance Install Course. This is a unique installation course in a market where little practical...
Axis Suffers Outage, Provides Postmortem on Aug 15, 2019
This week, Axis suffered an outage impacting their website and cloud services. Inside this note, we examined what happened, what was impacted...
Hikvision Scrutinized In The Netherlands on Aug 15, 2019
Hikvision is facing unprecedented scrutiny in the Netherlands, at the same time the US government ban has taken effect. This week, a Dutch...
Axis 4K Camera Shootout 2019 on Aug 14, 2019
Axis' 4K Q3518-LVE claims the "best video quality possible", with Lightfinder super low light performance, Axis' high end Forensic WDR, and...

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