Skip to content

Read video locations and dates, and every common photo GPS layout - #305

Merged
charpy4n6 merged 1 commit into
mainfrom
feat/video-gps
Oct 21, 2026
Merged

charpy4n6 merged 1 commit into
mainfrom
feat/video-gps

Conversation

@charpy4n6

Copy link
Copy Markdown
Collaborator

What it fixes

Videos had no location in GLEAPP. GLEAPP read no metadata from videos, only duration and size. So a phone video's GPS never reached the details-pane map, the Locations overview, the KMZ or the reports, even though ExifTool shows it (as UserData:GPSCoordinates). This was found on a real case, where every video's location was missing.

Some photo GPS was dropped, and one layout stored NaN. The EXIF GPS converter accepted only three-part degrees/minutes/seconds:

GPS as written Before After
degrees, minutes, seconds ✅ ✅
degrees + decimal minutes (2 parts) ❌ nothing ✅
degrees + decimal minutes, seconds 0/0 ❌ NaN stored ✅
decimal degrees (1 part) ❌ nothing ✅
GPS only in XMP (40,26.78N) ❌ nothing ✅
all zeros ("no fix") plotted at 0,0 ignored

How

  • gleapp/videometa.py (new). Walks the MP4/MOV box tree; it reads no frames and adds no dependency. It reads:
    • moov/udta/©xyz: UserData GPSCoordinates, written by Android and many cameras.
    • moov/meta keys/ilst: the iPhone's com.apple.quicktime.location.ISO6709 and creationdate.
    • It parses all three ISO 6709 forms: decimal degrees, degrees + minutes, and degrees + minutes + seconds.
  • Video Captured date: taken from the iPhone creationdate as the device's local time, the same wall-clock form a photo's EXIF capture time has. The movie header's creation time is deliberately not used, because most devices write it in UTC and Captured means camera-local.
  • Read before decoding: the location is read before the video is decoded, so a clip that won't decode still gets it. A capture date already on the row (e.g. from Project VIC) is kept.
  • gleapp/metadata.py: the photo converter accepts 1, 2 or 3 parts and treats a 0/0 part as 0. A value that isn't a real coordinate (NaN, out of range, 0,0) is refused rather than stored. XMP GPS and the capture date fill in when EXIF has none.

Existing cases pick this up only when processed again (gleapp process --force) or ingested into a new case. The docs say so; there's no in-app reprocess button.

Testing

  • tests/test_video_gps.py (19 tests, all synthetic) covers:
    • every ISO 6709 form, and the strings that aren't locations;
    • UserData and Apple videos, an extension-less clip, files with no metadata or no file at all, and keeping an imported date;
    • every photo GPS layout in the table, plus the XMP fallback.
  • The synthetic UserData and Apple clips read the same in ExifTool 13.59 ([UserData] GPS Coordinates, [Keys] GPS Coordinates / Creation Date).
  • Full suite: 1,079 passed locally on Windows, excluding one test that needs symlink privileges this machine lacks.
  • Lint: no new warnings. Line endings: LF.
  • Not done: a run on the original case's real videos.

Docs: MANUAL §6 and the in-app help (Location row).

🤖 Generated with Claude Code

GLEAPP read no metadata from videos, so a phone video's location
(QuickTime UserData GPSCoordinates, or the iPhone location key) never
reached the map, the KMZ or the reports. gleapp/videometa.py reads both
ISO 6709 forms, plus the iPhone creation date as the video's Captured time,
by walking the MP4/MOV boxes; no frames, no new dependency. It runs before
decoding, so a clip that will not decode still gets its location.

Photo GPS accepted only three-part degrees/minutes/seconds. Degrees and
decimal minutes (two parts) and decimal degrees (one) were dropped, and a
0/0 seconds part stored NaN. All three now convert, a 0/0 part counts as
0, anything that is not a real coordinate (NaN, out of range, 0,0) is
refused, and XMP GPS and capture date fill in when EXIF has none.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@charpy4n6
charpy4n6 merged commit f08892b into main Oct 21, 2026
8 checks passed
@charpy4n6
charpy4n6 deleted the feat/video-gps branch October 21, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant