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 (27)

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.

An old thread yes, but thought I'd share my recent experience with TCP vs UDP on my 700+ camera Qognify Ocularis system -

All (Hanwha & Samsung) cameras using UDP would drop camera connectivity 50-100 times total in a 24 hour period.

All cameras since switched to TCP drop individual camera connectivity 5-10 times total in a 24 hour period.

I don't know why the results are so radically different, but I'm sticking with TCP.

what’s the network utilization?

No quick answer for this but network availability shouldn't be the issue as all switches are newer 10GB and connected back to our centralized datacenter via government fiber network.

Some would question if that’s an acceptable level.

Some would question if that’s an acceptable level.

if by ‘drop camera connectivity’ u3 means the socket drops and the VMS has to (automatically) create a new one, imho, it’s a glitch lasting 2-3 seconds, and for 700 cameras over 24 hours, 5-10 doesn’t seem out of line.

if it requires any actual user intervention or if the recover period is longer than a few seconds, i agree it’s unacceptable.

As an update, newer versions of Avigilon do allow for a choice of TCP or UDP. In the camera connect/disconnect menu, there is a selection for "LAN" (UDP) or "WAN" (TCP).

Never use UDP. UDP is a sign of a weak protocol implementation and it's not secure. Get a life and use TCP connections.

Get a life and use TCP connections.

How do I configure a TCP Multu-cast, asking for a friend? Never is a long time.

Would a dual IP camera (IR) have issue using UDP say like Axis?

Would a dual IP camera (IR) have issue using UDP say like Axis?

No issues. Most surveillance video defaults to UDP unless you force something else. For example you could set RTSP over TCP in Milestone as shown in the original article.

Login to read this IPVM report.

Related Reports

Converged vs Dedicated Networks For Surveillance Tutorial on Feb 12, 2020
Use the existing network or deploy a new one? This is a critical choice in...
Video Analytics 101 on Mar 16, 2020
This guide teaches the fundamentals of video surveillance...
Video Surveillance History on May 06, 2020
The video surveillance market has changed significantly since 2000, going...
Uniview Deep Learning Camera Tested on Jul 14, 2020
Uniview's intrusion analytics have performed poorly in our shootouts. Now,...
Injes Tiny Temperature Terminal Tested on Jul 17, 2020
While temperature terminals have trended bigger, the Injes DFace801 is...
AI/Smart Camera Tutorial on Feb 20, 2020
Cameras with video analytics, sometimes called 'Smart' camera or 'AI'...
Video Surveillance Cameras 101 on Feb 25, 2020
Cameras come in many shapes, sizes and specifications. This 101 examines the...
Facial Recognition: Weak Sales, Anti Regulation, No Favorite, Says Security Integrators on Jul 07, 2020
While facial recognition has gained greater prominence, a new IPVM study of...
Integrated IR Camera Shootout 2020 - Avigilon, Axis, Bosch, Dahua, Hanwha, Hikvision, Panasonic, Uniview, Vivotek on Jan 30, 2020
The best and worst cameras tested in this IPVM shootout showed major...
Fever Camera Sales From Integrators Surveyed on Jun 01, 2020
Fever cameras are the hottest trend in video surveillance currently but how...
Cheap Camera Problems at Night on Feb 19, 2020
Cheap cameras generally have problems at night, despite the common perception...
HLC Camera Shootout - Avigilon, Axis, Dahua, Hanwha, Hikvision, Panasonic, Uniview, Vivotek on Mar 02, 2020
Highlight Compensation (HLC) claims to reduce the effects of strong light...
Monitoreal "Completely Autonomous" Home AI Tested on Feb 12, 2020
Monitoreal claims to allow users to "see the things you want (people,...
Vivotek LPR Camera Tested on Apr 15, 2020
Vivotek has historically sold license plate capture cameras but not LPR. Now,...
NetApp Video Surveillance Profile on Mar 09, 2020
NetApp is increasing its efforts in video surveillance and told IPVM...

Recent Reports

Huawei HiSilicon Shortage Impacts Surveillance Manufacturers on Aug 14, 2020
Huawei acknowledged problems and challenges for its HiSilicon chip business,...
Final Rule Does Not Expand Hikvision Dahua Blacklist on Aug 14, 2020
The final White House rule (200.216) has been added and contrary to the...
Taiwan Lilin NDAA Compliant Cameras Tested on Aug 13, 2020
Taiwan-based manufacturer Lilin is taking direct aim at Dahua and Hikvision...
White House Expands Dahua Hikvision Blacklist To Federal Funding [Final Rule Reverses] on Aug 13, 2020
The White House is expanding the NDAA to blacklist anyone who "uses" banned...
Actual Coronavirus Testing Options Examined on Aug 13, 2020
Fever cameras have emerged as an indirect and flawed way to test for...
Video Analytics Online Show September 2020 Opened - Axis, Avigilon, Bosch, BriefCam, Genetec, Milestone + 30 More on Aug 12, 2020
IPVM's sixth online show will feature 35+ Video Analytics companies...
The German Company Powering Many China Temperature Tablets (Heimann) on Aug 12, 2020
Many fever tablet suppliers market German-made Heimann thermal sensors while...
Salesforce Drops Dahua and Hikvision on Aug 12, 2020
Salesforce has dropped Dahua and Hikvision as customers, forcing the two mega...
Access Control Course Fall 2020 - Register Now on Aug 12, 2020
IPVM offers the most comprehensive access control course in the industry....
Genetec CEO Declares "We Don't Negotiate Payment With Patent Trolls" on Aug 11, 2020
Are patent trolls like terrorists? Genetec's CEO is coming out strongly...
Hanwha AI Analytics Camera Tested on Aug 11, 2020
Hanwha has released their Wisenet P AI camera, adding person and vehicle...
Alabama Schools Million Dollar Hikvision Fever Camera Deal on Aug 11, 2020
The Baldwin County, Alabama public schools purchased a $1 million, 144-camera...
Dahua Taunts Australian Government, Continues To Sell Illegal Fever Cameras on Aug 10, 2020
Dahua is effectively taunting the Australian government by continuing to sell...
HID Releases VertX Replacement Aero on Aug 10, 2020
HID is replacing two established and broadly supported types of access...
NDAA Compliant Video Surveillance Whitelist on Aug 10, 2020
This report aggregates video surveillance products that manufacturers have...