TCP vs UDP for Video Surveillance

Author: 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.

In this report, we share our test findings of the tradeoffs on video quality, latency, camera and VMS compatibility.

*** ** ***?

**** ****** *** *** *** ***** ************?

*** *** *** *** **** ** *** ** *** ***** industry *****, **** **** ********* *** ********** **** ** ***** to **** *******, ********, ***** **********, ***********, *** ****, ****** many ***** ** *** **** *** ********** ******* *** *** or *** ****** *** ** *** *****.

** **** ******, ** ***** *** **** ******** ** *** tradeoffs ** ***** *******, *******, ****** *** *** *************.

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

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

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

  • *** ***** ** **** ****** **** ********* ** ************ *** video ****** *****.
  • *** ***** ** ***** ***** **** ********* ** ************ *** video ****** *****.
  • ******* ******* *********** ******* *** *** ***.
  • ********* *** ******** *** **** ***** ********* **** ********* ********.
  • **** ******* ***** ** ** ******** **** ***.
  • ******** ***** ***** ** **** ***** ****** **** ***.
  • **** ** ******* ******* **** *** *** *** *** ********* ** ** *** **** ************ (**** *** ** *** API).
  • ***** **** ************* ** **** ************* ** ******* **** ******* for *** ** *** (******* ** ********, *****, ******* *** Milestone ******).

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

** *** ******** *****, ** **** *** ********** ** ***** quality ***** *** **. *** **** * ********* *** **/* connection. ****: *** * ***** ****** ** *** *********** ******* these *** *********,*** *** ******** *****.

**** ***** ***, ****** *** ****** ******, *** *******. ********** ** present, **** *** ******* ******* **** *** ***** ** *** scene ** *******.

*******, ** *** **** ***** ***** ***, ** *** *** substantial breakup *** ********* ** **** ** **** ** ***** ***** frames **** ******* *** ** ***** *** ********.

** ****** ***** *** ***** ** ****** ** **** *****. Users *** ************ ***** ******* (** ** .*** ****).

**** ***** ** ** ******* *******, **** ***** ********* *** ****** loss ********* *** ************* ********. *******, **** ***** ******* ** ****** loss *** *********** ********* *** **** *********** ****** ** ***** quality.

Impact ** *******

** ****** ******* ***** **** *** *** *** ** ******** cameras *** ***** ****** ********** ******* *** *** ** * dedicated *******. ******* ******** ***-***** *** ******, ********** ** ********. UDP's ************** ******, **** ** ***** **********, *** *********** ***** overhead *** ****** ****** ** * ****** *******.

*******, ** ********* (**** ** ****** ******** **** ***** ******* of *******) ** ******* (**** ** ***** ***** *****-*** ******** links, *.*. **** ************), *** *** ******* ***** ******* *********.

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

** ** *****, *** *** *** *** ******* **** ********* in ********* ************ ********, ** ***** ********** *** *** ********** overhead *** **** ****** ** **** **** ****.

*******, ** *********-********** ************ **** ** ****** ******* ** ******* connected *** *** ********, *** *** *** **** ****** ********** and *************:

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

** **** ******* ************, ** ** **** ********* **** ********* receive ****** ************ ** ******, ****** ***'* ***** ******** **** useful. ******* ******** *** ***** ******* ******, *** ****** ********* span **** **** * ******* ** ******, ******** *** ******** to ********* **** *** ******* ********** ** ******* *****. 

*******, ** **** ********* *** ** ** ******** *** ******* time ******* *** ***** *** ********* *** ** ********* (**** as *******), *** ****** ******** ** *** (**** ** ******** above) *** ** ********* ** ***, ** **** ****** ****** *** frames *** ****.

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

**** ********* * ****** *** * *** ********* **********, **** as ***** ** ***, *** ** *********. **** ***** ** ensure **** *** ****** ** ***** *** ******** *** ******** in *****.

** *** ** **** *** *********, **** ********* *** ****** the **** ** **** ***** *** ** **** *******. ** the *** ******* **** *****, ** *** ******* ** **** the ******'* **** ******* *** **** ** *** ****, * process ********* ********* *** ***, ****** ***** *********.

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

*********, ** ******* ******* **** *** *** *** *********, *** rarely ******* * ****** ********* *** ********* ******* *** ***. Instead, *** *** ********** ***** ******** ****** ** ****, ** **** cases *************, *** ** ****** *** ****** *********.

**** ** ******* ***/*** ******* ** ****** *****:

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

******** ****** ** ****** ******* ** ******** *********. *** ** used ** ******* *** **** *****, **** **** ****** ** recorder *** ******** ** ****** ******.

***********

***** ****** ** ****** ******* ** ******** ********* ** **** cases. *** ** *** ** *** ** ********** ** *** camera's *******, ***** ** ************ ***************. *******, ** ***** *** RTSP ******* ******** *** ** ******** ******** ** ********* "#*********=*" to *** ** ******* **** ****** *** ******, ***** * is *** ** ***, **** ** **** *******:

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

******* ****** ****** ************* ** ********. ** *******, ******* *** set ** "****", ***** ******** ** *** ********* ***, **** unicast ***, **** ***, ** *******, ** ***** ** ********. If ********* ** ***********, ******* *** ** ****. ** *** is ********** ***********, *** ** ****. **** ** ***** ** each ******'* ***** ****** *****:

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

