Geotagging frames from GoPro video with more than 1 FPS

I stumbled upon your blog and your info on geotagging frames from a (GoPro) video really helped a lot - thanks for that. There is just one thing: I need to save more than one image per second from the video file - for example the whole 30 or 60 FPS and tag all of them with GPS data.

Do you have an idea how one could achieve that?

Hey @haimat,

Welcome to the forum!

The GoPro metadata standard reports GPS at a different resolution to frame rate. e.g. a 60 second frame rate (60 images p/second), might only have 20 GPS points. Without going into too much detail, this is due to limitation of cheaper GPS units.

A bit more here, with examples of how 30FPS only produces around 18 GPS points a second:

Is it essential all 30/60 frames are resolved with GPS points?

Hey David, thanks for your quick reply!

Yes I need GPS data for each frame, because we need to localize the objects found on these images as precisely as possible. I am able to read detailed GPS data from the MP4 file, i.e. with more than one data point per second.

Now I was thinking of writing a (Python) script that would first calculate the time of a frame within the video and write that (start + elapsed time) as original date exif information into the JPG file. Then as a second step I would read in all GPS data points from the GPX file, go through each video frame, get its time stamp in order to find the GPS data point that is closest to that time stamp. Or even better: Get the GPS data point that is before that image time stamp and the one after and then interpolate these GPS data points.

Would this be a good approach? And isn’t there any tool that achieves this already?

Got it.

I think this is mostly covered in an old script of ours (that uses ffmpeg and exiftool):

You can manually specify the frame rate to match the video

python -t timecapture -r 30 "/INPUT/VIDEO.mp4" "OUTPUT_IMG_DIR"

Let me know how you get on.

Thanks - I found that script before, but according to the docs on GitHub the frame rate has to be less than 1. This is also what I get as error message when I call your script with -r 30 :frowning:

Ah, it is so long since I wrote that. I am sure the reason being was I was having trouble writing in GPS to all frames.

Would this be a good approach? And isn’t there any tool that achieves this already?

Your approach is the best I can think of. It will result in some duplicated GPS values (where less GPS values per second than photos).

If accuracy is important, in future you could run a separate professional GPS unit to capture positioning at a higher resolution that the GoPro (and other consumer cameras) can support.

If you do script this, I’d love to take a look at your implementation when it’s complete @haimat

Ok, thanks for your response.
I will try to write it as sharable script :slight_smile:

HQ | Blog | View / Upload Photos | Become a Trekker | Facebook | Instagram