Hello,
While working with video + SRT workflows in ODM (especially for RTK / ground-based video use cases), I identified several issues that can lead to loss of precision or incorrect metadata parsing. I’m sharing them briefly with suggested fixes.
Issue 1 – GPS altitude is rounded when written to EXIF
File: opendm/video/video2dataset.py
Altitude values are correctly parsed from the SRT file, but they are rounded to an integer when written to EXIF:
gps_ifd[piexif.GPSIFD.GPSAltitude] = float_to_rational(round(altitude))
# 192.048 -> 192
This causes loss of vertical accuracy, which is critical for RTK and precise ground surveys.
Suggested fix:
gps_ifd[piexif.GPSIFD.GPSAltitude] = float_to_rational(altitude)
or (to preserve millimeter precision with a stable denominator):
gps_ifd[piexif.GPSIFD.GPSAltitude] = float_to_rational(round(altitude * 1000) / 1000)
Issue 2 – Missing comma in shutter regex list
File: opendm/video/srtparser.py
Due to a missing comma, two regex patterns are unintentionally concatenated into a single string:
shutter = match_single([
"shutter : \d+/(\d+\.?\d*)"
"SS (\d+\.?\d*)"
], line)
Suggested fix:
shutter = match_single([
"shutter : \d+/(\d+\.?\d*)",
"SS (\d+\.?\d*)"
], line)
Issue 3 – Incorrect zero check when parsing latitude/longitude/altitude
File: opendm/video/srtparser.py
The following condition compares a string to an integer and therefore always evaluates to True:
lambda v: float(v) if v != 0 else None
Suggested fix:
fv = float(v)
return fv if fv != 0 else None
Issue 4 – RTK altitude regex only matches integers
File: opendm/video/srtparser.py
The current regex does not capture floating-point RTK altitude values:
("RTK ... (-?\d+)\)", ...)
Suggested fix:
(-?\d+\.?\d*)
These issues mainly affect GPS/Z accuracy and metadata consistency, particularly in high-precision RTK and ground-based video workflows.
I’d be happy to help with testing or preparing a PR if needed.
Thanks for the great work on ODM.