Accurate timestamping for RMS (FT files) #496
Open
+234
−26
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.
Since the last update that changed the way raw video segments are named and stored, here are the changes this PR makes towards accurate timestamping of these segments:
An empty array is initialized to store the pts at the initialization of BufferedCapture.
Every call to read() will append a new pts to the array.Gstreamer callback moveSegment is called when a clip is ready. The segment is stored in the hierarchy under VideoFiles, while the pts array is flushed to a corresponding FT file under config.data_dir/TimeFiles (configureable), which follows a similar directory structure as the videos (Year/Day-of-Year/Hour/)
The timestamp array in memory is immediately cleared to store the next segment's pts.
In addition, each FT file and corresponding video segment are now named after
their first timestamp, and not using current time (RmsDateTime.utcnow).