Skip to content

stereo-gui: Improve Sync, Add QOL Features - #47

Merged
elliot-ausocean merged 6 commits into
mainfrom
03-25-improve_sync_add_some_qol_features
Apr 21, 2026
Merged

elliot-ausocean merged 6 commits into
mainfrom
03-25-improve_sync_add_some_qol_features

Conversation

@elliot-ausocean

Copy link
Copy Markdown
Collaborator

This PR improves the synchronisation of the cameras when recording video. It also adds some quality of life improvements, including:

  • Automatically adding the timecode header to PTS files
  • Logging initial sync difference and corrections to a file and to the web GUI
image
  • Automatic muxing of videos into MKVs

This change hopefully improves sync by waiting until the sync is
complete. This change also adds some QOL features such as sync logging,
record time, and automatic timecode header insertion.
This change makes the recording time start when the cameras are synced.
This makes the recording time on the web page accurate.
This change automatically converts the recordings to an MKV, which
makes the camera much easier to use. The README was updated to match
recent changes.
This is because it seems that we don't need to sync the time between the
cameras anymore.
This is because these transforms are empty, so they are only cluttering
the code.

@ao-david ao-david left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how related some of these changes are, I found it quite hard to review (partially that I'm out of date with python), but mostly because of all of the context switching.

Comment thread exp/stereo-gui/camera_shared.py Outdated
Comment thread exp/stereo-gui/camera_shared.py
self._log_to_file("CORRECTION", correction)
else:
# Only update the last frame duration after a correction
self.last_frame_duration = frame_duration

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the comment says only update after a correction, but isn't the else statement mean there isn't a correction?

Comment thread exp/stereo-gui/camera_shared.py
return
try:
timestamp = datetime.datetime.now().isoformat()
with open(self.current_log_file, 'a') as f:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about the logic of with, is that opening the file everytime this is called, or opens it once and knows to keep it open?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is opening and then closing the file every time this is called, however this function is called relatively infrequently (a few times a minute at most). Opening the file each time is probably the way to go in this context since it is safer because we are flushing the file each time so we won't lose data if we crash.

Comment thread exp/stereo-gui/left.py
@elliot-ausocean
elliot-ausocean merged commit 77ab9cd into main Apr 21, 2026
1 check passed
@elliot-ausocean
elliot-ausocean deleted the 03-25-improve_sync_add_some_qol_features branch April 21, 2026 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants