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

FLIR Launches Body Cameras Unified With VMS (TruWitness) on Dec 11, 2018
While FLIR is best known for their thermal cameras, now they have expanded into body cameras, launching TruWITNESS, a public safety focused body...
The 2019 Video Surveillance Industry Guide on Dec 10, 2018
The 300 page, 2019 Video Surveillance Industry Guide, covers the key events and the future of the video surveillance market, is now available,...
Multi-Factor Access Control Authentication Guide on Dec 10, 2018
Can a stranger use your credentials? One of the oldest problems facing access control is making credentials as easy to use as keys, but restricting...
Ubiquiti $79 Flex IP Camera Tested on Dec 07, 2018
U.S. Manufacturer Ubiquiti has released a 1080p, integrated IR IP camera, selling it directly for $79, making this one of the least expensive IP...
Infinova's Xinjiang Business Examined on Dec 07, 2018
As pressure mounts for companies to stop doing business in China’s Xinjiang region amid a severe human rights crisis, IPVM has found Infinova sold...
VMS Live Monitoring Shootout - Avigilon, Dahua, Exacq, Genetec, Hikvision, Milestone, Network Optix on Dec 05, 2018
Viewing live video is the first interaction and most common task most users have with a VMS. Who does it best and worst? Who offers the most...
Fullerton Returns, Joins OpenEye on Dec 04, 2018
Eric Fullerton became one of the most famous people in the industry as the Chief Sales and Marketing Officer of Milestone as Milestone became the...
Hanwha L Series Lowest-Cost Camera Tested on Dec 04, 2018
Hanwha has released their lowest-priced IP camera line ever, the L series, that competes on price with low cost competitors Dahua and...
Cybersecurity Insurance For Security Integrators on Nov 29, 2018
Most security industry professionals carry insurance to cover themselves in the event of a general loss. However, most are not carrying cyber...
Security Sales Course 2019 on Nov 29, 2018
The next IPVM Security Sales Course starts in January 2019. This sales course is customized for the needs and challenges specific to...

Most Recent Industry Reports

Foolish Strategy: OEMing Facial Recognition on Dec 13, 2018
Almost as 'hot' as face recognition marketing right now is OEMing facial recognition. Last year, they were a who's who of company's with...
DVR Examiner - Video Recovery from Recorder Hard Drives on Dec 13, 2018
Bypassing passwords and long download times on-site, DVR Examiner collects and organizes video evidence directly from a hard drive extracted from...
2019 Access Control Book Released on Dec 12, 2018
This is the best, most comprehensive access control book in the world, based on our unprecedented research and testing has been significantly...
Huawei Hisilicon Quietly Powering Tens of Millions of Western IoT Devices on Dec 12, 2018
Huawei Hisilicon chips are powering, at least, tens of millions of Western IoT devices, such as IP cameras and surveillance recorders, a fact that...
FLIR Launches Body Cameras Unified With VMS (TruWitness) on Dec 11, 2018
While FLIR is best known for their thermal cameras, now they have expanded into body cameras, launching TruWITNESS, a public safety focused body...
Startup Sunflower Labs' Autonomous Drone Security System on Dec 11, 2018
Startup Sunflower Labs is claiming a unique design on a home security system, combining autonomous drones and 'Sunflower' sensors. Imagine an...
The 2019 Video Surveillance Industry Guide on Dec 10, 2018
The 300 page, 2019 Video Surveillance Industry Guide, covers the key events and the future of the video surveillance market, is now available,...
Multi-Factor Access Control Authentication Guide on Dec 10, 2018
Can a stranger use your credentials? One of the oldest problems facing access control is making credentials as easy to use as keys, but restricting...
Top 2019 Trend - AI Video Analytics on Dec 10, 2018
160+ Integrators answered: What do you think the top industry trend will be in 2019? Why? AI / video analytics was the run-away winner with...
AV Tech Company Profile on Dec 07, 2018
Taiwanese manufacturer AV Tech's revenue declined ~70% since 2012. Planning a comeback, AV Tech spoke to IPVM about their opportunities 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