Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop nonmonotonic recording #1829

Merged
merged 4 commits into from
Mar 26, 2020
Merged

Stop nonmonotonic recording #1829

merged 4 commits into from
Mar 26, 2020

Conversation

pfaion
Copy link
Contributor

@pfaion pfaion commented Mar 19, 2020

When timestamps are handled from external sources, the sources need to take care of syncing time. This can lead to jumps in timestamps when syncing while recording.

Since the video writer classes work under the assumption of monotonic data, we cannot handle negative time jumps caused by syncing. Previously Capture would just crash when receiving a negative time jump.

This PR handles negative time jumps more gracefully:

  • A running recording will be stopped, so the partial recording is useable
  • An error message will be shown, more detailed information will be logged as debug info
  • Capture does not crash anymore

@pfaion pfaion requested a review from papr March 19, 2020 10:28
@pfaion
Copy link
Contributor Author

pfaion commented Mar 19, 2020

@papr please give this a try. I tested this once by pausing the debugger while recording and manually messing with the timestamps in memory, then resumed the debugger. Everything worked as excepted: recording stopped and was useable in Player. I could continue to start another recording.

@pfaion
Copy link
Contributor Author

pfaion commented Mar 19, 2020

@papr As a side note: we should also extract the recording logic from eye.py into a recorder plugin at some time, currently this is all still patched together in the eye main loop. Maybe we can even re-use the world recorder plugin.

Copy link
Contributor

@papr papr left a comment

Choose a reason for hiding this comment

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

I think this suggestion makes it clearer that it is a timestamp issue.

pupil_src/shared_modules/av_writer.py Outdated Show resolved Hide resolved
@pfaion pfaion requested a review from papr March 19, 2020 16:02
@papr papr merged commit d851bee into develop Mar 26, 2020
@pfaion pfaion deleted the stop-nonmonotonic-recording branch March 26, 2020 15:38
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.

2 participants