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

IP Camera Cable Labeling Guide on Sep 14, 2018
Labeling cables can save a lot of money and headaches. While it is easy to overlook, taking time to label runs during installation significantly...
October 2018 Camera Course on Sep 13, 2018
Today is the last day to save $50 on the October 2018 Camera Course, register now. This is the only independent surveillance camera course,...
VMS Export Shootout - Avigilon, Dahua, Exacq, Genetec, Hikvision, Milestone on Sep 13, 2018
When crimes, accidents or problems occur, exporting video from one's video surveillance system is critical to proving incidents. But who does it...
Door Fundamentals For Access Control Guide on Sep 12, 2018
Assuming every door can be secured with either a maglock or an electric strike can be a painful assumption in the field. While those items can be...
Dahua Low-Cost 4MP Camera Tested (N44CL52) on Sep 10, 2018
4MP use continues to increase, especially in low-cost models, according to integrators in our 2018 Resolution Usage Statistics. We bought Dahua's...
IP Camera Cable Termination Guide on Sep 06, 2018
Terminating cables properly is critical to network performance, but it can be a tricky task with multiple steps. Fortunately, this task is easy to...
Access Control Course Fall 2018 on Sep 06, 2018
Registration IS CLOSED ends this Thursday. Register now. If you are looking to strengthen your ability to design and deploy access systems or...
Drain Wire For Access Control Reader Tutorial on Sep 04, 2018
An easy-to-miss cabling specification plays a key role in access control, yet it is commonly ignored. The drain wire offers protection for readers...
Directory Of 110+ Video Management Software (VMS) Suppliers on Aug 30, 2018
This directory provides a list of Video Management Software providers to help you see and research what options are available. Listing...
IP Camera Cabling Installation Guide on Aug 29, 2018
IPVM is preparing the industry's first Video Surveillance Installation book and our upcoming Video Surveillance Installation Course. We have...

Most Recent Industry Reports

Alexa Guard Expands Amazon's Security Offerings, Boosts ADT's Stock on Sep 21, 2018
Amazon is expanding their security offerings yet again, this time with Alexa Guard that delivers security audio analytics and a virtual "Fake...
UTC, Owner of Lenel, Acquires S2 on Sep 20, 2018
UTC now owns two of the biggest access control providers, one of integrator's most hated access control platforms, Lenel, and one of their...
BluePoint Aims To Bring Life-Safety Mind-Set To Police Pull Stations on Sep 20, 2018
Fire alarm pull stations are commonplace but police ones are not. A self-funded startup, BluePoint Alert Solutions is aiming to make police pull...
SIA Plays Dumb On OEMs And Hikua Ban on Sep 20, 2018
OEMs widely pretend to be 'manufacturers', deceiving their customers and putting them at risk for cybersecurity attacks and, soon, violation of US...
Axis Vs. Hikvision IR PTZ Shootout on Sep 20, 2018
Hikvision has their high-end dual-sensor DarkfighterX. Axis has their high-end concealed IR Q6125-LE. Which is better? We bought both and tested...
Avigilon Announces AI-Powered H5 Camera Development on Sep 19, 2018
Avigilon will be showcasing "next-generation AI" at next week's ASIS GSX. In an atypical move, the company is not actually releasing these...
Favorite Request-to-Exit (RTE) Manufacturers 2018 on Sep 19, 2018
Request To Exit devices like motion sensors and lock releasing push-buttons are a part of almost every access install, but who makes the equipment...
25% China Tariffs Finalized For 2019, 10% Start Now, Includes Select Video Surveillance on Sep 18, 2018
A surprise move: In July, when the most recent tariff round was first announced, the tariffs were only scheduled for 10%. However, now, the US...
Central Stations Face Off Against NFPA On Fire Monitoring on Sep 18, 2018
Central stations are facing off against the NFPA over what they call anti-competitive language in NFPA 72, the standard that covers fire alarms....
Hikvision USA Starts Layoffs on Sep 18, 2018
Hikvision USA has started layoffs, just weeks after the US government ban was passed into law. Inside this note, we examine: The important...

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