Repository navigation
Geotag videos from NMEA files - #869
Merged
Merged
Conversation
The README lists NMEA among the sources that geotag videos, but no video was read from an NMEA file: process and video_process gave the video no description at all, and exited 0, so it was silently left out. Sampling fell back to the GPS in the video, which a video recorded with an external logger does not have. Read the NMEA file into a track and place it on the video exactly as a GPX track is: synced by the GPS clock of the video, or by --video_start_time, or assumed to start with the video, with the interpolation options, the coverage checks and the clipping of process. GPXVideoExtractor now reads its file through _parse_tracks(), which NMEAVideoExtractor overrides, and names the format of the file in its messages. A file that is not valid NMEA is reported as an invalid GPX file is. Interval sampling checks an NMEA track started with the video by --interpolation_use_gpx_start_time as it checks a GPX track. On an action camera video with a GPX and the same track as NMEA, process gives the same track, and video_process samples the same frames at the same positions.
caglarpir
force-pushed
the
geotag-videos-from-nmea
branch
from
October 22, 2026 20:18
8c7b13e to
2efacb8
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.
Stacked on #868; review the last commit.
Problem
The README lists NMEA among the sources that geotag videos, but no video was read from an NMEA file (
factory._build_video_geotag(): "TODO: geotag videos from NMEA"):mapillary_tools process MAH04813.MP4 --geotag_source nmea --geotag_source_path MAH04813.nmea # [] and exit 0Sampling fell back to the GPS in the video, which a video recorded with an external logger does not have.
Fix
Read the NMEA file into a track and place it on the video exactly as a GPX track: synced by the video's GPS clock, by
--video_start_time, or assumed to start with the video, with the interpolation options, the coverage checks and the clipping ofprocess.GPXVideoExtractorreads its file through_parse_tracks(), whichNMEAVideoExtractoroverrides, and names the file's format in its messages (GPX messages are unchanged). A file that is not valid NMEA getsMapillaryInvalidGPXError, as an invalid GPX does. Interval sampling checks an NMEA track started by--interpolation_use_gpx_start_timeas it checks a GPX track.Verification
processgives the same 650 points (time, position, altitude, epoch);video_processby interval (130 frames) and by distance (159) samples the same frames at the same positions (headings within 0.003°, from NMEA rounding).mypy --python-version 3.9,ruff check,ruff format --checkandusort diffare clean.