Guys, I did a survey using a camera without GPS and an external Garmin GPS, which generated a GPX file. However, I can’t get it to sync properly. I think the GPS date and time were incorrect at the time of recording.
When I upload it to Mapillary, there’s a huge mismatch between the track and the images.
Does anyone with experience know how to fix this? I need to extract frames (I use vid2jpg) and upload them to Mapillary, or at least align the MP4 with the GPX for submission. I’d also like to use the data in QGIS. I’ve tried several solutions, but nothing has worked so far. Any tips? I’m desperate to find a way to fix this!
As long as the positions are correct, fixing timestamps in the GPX file may be as easy as editing the timestamps in your favorite text editor. What is wrong with your timestamps? If your timestamps are off just due to timezone shift then they should be fairly easy to fix with a simple find and replace operation.
Some .mp4 files have a timecode stream, which can confuse some tools that try to match timestamped GPS positions (that is a GPX file) with video frame timestamps. You may have to strip such a timecode stream before you can pass a video file to a confused tool. AFAIK the Desktop Uploader and mapillary_tools ignore timecode streams and always use GPX timestamps only.
(I use vid2jpg)
When you have a GPX and a video file, you do not need to use any external tool. You can use the Desktop Uploader or mapillary_tools and the rest happens for you.
@jaderbavaresco - if you were recording with a camera without GPS as you mentioned, then in order for the .mp4 video and the .gpx to be in sync you would have needed to start each one at the exact same time. If there is an offset (like you started recording one a little bit earlier than the other) you’ll need to edit either the .mp4 file (for example to trim it) or the .gpx (with a text editor).
mapillary_tools also has these convenience options: --video_start_time, --interpolation_use_gpx_start_time, --interpolation_offset_time, and --offset_time.
The problem begins when a vehicle comes to a stop at a traffic light or due to slow traffic. Mapillary omits moving images of a stationary vehicle. Unfortunately, an artificially generated GPS track continues to run. The images and track then diverge dramatically. It is therefore of little help to start video and a GPS tracker at the same time when recording on separate devices. It is probably not for nothing that Insta first combines the GPS signal and the video signal in the camera and then separates them again when creating the mp4 file. How Mapillary finds the right entry into the GPX track again after removing images from a traffic light break is still a mystery to me.
It is neither a mystery nor magic. mapillary_tools and the Desktop Uploader (which builds on mapillary_tools) de‑duplicate images by default which are 0.1 m apart or their bearing differs less than 5°. See these process command options:
--duplicate_distance DUPLICATE_DISTANCE
The maximum distance that can be considered "too close" between two images. If both images also point in the same direction (see --duplicate_angle), the later image
will be marked as duplicate and will not be upload. [default: 0.1]
--duplicate_angle DUPLICATE_ANGLE
The maximum camera angle difference between two images to be considered as heading in the same direction. If both images are also close to each other (see
--duplicate_distance), the later image will be marked as duplicate and will not be upload. [default: 5.0]
I am not sure but maybe the default distance in the Desktop Uploader is 3 m.
It would be very helpful if you could optionally turn off this function. This would allow a video and an independently generated GPX track to reach the end of the recording at the same time.
I have already created a GPS track from an ODB-II car scanner recording as a test. However, I ultimately had to give up on this plan because the Mapillary function in question thwarted my plans by omitting downtime. The ODBII recording also enables a usable GPX track through tunnels. ODBII software packages are quite sufficient, as they are used for travel expense accounting and a lot of money is involved. It’s a shame that we do without this sufficient technology from motor vehicle traffic and instead have to contend with inadequate GPS recordings.
@osmplus_org - are you talking about using the Mapillary mobile apps in conjunction with an external GPS receiver? Or are you talking about using an external camera? Could you share on exactly the workflow you’re doing so we can replicate it?