How to derive GPS data from a video

:timer_clock: Sharing this in case it’s helpful for others. :video_camera:
Use this command in macOS Terminal or Windows Command Prompt to create a .gpx file from a video that contains embedded GPS. I can confirm it works perfectly with GoPro Max .360 files.

  1. Install Exiftool.
  2. Download the gpx.fmt file from here and put it in the folder that contains your videos (or alter the command below to reference it’s location). You can also choose another GPS format if you prefer.
  3. Run the following command for file in /Users/username/folder/*; do exiftool -ee -p gpx.fmt "$file" > "${file%.*}".gpx; done. This will loop through the files in the folder you specify and derive GPS data for each, saving it to a .gpx file named after the source file.

Success should look something like this:

Why use this? In my case my GoPro decided to reset itself to 2016 (a common issue), so all my videos have the wrong timestamps. Luckily GPS has the correct time by definition, so by extracting the GPS data I can get the correct times for each frame of the video and write them into the extracted image frames using mapillary_tools.

For this we of course owe thanks to the amazing Phil Harvey, creator of ExifTool. He has been continually improving ExifTool for years and supporting thousands in the ExifTool forums.

3 Likes