Repository navigation
Apply the interpolation options to videos geotagged from a GPX - #851
Merged
caglarpir merged 3 commits intoOct 22, 2026
Merged
Conversation
caglarpir
force-pushed
the
process-video-interpolation-options
branch
from
October 20, 2026 12:18
268fe1f to
add6d99
Compare
This was referenced Oct 20, 2026
process ignored --interpolation_offset_time and --interpolation_use_gpx_start_time for videos. They reached the image geotaggers through SourceOption.interpolation, but the GPX video geotagger read them only from VideoSyncOption, which only distance sampling sets. The track uploaded with a video stayed where the GPS clock of the video, or the start of the video, put it, whatever the options said. GPXVideoExtractor now reads them from SourceOption.interpolation, which process sets on every source. Sampling sets it too, unless a source has options of its own, as process does. VideoSyncOption keeps only the start time, and with it the start-time check, which stays out of process: process has no --video_start_time to offer. The offset moves the track along the video. The absolute times of its points stay those of the GPX, just as an image geotagged with the offset takes the time of its position along the GPX. Only sampling shifts them as well, for the geotagging stage to add the offset back. Without the options, process gives the same tracks as before, and video_process the same frames and descriptions, with or without them. Fixes mapillary#827
With --interpolation_offset_time, process could move a track placed at the start of the video, assumed to start with it or by --interpolation_use_gpx_start_time, entirely off the video and still exit 0. The coverage check raised only for a track placed by a clock, and warned of the others, blaming the GPX file and its time zone. The video was then uploaded with no position for any of its frames. Placed at the start of the video, a track can miss it only by the offset, so it now raises as well, and says to check the offset. With an offset, the error gave the times of the video as they are, which overlap the track when the offset moves them off it, and so contradicted the gap it reported. It now also gives the times at which the offset looks the video up along the track, and image_time is the first of them, as it is the capture time plus the offset for an image.
…elapse limit A directory that mixes images and videos gets one --interpolation_offset_time for both. An offset that corrects the camera clock of the images now also moves the track of each video, which can then miss the video and fail it. Say so under the example of such a correction, with the way around it. The limit on timelapses without GPS is that of process.
caglarpir
force-pushed
the
process-video-interpolation-options
branch
from
October 22, 2026 09:38
717bc81 to
6a3bc72
Compare
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.
Fixes #827
Problem
processignored--interpolation_offset_timeand--interpolation_use_gpx_start_timefor videos. They reach the image geotaggers throughSourceOption.interpolation, but the GPX video geotagger read them only fromVideoSyncOption, which only distance sampling sets (#841). The track uploaded with a video stayed where the GPS clock of the video, or the start of the video, put it, whatever the options said.Fix
GPXVideoExtractorreads both options fromSourceOption.interpolation, whichprocesssets on every source. Sampling sets it too, unless a source has options of its own, asprocess_geotag_properties()does.VideoSyncOptionkeeps the start time and--video_duration_ratio, and with them the check that a GPX can start with the video. That check stays out ofprocess, whose users can't pass the--video_start_timeit asks for. Interval sampling checks a GPX that--interpolation_use_gpx_start_timestarts with a video without a GPS clock (Sync a GPX to a video without a GPS clock at --video_duration_ratio #856) by each GPX source's own options.--video_geotag_source, and warns that in a directory mixing images and videos, an offset meant for the images now moves the videos too.--video_start_time, or at the start of the video (assumed, or with--interpolation_use_gpx_start_time), where only the offset can have moved it off. With an offset, the error names it and gives the times it looks the video up at along the track, so that they agree with the gap it reports.Verification
The GoPro MAX test video with a GPX that starts 3.613 s before its GPS clock. Video time (ms) in
MAPGPSTrackof the point the GPX recorded at 23:44:50, 10 s into the track (the track is clipped to the video since #860, so its first point is always at 0):--interpolation_use_gpx_start_time--interpolation_offset_time 2--interpolation_use_gpx_start_time --interpolation_offset_time 2.5That point keeps the time the GPX recorded it in every case.
--interpolation_offset_time 2moves the track by 67 ms of video: the offset is in GPS seconds, of which the video's GPS clock packs 30 into each second (Sync a GPX to the GPS clock of a timelapse, even one too noisy to publish #849). With--interpolation_use_gpx_start_time, the track starts with the video at that rate, and is clipped to the video (Keep a timelapse's clock rate when the GPX starts with the video #853, Clip a GPX track to the video it geotags when a clock paces it #860).processandvideo_processgive the same descriptions asmainon sample videos from 10 cameras.mypy,ruff check,ruff format --checkandusort diffare clean.Merge notes
Rebased onto
mainafter #852-#862. Besides the conflicts, the tests changed: #855's clock anchor moves the GPS clock of the test video by about 1 s (-2.59 s becomes -3.613 s), and the integration test looks a point up by its GPX time rather than reading the first point, which #860 clips to the start of the video.#861 warns in
processof a long track assumed to start with a video without a GPS clock. It warns with an offset too; naming the offset there is left for a follow-up.Release notes
processnow applies--interpolation_offset_timeand--interpolation_use_gpx_start_timeto videos geotagged from a GPX, as it does to images. In a directory that mixes images and videos, an offset meant to correct the camera clock of the images now also moves the track of each video, and a video that the moved track misses fails withMapillaryOutsideGPXTrackError. Process the images on their own with--file_types imageto leave the videos as before.