TCP vs UDP for Video Surveillance

Published Mar 11, 2015 04:00 AM

*** ** ***?

**** ****** *** *** *** ***** surveillance?

*** *** *** *** **** ** use ** *** ***** ******** *****, each **** ********* *** ********** **** it ***** ** **** *******, ********, error **********, ***********, *** ****, ****** many ***** ** *** **** *** difference ******* *** *** ** *** choose *** ** *** *****.

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

  • *** ***** ** **** ****** **** bandwidth ** ************ *** ***** ****** needs.
  • *** ***** ** ***** ***** **** bandwidth ** ************ *** ***** ****** needs.
  • ******* ******* *********** ******* *** *** UDP.
  • ********* *** ******** *** **** ***** streaming **** ********* ********.
  • **** ******* ***** ** ** ******** with ***.
  • ******** ***** ***** ** **** ***** errors **** ***.
  • **** ** ******* ******* **** *** and *** *** ********* ** ** *** **** ************ (only *** ** *** ***).
  • ***** **** ************* ** **** ************* or ******* **** ******* *** *** or *** (******* ** ********, *****, Genetec *** ********* ******).

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

** *** ******** *****, ** **** the ********** ** ***** ******* ***** TCP **. *** **** * ********* 768 **/* **********. ****: *** * brief ****** ** *** *********** ******* these *** *********,*** *** ******** *****.

**** ***** ***, ****** *** ****** ******, but *******. ********** ** *******, **** the ******* ******* **** *** ***** in *** ***** ** *******.

*******, ** *** **** ***** ***** UDP, ** *** *** *********** ******* *** artifacts ** **** ** **** ** video ***** ****** **** ******* *** no ***** *** ********.

** ****** ***** *** ***** ** detail ** **** *****. ***** *** also******** ***** ******* (** ** .*** file).

**** ***** ** ** ******* *******, with ***** ********* *** ****** **** ********* *** demonstration ********. *******, **** ***** ******* of ****** **** *** *********** ********* can **** *********** ****** ** ***** quality.

Impact ** *******

** ****** ******* ***** **** *** and *** ** ******** ******* *** found ****** ********** ******* *** *** on * ********* *******. ******* ******** 250-300ms *** ******, ********** ** ********. UDP's ************** ******, **** ** ***** correction, *** *********** ***** ******** *** little ****** ** * ****** *******.

*******, ** ********* (**** ** ****** networks **** ***** ******* ** *******) or ******* (**** ** ***** ***** multi-hop ******** *****, *.*. **** ************), UDP *** ******* ***** ******* *********.

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

** ** *****, *** *** *** may ******* **** ********* ** ********* surveillance ********, ** ***** ********** *** its ********** ******** *** **** ****** to **** **** ****.

*******, ** *********-********** ************ **** ** remote ******* ** ******* ********* *** the ********, *** *** *** **** unique ********** *** *************:

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

** **** ******* ************, ** ** most ********* **** ********* ******* ****** notification ** ******, ****** ***'* ***** overhead **** ******. ******* ******** *** cause ******* ******, *** ****** ********* span **** **** * ******* ** frames, ******** *** ******** ** ********* what *** ******* ********** ** ******* video. 

*******, ** **** ********* *** ** be ******** *** ******* **** ******* the ***** *** ********* *** ** tolerated (**** ** *******), *** ****** possible ** *** (**** ** ******** above) *** ** ********* ** ***, ** more ****** ****** *** ****** *** seen.

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

**** ********* * ****** *** * low ********* **********, **** ** ***** or ***, *** ** *********. **** helps ** ****** **** *** ****** of ***** *** ******** *** ******** in *****.

** *** ** **** *** *********, edge ********* *** ****** *** **** of **** ***** *** ** **** packets. ** *** *** ******* **** video, ** *** ******* ** **** the ******'* **** ******* *** **** in *** ****, * ******* ********* performed *** ***, ****** ***** *********.

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

*********, ** ******* ******* **** *** and *** *********, *** ****** ******* a ****** ********* *** ********* ******* the ***. *******, *** *** ********** ***** protocol ****** ** ****, ** **** cases *************, *** ** ****** *** manual *********.

**** ** ******* ***/*** ******* ** common *****:

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

******** ****** ** ****** ******* ** protocol *********. *** ** **** ** default *** **** *****, **** **** camera ** ******** *** ******** ** client ******.

***********

***** ****** ** ****** ******* ** protocol ********* ** **** *****. *** of *** ** *** ** ********** in *** ******'* *******, ***** ** manufacturer ***************. *******, ** ***** *** RTSP ******* ******** *** ** ******** selected ** ********* "#*********=*" ** *** IP ******* **** ****** *** ******, where * ** *** ** ***, seen ** **** *******:

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

