Repository navigation
Conversation
A GPX is synced to a video by the video's GPS clock, which was anchored at its first timestamp. That one can be off the rest: the first GPS block of a GoPro timelapse can be stamped 3 s early, the PanoX V2 can record a stale first fix 2 s old, and GoPro stamps a placeholder date until it acquires GPS time. The whole GPX then lands that much early or late. The clock is now anchored, still at the video time of its first timestamp, at the median of all its timestamps mapped back to that time at the clock's rate. Syncing the tracks of 17 sample videos back to them, the median error drops from 0.63 to 0.02 s and from 0.81 to 0.02 s on two GoPro MAX videos, from 2.2 to 0.02 s on the PanoX V2, and to 0.011 s or less on the GoPro timelapses. No median gets worse by more than 4 ms. A noisy GoPro video whose clock starts on the placeholder date is now synced by its clock, not from the start of the video.
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
_read_video_clock()(#849) anchors the GPS clock of a video at its first timestamp, which can be off the rest:max-360mode.mp4has one 1 s early.The whole GPX then lands that much early or late.
Changes
The clock is still anchored at the video time of its first timestamp, but at the median of all its timestamps mapped back to that time at the clock's rate.
Verification
The tracks of 17 sample videos exported as GPX and synced back to their videos. Median error:
No median gets worse by more than 4 ms. A noisy GoPro video whose clock starts on the placeholder date is now synced by its clock, which agrees with the clock of the next clip from the same camera.
test_process_video_geotag_source_with_gpx_outside_videoexpects the video start 1 s later. Unit: 916 passed, 18 skipped, 1 xfailed. Integration: 69 passed. Doctests,mypy,ruff check,ruff format --checkandusort diffare clean.With #851: two of its tests expect the first-timestamp anchor of
max-360mode.mp4, -2.59 s and -2590 ms, which become -3.613 s and -3612 ms.