** *******, ********* ******** ******** ** ******* ***** ***. *** is ********* ** **** ******* (*** *** ******** **** ***** below), *** *** *** ******* ******* **. **** ****** ** not ***** ** ** ** ********. *********** **** ****** ** client *** *** *** ****.

TCP *** ***

************ ******* ******** (***) *** **** ******** ******** (***) *** *** *** **** ****** **** ******* *********. **** ***** down **** **** ****** *** ******* *** ************ *** ********, but **** *** *** *********** **** **** **** **** ** less ******** *** ******** ********: 

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

*** ******** * ********** ** *** ** ******* *** *** communicating *******, ********* *** * ********* *******, ****** **** *** be ****. **** ************ ******, **** *** ** ******* ** ********* as ******** ****** *** **** *** ** ****, ********** ** ensure *** ******* ******, *** ** *** ****** *****.

** ********, *** **** *** ******* * ********** ** ******* prior ** ************. ******* *** ****** **** ** *** ********* without ********** ***** *********. ******* ** ****, ****** **** *** ****** are **** ****** ** ***.

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

**** ***** ***, *************** *** **** ** *** ********* ****** ***** every ************, ******** *** **** *** ********, *** ** *** proper *****. ******* ***** **** *** ******** ******** *** *************, until *** **** ** ******** ****.

******* *** ** **************, ** ***** ******** ** ********** ** performed. *** ****** **** *** **** ** ***** ** *** if *** ********* *** ******** *** ******* ** *** ***, it ****** ********* ******* *** **** ***. ******* *** ****** out ** ***** ** *** ** ***, ******* ******, *** no ************ ** ***** ** *** ******* ****** ** ****** lost *******.

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

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

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

May 2018 Camera Course on Apr 20, 2018
Save $50 on early registration until this Thursday, the 26th. Register now (save $50) for the Spring 2018 Camera Course This is the only...
April 2018 IP Networking Course on Apr 19, 2018
This is the last chance to register for our IP Networking course. Register now. NEW - 2 sessions per class, 'day' and 'night' to give you double...
'Best In Show' Fails on Apr 19, 2018
ISC West's "Best In Show" has failed. For more than a decade, it has become increasingly irrelevant as the selections exhibit a cartoon level...
Worst Access Control 2018 on Apr 18, 2018
Three access control providers stood out as providing the most problems for integrators. In this report, we analyze the answers to: "In the...
Axis VMD4 Analytics Tested on Apr 17, 2018
Axis is now on its 4th generation of video motion detection (VMD), which Axis calls "a free video analytics application." In this generation, Axis...
Key Control For Access Control Tutorial on Apr 16, 2018
End users spend thousands on advanced systems to keep themselves secure, but regularly neglect one of the lest expensive yet most important aspects...
Best and Worst ISC West 2018 on Apr 16, 2018
ISC West 2018 had strong attendance, modest overall new products, and a surge in Artificial Intelligence marketing. First, here are 20+...
GDPR For Video Surveillance Guide on Apr 12, 2018
The European Union’s General Data Protection Regulation (GDPR) comes into force on May 25, but there is much confusion and no clear guidelines on...
Eocortex / Macroscop VMS Company Profile on Apr 09, 2018
Eocortex is the international brand of Russian VMS manufacturer Macroscop. Macroscop was founded in 2008, and the Eocortex name created in 2013. We...
ISC West 2018 Access Control Rundown on Apr 06, 2018
For ISC West 2018, what is new and interesting in access control?  This rundown will bring you up to speed on the exhibitors, what they are...

Most Recent Industry Reports

Global Real-Time Video Surveillance - EarthNow on Apr 20, 2018
A new company, EarthNow, with backing from Bill Gates, Airbus and more, is claiming that: Users will be able to see places on Earth with a delay...
Dedicated Vs Converged Access Control Networks (Statistics) on Apr 20, 2018
Running one's access control system on a converged network, with one's computers and phones, can save money. On the other hand, hand, doing so can...
April 2018 IP Networking Course on Apr 19, 2018
This is the last chance to register for our IP Networking course. Register now. NEW - 2 sessions per class, 'day' and 'night' to give you double...
Rare Video Surveillance Fundraising - Verkada $15 Million on Apr 19, 2018
Fundraising in video surveillance (and the broader physical security market) has been poor recently. Highlights are few and far in between...
'Best In Show' Fails on Apr 19, 2018
ISC West's "Best In Show" has failed. For more than a decade, it has become increasingly irrelevant as the selections exhibit a cartoon level...
Security Camera Cleaning Frequency Statistics on Apr 18, 2018
150+ integrators told IPVM how often they clean cameras on customer's sites and why.  Inside we examine their answers and break down feedback...
Worst Access Control 2018 on Apr 18, 2018
Three access control providers stood out as providing the most problems for integrators. In this report, we analyze the answers to: "In the...
Axis VMD4 Analytics Tested on Apr 17, 2018
Axis is now on its 4th generation of video motion detection (VMD), which Axis calls "a free video analytics application." In this generation, Axis...
Arecont CEO And President Resign on Apr 17, 2018
This is good news for Arecont. Arecont's problems have been well known for years (e.g., most recently Worst Camera Manufacturers 2018 and starting...
Strong ISC West 2018, Says Manufacturers, GSX / ASIS Expected Weaker on Apr 17, 2018
Manufacturers say ISC West 2018 was strong, continuing the trend we have seen in 2017 results and 2016 results. However, those same 100...

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