mapillary / mapillary_tools

Command line tools for processing and uploading Mapillary imagery
BSD 2-Clause "Simplified" License
264 stars 137 forks source link

EXIF time problem when extracting photos from split videos #606

Closed PierreSerpe closed 1 year ago

PierreSerpe commented 1 year ago

Basic information

Steps to reproduce behavior

  1. Record a movie with GoPro Hero11 lasting long enough to have an automatic file split
  2. Use the following command to extract photos from the videos: _mapillary_tools video_process MY_VIDEO_DIR MY_SAMPLES --video_sampledistance 5
  3. Check the EXIF time of the last photo extracted from the first and second video. Compare EXIF times of photos extracted from both videos.

Expected behavior

The EXIF time of the first photo extracted from the second video should be equal to the EXIF time+~1sec of the last photo extracted from the first video.

Actual behavior

The time of the last photos from both videos is the same. As a result, the EXIF time of the photos extracted from the second video is already in use in the photos extracted from the first video. This becomes a problem when synchronising GPS position with a GPX file in geosetter.

Corresponding data

GX020106_0_013289

...

Additional information

...

Exif time of the last photo exported from the first video is 8:27:21 : image

Exif time of the last photo exported from the second video is 8:27:20 : image

ptpt commented 1 year ago

It's likely to be the split videos have the same video timestamp. See https://github.com/mapillary/mapillary_tools/issues/505

Can you check the tags -> creation_time of the video track, and see if they are the same?

ffprobe -show_streams -print_format json video1.mp4
ffprobe -show_streams -print_format json video2.mp4
PierreSerpe commented 1 year ago

Both video track have the same creation time indeed. Would merging the video track into a single long track (before extracting) help to avoid timestamp problems?

ptpt commented 1 year ago

The plan was to find all video segments in a folder (by name pattern) and calculate the video time shift. No need to combine videos (which is expensive).

Thanks for the feedback. Let's track the updates in #505