Skip to content

Extract GPS epoch timestamps from RMKN maker note in Ricoh Theta videos#814

Open
caglarpir wants to merge 1 commit intomainfrom
extract-rmkn-gps-timestamps
Open

Extract GPS epoch timestamps from RMKN maker note in Ricoh Theta videos#814
caglarpir wants to merge 1 commit intomainfrom
extract-rmkn-gps-timestamps

Conversation

@caglarpir
Copy link
Contributor

Ricoh Theta cameras write CAMM Type 5 GPS data (lat/lon/alt only, no epoch timestamps). However, the RMKN (Ricoh Maker Note) box in the MP4 udta container includes a GPS IFD with GPSDateStamp and GPSTimeStamp tags—true GPS-derived UTC timestamps recorded at the start of video recording.

This change:

  • Parses the RMKN TIFF/EXIF structure in camm_parser.py to extract the GPS datetime from the GPS IFD (tags 0x001D and 0x0007)
  • Adds a gps_datetime field to CAMMInfo to carry the extracted timestamp
  • Enriches CAMM Type 5 points with computed epoch timestamps in CAMMVideoExtractor using the formula: epoch = rmkn_gps_epoch + (point.time - first_point.time)
  • Converts enriched points to CAMMGPSPoint (Type 6) so downstream consumers receive proper GPS epoch times
  • Adds unit tests for RMKN parsing (valid, little-endian, missing GPS IFD, truncated, bad magic) and point enrichment logic

@meta-cla meta-cla bot added the cla signed label Feb 25, 2026
@caglarpir caglarpir force-pushed the extract-rmkn-gps-timestamps branch from 1e396ce to 1ac8cff Compare February 25, 2026 08:41
Ricoh Theta cameras write CAMM Type 5 GPS data (lat/lon/alt only, no
epoch timestamps). However, the RMKN (Ricoh Maker Note) box in the MP4
udta container includes a GPS IFD with GPSDateStamp and GPSTimeStamp
tags—true GPS-derived UTC timestamps recorded at the start of video
recording.

This change:
- Parses the RMKN TIFF/EXIF structure in camm_parser.py to extract the
  GPS datetime from the GPS IFD (tags 0x001D and 0x0007)
- Adds a gps_datetime field to CAMMInfo to carry the extracted timestamp
- Enriches CAMM Type 5 points with computed epoch timestamps in
  CAMMVideoExtractor using the formula:
    epoch = rmkn_gps_epoch + (point.time - first_point.time)
- Converts enriched points to CAMMGPSPoint (Type 6) so downstream
  consumers receive proper GPS epoch times
- Adds unit tests for RMKN parsing (valid, little-endian, missing GPS
  IFD, truncated, bad magic) and point enrichment logic
@caglarpir caglarpir force-pushed the extract-rmkn-gps-timestamps branch from 1ac8cff to b45aca4 Compare February 25, 2026 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant