Add A/V sync logging behind compile time switch #1462
Merged
Merged
Conversation
Closed
paulpv
requested changes
May 20, 2026
paulpv
left a comment
Member
There was a problem hiding this comment.
Add documentation for this flag, what it is and how to use it.
Contributor
Author
I added more details on how to use this in the initial PR description. I also added description of the log file columns and info on what a sync test data source is and how to get it (private repo right now). |
Collaborator
|
The usage should also be added in the Wiki (dev segment). |
Trouffman
reviewed
Jun 15, 2026
paulpv
approved these changes
Jun 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To use this code, in the new file "src/obs-support/sync-debug.h", uncomment the following line:
//#define SYNC_DEBUG 1
If SYNC_DEBUG is not defined, nothing new happens in the code.
When SYNC_DEBUG is defined, --distroav-debug set when starting OBS, and a NDI source containing SyncTestSend frames, then the following lines will be sent to the obs log file:
Usage
Fields in log
Sync A/V - Audio and Video found
Sync Audio - Only Audio data found
Sync Video - Only Video data found
AT - Time audio sync data found (ms)
AW - Width of audio sync data (ms)
AC - Count of audio sync data
VT - Time video sync data found (ms)
VW - Width of video sync data (ms)
VC - Count of video sync data
Delta - Difference between AT and VT in ms
OBS <- *** - Instrumentation point in DistroAV where a/v data sent to OBS
NDI <- *** - Instrumentation point in DistroAV where a/v data sent to NDI
Sync Test Data Description
The Sync Test Data is a NDI stream of white and black frames. White frames are sent for 1 second and black frames for 3 seconds. A sine wave audio signal exists in the audio channels of the NDI stream when a video frame is white. No audio data (0.0f) is sent when the video frame is black. The SYNC DEBUG code looks for this specific cases of black to white and 0.0f to not 0.0f to flag the start of a sync test data.
This PR is requested to be included in the master to help with the development of future solutions to A/V sync problems. The logs can help quantify instances of A/V becoming out of sync, and help identify points where audio becomes out-of-sync with the video. Including in the master will make it so developers will not have to keep merging the sync-debug code as DistroAV master branch develops.