title: TCP-Streaming: Audio/Video Synchronization
body: <p>I have a question regarding TCP/Live-Streaming/Synchronization (programming language: Java):</p>
  
  <p>Let's say I have a Client, that is capturing the Audio and Video from a camera. It is sending the audio and video data simultaneously (via Threads) via TCP-sockets to a server, that is receiving the audio and video stream simultaneously on two different threads.</p>
  
  <p>[I know, UDP is normally used for live-streaming applications but there are reasons, why I'm using TCP..]</p>
  
  <p>So, the question is: Will there be any chance to get out of sync ever via TCP? There are two streams on different sockets (one for audio, one for video), there may be a problem, that a packet has to be re-sent, but will the resend of the lost-packet be a problem (I mean, when resending a packet via TCP, will this cause a permanent delay or will the client just send the lost packet and the next packet faster for a few milliseconds)?</p>
  
  <p>I'm sending the audio and video signal at the same time to the server. Will they always arrive at the same time on the server? If not, is there a way to produce/simulate the problem?</p>
  
  <p>I've done some tests and the audio and video was always in sync. But I'm not sure, if it will always be like that (even after more than 5 hours of streaming).</p>
  
  <p>Thank you.</p>