VideoSyncCalculator

VideoSyncCalculator is a MacOS tool for aligning different video sources into a common timeline. VideoSyncCalculator calculates the time delay between the different sources. The audio source used can also be aligned. In OBS (Open Broadcaster Software), or similar programs, use the calculated delay values ​​as Render Delay for each source. With correct delays, all sources are synchronized.


The process

The process of calculating the delays is very simple. You must only be able to control that all sources are affected by a change in the light intensity, eg that the light in the room goes out. The process below is described for OBS, but should be similar in similar programs.

Do not like to read instructions? Watch the whole process in this video!

Step 1 - Create a test scene in OBS

Create a scene in OBS where all sources are visible. Organize them on the screen so you know which source is which. Add a Render Delay filter to each source and check that it is set to 0 ms.

Above a scene in OBS where the various sources are laid out and noted. Render Delay is set to 0 ms for each source.

To calculate the delays between the sources, you will turn off the lighting. VideoSyncCalculator will calculate the time between the last "dark"-detected source and the other sources. For it to work, the sources must change clearly when the light goes out. Test this and redirect the sources where the change is not clear.

Step 2 - Record a short movie where you turn off the light

Create a short film (a few seconds long) in OBS, using the simple steps below:

  1. Turn on the light in the room
  2. Select the test scene in OBS
  3. Start recording in OBS
  4. Turn off the light in the room (make a loud noise at the same time as an audio sync signal, eg hit the light switch with the microphone)
  5. Stop recording in OBS
  6. Turn on the light in the room
  7. Remux the recorded video file to an mp4 file in OBS

The created mp4 file will now be used in VideoSyncCalculator.

Step 3 - Launch VideoSyncCalculator and import the video

Launch VideoSyncCalculator. Click the "Load video ..." button and select the video you created in step 2. The video will open and be displayed in a window to the right of VideoSyncCalculator. You can scale the window by right-clicking on the video.

Above the video file imported into VideoSyncCalculator. By right-clicking on the video, you can choose to resize it.

Step 4 - Select test areas and analyze the video

VideoSyncCalculator can calculate the delay between 10 sources (you can extend it by repeating the procedure for other selected areas). A row in the VideoSyncCalculator table is linked to a test area (rectangle) that you specify in the video. Play the video and check which areas clearly changed when the light went out.

Click the "Set rect" button in the table. A crosshair will appear and you can now drag a rectangle over the area that you know changed when the light went out. The local video window coordinates of the rectangle are displayed. If the TH (threshold) check box in the column header is checked, 1/2 of the average intensity value in the rectangle is set as a threshold, otherwise enter a value between 0 (completely dark) and 255 as the threshold. The test enable checkbox is automatically checked. Repeat for all areas to be tested.

When all test rectangles are set, click the "Analyze" button. The video will be played from the current position and the intensity of the test rectangles will be measured for each frame. When an intensity falls below the set threshold value, the time code is saved. When "darkness" has been detected in all activated test rectangles or when the film is finished, the delay to the last detected rectangle is calculated and displayed.

Play the video in the video window and listen for the audio sync signal. Stop playback just before the signal and right-click in the video player and select the menu item "Set audio sync". The sound delay to be specified in OBS is calculated and displayed below the Delay column.

Above the results from the analysis and audio sync detection procedure. Delay corresponds to the Render Delay to be specified for the source in OBS and the audio delay the delay that should be set as "Sync offset" in the OBS "Advanced Audio Properties". You can save the analysis results to file and also load previously saved results. With the "Clear ..." button, the entire table can be cleared or only the test results.

Step 5 - Update Delay values in OBS


VideoSyncCalculator Icon made by Freepik from www.flaticon.com