-
Notifications
You must be signed in to change notification settings - Fork 24
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
sensor-logging: Fix subtitles to show data on the beggining and end of the video #1666
sensor-logging: Fix subtitles to show data on the beggining and end of the video #1666
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The generated files seem to make sense, but I'm having some issues with the playback lining up to have subtitles at the end of the files. Not sure if that's just VLC struggling to keep the correct timing with the matroska files, or if the fake source allowing strange framerates is contributing - potentially something to keep an eye on for later.
Some minor suggestions on the code comments:
src/libs/sensors-logging.ts
Outdated
// Consider logs that start a little before the initial time and end a little after the final time, so we don't | ||
// miss data on the start and end of the file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Consider logs that start a little before the initial time and end a little after the final time, so we don't | |
// miss data on the start and end of the file. | |
// Consider logs that start a little before the initial time and end a little after the final time, | |
// so we don't miss data at the start or end of the recording. |
src/libs/sensors-logging.ts
Outdated
// Generate a object with the initial and final epoch of each log point | ||
// To know the initial epoch, check the name of the key. To know the final epoch, check the epoch of the next point. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Generate a object with the initial and final epoch of each log point | |
// To know the initial epoch, check the name of the key. To know the final epoch, check the epoch of the next point. | |
// Generate an object with the initial and final epoch of each log point | |
// The initial epoch is the name of the key, and the final epoch can be determined from the next point. |
...{ seconds: differenceInSeconds(new Date(logPoint.epoch), initialTime) }, | ||
})) | ||
const finalLog = sortedLogPoints.map((logPoint) => { | ||
const seconds = Math.max(0, differenceInSeconds(new Date(logPoint.epoch), initialTime)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should probably be a comment here explaining that the max
clips the first point to the start of the log - took me a while to confirm the logic.
Adding the comments before merging. |
777f5c3
to
02d44cc
Compare
Attached zip contains the result of this patch.
subtitles-test.zip
Fix #815.