We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 7a9df77 + 13cf7ef commit 401b962Copy full SHA for 401b962
1 file changed
mapillary_tools/sample_video.py
@@ -354,7 +354,14 @@ def _sample_single_video_by_distance(
354
f"interpolated time {interp.time} should match the video sample time {video_sample.exact_composition_time}"
355
)
356
357
- timestamp = start_time + datetime.timedelta(seconds=interp.time)
+ # Try to use GPS epoch time if available (for timelapse videos)
358
+ gps_epoch_time = interp.get_gps_epoch_time()
359
+ if gps_epoch_time is not None:
360
+ timestamp = datetime.datetime.fromtimestamp(
361
+ gps_epoch_time, tz=datetime.timezone.utc
362
+ )
363
+ else:
364
+ timestamp = start_time + datetime.timedelta(seconds=interp.time)
365
exif_edit = ExifEdit(sample_paths[0])
366
exif_edit.add_date_time_original(timestamp)
367
exif_edit.add_gps_datetime(timestamp)
0 commit comments