title: WebRTC - how to synchronize media streams
body: <p>I'm using WebRTC in a sort of non-conventional way.</p>
  
  <p>I have multiple streams generated by several 'broadcasting' peers being sent to a collection of several 'receiving' peer.</p>
  
  <p>I intend to use an SFU media server (maybe Jitsi or Kurento) </p>
  
  <p>It is very critical that these streams are presented at the receiving peers in a synchronized fashion.</p>
  
  <p>What are the methods I can use for synchronization? Usually this isn't an issue with WebRTC because there is not usually a consistent clock between peers, but in my case there is a common clock for all the stream sources.</p>
  
  <p>The only ways I can imagine doing it are:</p>
  
  <ol>
  <li><p>Not worry about it and hope that WebRTC's low latency will cause everything to be in sync.</p></li>
  <li><p>Somehow encoding timestamp metadata in the WebRTC stream frames, and somehow synchronizing display with javascript in the browser.</p></li>
  <li><p>Using a tool like GStreamer that can perform video synchronization, mix the streams into a single stream and forward that to the media server (and thus to the receiving clients). I don't have a good idea of how I would actually perform the synchronization though.</p></li>
  </ol>
  
  <p>Any thoughts and advice would be appreciated.</p>