******* ****** ****** ************* ** ********. By *******, ******* *** *** ** "auto", ***** ******** ** *** ********* UDP, **** ******* ***, **** ***, to *******, ** ***** ** ********. If ********* ** ***********, ******* *** is ****. ** *** ** ********** unavailable, *** ** ****. **** ** found ** **** ******'* ***** ****** setup:

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

** *******, ********* ******** ******** ** cameras ***** ***. *** ** ********* in **** ******* (*** *** ******** menu ***** *****), *** *** *** cameras ******* **. **** ****** ** not ***** ** ** ** ********. Connections **** ****** ** ****** *** via *** ****.

TCP *** ***

************ ******* ******** (***) *** **** ******** ******** (***) *** *** *** **** ****** **** network *********. **** ***** **** **** into ****** *** ******* *** ************ via ********, *** **** *** *** differences **** **** **** **** ** less ******** *** ******** ********: 

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

*** ******** * ********** ** *** up ******* *** *** ************* *******, performed *** * ********* *******, ****** data *** ** ****. **** ************ begins, each *** ** ******* ** ********* as ******** ****** *** **** *** is ****, ********** ** ****** *** packets ******, *** ** *** ****** order.

** ********, *** **** *** ******* a ********** ** ******* ***** ** transmitting. ******* *** ****** **** ** the ********* ******* ********** ***** *********. Because ** ****, ****** **** *** ****** are **** ****** ** ***.

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

**** ***** ***, *************** *** **** ** the ********* ****** ***** ***** ************, ensuring *** **** *** ********, *** in *** ****** *****. ******* ***** were *** ******** ******** *** *************, until *** **** ** ******** ****.

******* *** ** **************, ** ***** checking ** ********** ** *********. *** sender **** *** **** ** ***** to *** ** *** ********* *** received *** ******* ** *** ***, it ****** ********* ******* *** **** set. ******* *** ****** *** ** order ** *** ** ***, ******* errors, *** ** ************ ** ***** to *** ******* ****** ** ****** lost *******.

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

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

Comments (30)
GC
Greg Cortina
Mar 12, 2015
How many hops did you simulate?
U
Undisclosed #1
Mar 12, 2015

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.

(1)
(2)
MT
Matt Transue
Mar 12, 2015

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.

U
Undisclosed #2
Mar 12, 2015
IPVMU Certified

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?

Avatar
Ethan Ace
Mar 12, 2015

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.

LM
Luke Maslen
Mar 26, 2015
IPVMU Certified

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?

JH
John Honovich
Mar 26, 2015
IPVM

"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.

(1)
Avatar
Ethan Ace
Mar 26, 2015

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!

LM
Luke Maslen
Mar 26, 2015
IPVMU Certified

Thanks John. I'm sure you're right but I found your answer funny too.

LM
Luke Maslen
Mar 26, 2015
IPVMU Certified

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.

U
Undisclosed #2
Mar 26, 2015
IPVMU Certified

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.

(1)
MT
Matt Transue
Mar 26, 2015

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.

LM
Luke Maslen
Mar 26, 2015
IPVMU Certified

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.

IS
Ian Smith
May 31, 2015
IPVMU Certified

This was great info and never really explained this well during camera manufactorers trainings Thanks.

MT
Matt Transue
Jun 01, 2015

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.

OB
Oðinn Burkni Helgason
Oct 27, 2015
IPVMU Certified

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.

UE
Undisclosed End User #3
Dec 04, 2019

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.

(3)
U
Undisclosed #2
Dec 05, 2019
IPVMU Certified

what’s the network utilization?

UE
Undisclosed End User #3
Dec 05, 2019

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.

UI
Undisclosed Integrator #4
Dec 05, 2019

Some would question if that’s an acceptable level.

(2)
(1)
U
Undisclosed #2
Dec 05, 2019
IPVMU Certified

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.

(3)
UI
Undisclosed Integrator #5
Dec 05, 2019

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).

(1)
U
Undisclosed
Dec 05, 2019

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

(2)
(1)
Avatar
Sean Patton
Dec 05, 2019

Get a life and use TCP connections.

(3)
UI
Undisclosed Integrator #4
Dec 06, 2019

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

DE
Damond Edwards
Jul 20, 2020

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

UI
Undisclosed Integrator #6
Jul 20, 2020

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.

DE
Damond Edwards
Oct 11, 2020

Does Verint support either of those?

JF
Jon French
Aug 06, 2021
IPVMU Certified

Good read

FO
Fawaz Owayda
Jan 13, 2022
IPVMU Certified

Hello,

I am just learning about TCP and UDP. I find it interesting to finally begin to understand the meanings of these settings and how they apply. The videos you have a really good as well as the material followed by the mini quiz. Thank you.