OpenStreetMap logo OpenStreetMap

HeBri's Diary

Recent diary entries

Extracting geo-referenced images from video-recordings

Material:
  • Video file with known recording times / places
  • Track recording (gpx-file) for the video camera position
Tools:
  • mapillary_tools.exe (or ffmpeg) to extract the images from the video
  • exiftool.exe for manipulation of the image meta data information
  • JOSM (Openstreetmap-editor) for controlling the image positions (Alternatively you can use Garmin Basecamp for this task)

1st step: Extract images from the video (with mapillary_tools)

Since for me the video timestamp could not be extracted and writing the images with giving a start time did not work as well, the time is corrected later.

mapillary_tools.exe sample_video --video_import_path c:\VideofileOrDirectory --import_path c:\TargetDir --advanced --video_sample_interval 0.5

This step creates a subfolder with the extracted images for each video file.

With a maximum speed of 100 km/h (near 28 m/s) and 0.5 seconds sample time the distance between two consecutive images is at most about 14 meters. With slower movement the spacial distance between the images is smaller.

If the images are to be uploaded to Mapillary the distance should not be selected much larger. If the images are used for working in JOSM only an sampling interval of 3 to 5 seconds should be sufficient, depending on the speed at recording.

The timestamps in the image files correspond to the sampling interval where the first file in every subfolder starts at 1970/01/01 at 00:00:00 (Midnight) and increases with the sampling time in the sampled file sequence.

For the time correction test you should select and copy a file with distinct content. (Reaching a crossing, passing a bridge or similar)

2nd step: First correction of the timestamp

See full entry