Created on 2020.12.07


In this document we will explore how to synchronize the IP video streams between two (2) or more PTZOptics cameras. We will then explore how to leverage this same methodology to synchronize an audio feed to the multiple video streams that have been synchronized.


A side benefit of implementing these changes is the ability to minimize drift in IP video latency which is applicable even for single camera installations. 


If you prefer to watch to a video detailing this same information please check out the video below:


Description of the Issue_________________________________________________________

When you are operating a production system that has more than one (1) PTZOptics camera the IP video feeds can be out of synchronization with each other. In addition, when attempting to synchronize audio with these IP video streams of varying latency it can become difficult to produce a professional stream.


Overview of the Solution________________________________________________________

To accomplish synchronizing multiple video streams and audio we will leverage the NTP, Network Time Protocol, settings on your PTZOptics cameras as well as your PC. Once everything is set, NTP will allow your PC and network to properly decode the IP video packets in a correct order without creating additional latency to reorganize the incoming information.


Scope for Synchronization_______________________________________________________

  1. First we need to select a Network Time Server to point the cameras and PC at to ensure proper synchronization

    1. If you are aware of the Time Server utilized by your network equipment, router, it is highly recommended to use that same server for your PC and cameras.

      1. By default a Unifi network deployment will utilize the Unifi time servers

      2. An example of a Unifi time server address 0.ubnt.pool.ntp.org

    2. If you are unable to determine the Time Server utilized by your network make sure to set the PC and cameras to the same time server.

      1. By default

    3. When selecting a Network Time Server it is important to select one that is close to your physical location, as an example being located around Philadelphia I may select one from NY or VA, to ensure the least amount of latency when synchronizing.

      1. There are a plethora of freely available network time servers to use with a simple Google search

  2. Once we have selected a Network Time Server to use we need to begin applying it to our production equipment.

    1. For the camera simply log into the Web Interface and navigate to the Network section

      1. Near the bottom is a section titled “NTP Settings” where we will make our adjustments

        1. Set the Time Zone, drop down, to your appropriate time zone for your equipments current physical location

        2. Click the radio button to turn On  the NTP Time Sync

        3. Set the Server Address to the Time Server selected above

        4. Set the Time Interval to 10 minutes

        5. Click Apply

      2. Navigate to the System section and [Reboot] the camera

      3. Repeat these same steps for any additional PTZOptics cameras making sure to click Apply and reboot each time.

    2. For the PC we will need to apply this same time server to our Operating System

      1. For the Windows 10 Operating System start by opening Control Panel

        1. Select “Clock and Region”

        2. Click the sub-selection of “Set the time and date”

        3. Select the tab for “Internet Time”

        4. Click “Change Settings”

          1. Note this may require an administrative account to configure

        5. Make sure the “Synchronize with an Internet time server” has been checked

        6. For the “Server:” entry please use the network time server select above

          1. Click “Update Now”

          2. Click “OK”

        7. Exit all previous windows

      2. For the Mac Operating System start by clicking on the Apple menu

        1. Select “System Preferences”

        2. Click the Date & Time icon

          1. Note this may require you to “unlock” the settings using your Administrative password

        3. Check the “Set Date & Time Automatically” checkbox

        4. Enter the address of the network time server selected above

        5. Close out all open windows

  3. Now if you open an IP video feed from each of the sources configured using the above method they should provide video feeds synchronized to within 30ms in current testing.

  4. If we want to synchronize audio to these same video feeds we simply need to route the output of the sound system into the available 3.5mm line-level input on the PTZOptics P/T/Z cameras


Final Note(s)___________________________________________________________________

  • It is worth attempting to set the Network Time Server address to match that which your own network utilizes for the best possible experience

  • All testing has shown the method outlined above to produce a multi camera production system where the video feeds are within 30ms of each other.

  • Using this same methodology, even for a single PTZOptics camera, should prevent drift in the video latency

  • These tests have been performed using the RTSP and NDI video feeds available from a PTZOptics camera.

  • These tests have been performed using VLC, vMix, OBS and NDI Studio Monitor

  • This solution is still being refined and any new information or capabilities will be added as discovered, tested and documented.

  • Why this works…

    • When a device sends IP video data over a packet switched network it has the ability to apply timestamps to the packet data to ensure the frames are assembled in a proper order.

      The timestamps for the video data are set by the sending device, the camera, and if two (2) devices timestamps do not match it will add delay, latency, ensuring that the data is not out of order or dropped.

      Example:
      The camera thinks the time is 09:01:15.545
      The computer thinks the time is 09:01:13:223

      The stream coming from the camera will look fine to the computer with 

usual latency, but as soon as the computer sends a packet to the camera, 

the camera will see that the packet from the computer is old and think there 

is a larger than actual network delay. Then will readjust the stream to tell the 

computer buffering to compensate.          -Example courtesy of Erik Aaron