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

Security Sales Course Summer 2018 on Jul 13, 2018
Based on member's interest, IPVM is offering a security sales course this summer. Register Now - IPVM Security Sales Course Summer 2018 This...
Last Chance - July 2018 IP Networking Course on Jul 12, 2018
Registration ends today, Thursday. Register now. This is the only networking course designed specifically for video surveillance...
Axis Perimeter Defender Video Analytics Tested on Jul 12, 2018
Axis 'high security' video analytics offering is Perimeter Defender, OEMed / developed with Digital Barriers. But how good is Perimeter Defender?...
Drops Dahua, Fenner Becomes ISS CMO on Jul 09, 2018
Hired to improve Dahua's miserable marketing just last year, Janet Fenner has quit Dahua, joining VMS manufacturer ISS as Chief Marketing...
UK VSaaS Startup Ocucon on Jul 03, 2018
Decreasing exposure to fraudulent slip-and-fall insurance claims and lawsuits is one of the oldest selling points of video surveillance for retail....
GDPR For Access Control Guide on Jul 03, 2018
Electronic access control is common in businesses plus organizations are increasingly considering biometrics for access control. With GDPR coming...
Digital Watchdog Low Cost 4MP Camera Tested on Jul 02, 2018
Based on member 4MP testing requests, we bought and tested Digital Watchdog's low-cost 4MP DWC-MTT4Wi to see how it performs in real world scenes,...
Replacing / Switching Access Control Systems Guide on Jun 28, 2018
Ripping out and replacing access control systems is hard for important reasons. Because users typically hold on to access control systems for as...
2018 Mid-Year Surveillance Industry Guide on Jun 28, 2018
2018 has been an explosive year for the video surveillance industry, with the industry becoming a global political issue, with the expansion of...
Panoramic Fisheye Camera Shootout - Avigilon, Axis, Dahua, Hanwha, Hikvision, Oncam And Vivotek on Jun 27, 2018
IPVM tested Avigilon, Axis, Dahua, Hanwha, Hikvision, Oncam And Vivotek 12MP panoramic fisheye cameras head to head, as shown in the test setup...

Most Recent Industry Reports

Security Sales Course Summer 2018 on Jul 13, 2018
Based on member's interest, IPVM is offering a security sales course this summer. Register Now - IPVM Security Sales Course Summer 2018 This...
US Tariffs Hit China Video Surveillance on Jul 13, 2018
Chinese video surveillance products avoided tariffs for the first two rounds. Now, in the third round, many video surveillance products will be...
Last Chance - July 2018 IP Networking Course on Jul 12, 2018
Registration ends today, Thursday. Register now. This is the only networking course designed specifically for video surveillance...
4 Most Difficult Camera Installs (Statistics) on Jul 12, 2018
Heavy housings, cumbersome brackets, heavy ladders required, and tricky field of view requirements will cause difficulties no matter the camera...
Axis Perimeter Defender Video Analytics Tested on Jul 12, 2018
Axis 'high security' video analytics offering is Perimeter Defender, OEMed / developed with Digital Barriers. But how good is Perimeter Defender?...
Hikvision Fights Ban - Claims 'Red Scare', Hires 14 Term Ex-Congressman on Jul 11, 2018
Hikvision is fighting back against the House Bill Ban of their products. Hikvision has hired one of the biggest lobbying firms, led by a 14 term...
Arecont Acquisition By Costar on Jul 11, 2018
Arecont Vision acquisition by Costar Technologies has been approved by the court, concluding the bankruptcy process triggered by Arecont's...
Amazon Ring Partners With Rapid Response For $10 Monitoring on Jul 10, 2018
Amazon's Ring alarm system is using Rapid Response for monitoring, IPVM has confirmed in our testing. Amazon is arguably the most feared new...
SIA Lobbyists Working On House Bill Ban of Dahua and Hikvision on Jul 10, 2018
While SIA is most known for ISC West, SIA maintains the industry's most significant lobbying organization to influence US government action. Last...
Eastern and SavvyTech Merge, Form ENS, Targets ADI on Jul 09, 2018
ADI, ENS is coming for you. Or, at least, they hope. Two US distributors, NY based EasternCCTV and California based SavvyTech have merged, to...

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