Repository navigation
Time 70mai clips logged without GPS time by the camera's clock - #991
Merged
Merged
Conversation
Some 70mai cameras log whole sessions without the time of the GPS: their rows have positions, but the placeholder time -28801. In one sample log, 24 of 42 sessions are logged so, 644 of its 759 clips, which got no GPS. The rows of such a clip are now timed by the camera's clock, as it is in the name of the clip. The clock is set by the clips with GPS time in the logs: for a clip that continues a recording and whose rows are all fixes, its first fix is its start, so the time in its name less that fix is how far the clock is ahead of UTC (with the clip's shift of 8 hours, if any). The median of the 5 such clips nearest by that clock is taken, as the clock drifts seconds a day. The camera writes rows at a steady rate, a fix or not (every 1.5 seconds on that camera, every second on another), which those clips give too. So the rows are placed at that rate from the start of the clip, or up to its end if it is the first clip after "$V02" and they span much less than it, as for clips with GPS time. Without a clip with GPS time in the logs, or if the rows span more than the clip, the clip fails with a warning, as before. In all three sample logs, sessions with GPS time were turned into sessions without it (-28801), and their clips timed this way: 502 clips, 3 of which failed as their rows spanned more than the clip. For 95% of the rows, the time given is within 1.7 to 3.8 seconds of their GPS time, depending on the camera, and at most 7.1 seconds off. All 644 clips of the log above get GPS now, with the camera's clock 5 hours (UTC+5) less 11 to 24 seconds ahead of UTC.
…hat agree A clip without GPS time took the camera's clock from the 5 clips with GPS time nearest to it by that clock, however far they were, and whether or not they agreed. A clock reset to its default (the start of 2021) took clips years away, and a clip came out dated 2020. A clock set back an hour between the clips with GPS time and the clip took the old clock, and the clip came out an hour early. Only clips with GPS time within 3 days of the clip by the camera's clock now set it. The clock drifts seconds a day, up to about 5 on the cameras seen, so that keeps the drift to about 15 seconds; in the sample log with sessions without GPS time, the 5th nearest is at most 11 hours from every clip. They must also agree within a minute: the 5 that set it, and the nearest before and after the clip by that clock. Otherwise the clip fails with a warning that says why, as for a name without the time of the camera's clock. A change of the clock with the clips with GPS time all on one side of it is still not noticed, which the docstring and the command reference say. All 644 clips without GPS time in that log still get GPS: the clips with GPS time on both sides of each agree within 7 seconds.
caglarpir
force-pushed
the
70mai-untimed-sessions
branch
from
December 3, 2026 12:50
ec205be to
5f52fb8
Compare
This was referenced Dec 3, 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.
Problem
Some 70mai dashcams log whole sessions without the time of the GPS: their rows have positions, but the placeholder time
-28801. In one sample log, 24 of 42 sessions are logged this way, 644 of its 759 clips, and those clips get no GPS.Change
$V02and its rows span much less than it, as for clips with GPS time.Rebased onto main after #974 and #990 were merged. A rear camera clip (#990) whose front clip was logged without GPS time gets the same points as the front clip.
Testing
Unit tests for a clip without GPS time:
Each test fails when its code path is broken.
On three sample logs from three cameras, sessions with GPS time were turned into sessions without it, and their clips were timed this way. Of 502 clips, 3 failed because their rows spanned more than the clip. For 95% of the rows, the time given is within 1.7 to 3.8 s of their GPS time, depending on the camera, and at most 7.1 s off.
All 644 clips without GPS time in the log above now get GPS. The camera's clock comes out 5 hours (UTC+5) less 11 to 24 s ahead of UTC, as in its sessions with GPS time, and the clips with GPS time around each clip agree within 7 s.
ruff, usort, and mypy on 3.9 and 3.13. Unit tests on 3.9 and 3.13, merged with main.