Repository navigation
Keep the gaps between GPX track segments inside a video in its description - #986
Merged
Merged
Conversation
caglarpir
force-pushed
the
keep-gpx-segment-gaps
branch
2 times, most recently
from
December 1, 2026 16:37
2723fe4 to
f5f2cc7
Compare
…ption GPS loggers, such as the Mapillary apps, start a new GPX track segment where they lost the GPS. process merged the segments into one track, whose interpolation across the gap places the video there on a straight line, as if the GPS had been there. The GPX video extractor now keeps the boundaries between the segments of the track file, and process writes those inside the video to its description as MAPGPSTrackGaps: the times, in milliseconds of video, of the points on either side of each gap. A boundary counts where the next segment starts more than MAPILLARY_TOOLS_MAX_GPX_SEGMENT_GAP_SECONDS (5) after the previous one ends, so a logger that splits its track every few fixes leaves none, and where no point of another segment is in between: segments that overlap, as two loggers' tracks merged into one file do, leave none there, and segments that touch leave none. The track of a video without a GPS clock that lasts twice as long as the video or more keeps no gap, as it may be that of a timelapse. Where the start or the end of the video falls in such a gap, process interpolated a point there across the gap. The fixes on the far side of the gap are now left out instead, as for a gap of more than MAPILLARY_TOOLS_MAX_GPX_GAP_SECONDS: the video has no position until the first fix after the gap, or after the last one before it. The warning about a GPX file of several segments counted them as tracks, and said they were merged into one: it now counts segments, and process says that gaps of more than the limit between them inside a video are kept as gaps. Sampling is not changed here: it still places frames across these gaps. Uploads are unchanged too: uploading each part of the video between the gaps as its own sequence comes in a follow-up.
caglarpir
force-pushed
the
keep-gpx-segment-gaps
branch
from
December 1, 2026 16:45
f5f2cc7 to
21c84cf
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.
GPS loggers, such as the Mapillary apps, start a new GPX track segment (
<trkseg>) where they lost the GPS.processmerged the segments into one track, so a video was placed on a straight line across the gap.The gaps now go into the description of the video as
MAPGPSTrackGaps. Each gap is given by the times of the points on either side of it, in milliseconds of video, as inMAPGPSTrack.MAPILLARY_TOOLS_MAX_GPX_SEGMENT_GAP_SECONDS(5) after the previous one ends, with no point of another segment in between. Segments that overlap, such as the tracks of two loggers merged into one file, leave no gap where they overlap, and segments that touch (one starting when the other ends) leave none. Neither affects the other gaps of the file.processinterpolated a point there across the gap. The fixes on the far side are now left out instead, as for a gap of more thanMAPILLARY_TOOLS_MAX_GPX_GAP_SECONDS: the video has no position until the first fix after the gap, or after the last fix before it. A video entirely inside a gap then has no GPS points, and fails to process.processkeeps gaps. Sampling (video_process) is not changed here, and still places frames across them.Uploads are unchanged here: #988 uploads each part between the gaps as its own sequence. A GPX file with no segment gap of more than 5 seconds gives the same description as before.
mapillary_tools 0.15.2 and older refuse a description with
MAPGPSTrackGaps(the schema allows no other properties), souploadwith an older version stops on such a description file. This is meant to land together with #988.