Ask a Question
GoPro Support Hub Ask a question. Share an answer. Find a solution. Stay stoked.
Announcements
Is your GoPro gear up to date? Check to see If it is on our Update page.
Reply
This is an open group. Sign in and click the "Join Group" button to become a group member and start posting.
Hiker
Posts: 27
Re: Exporting still image with GPS coordinates in EXIF

I'm interested in this  (but no experience using ffmpeg) but it doesn't look like this is possible. Someone can correct me if  I'm wrong, but given that threads on extracting an exact frame number (let alone timestamp) for an original frame show that this isn't simple, finding GPS coordinates based on the individual frame isn't possible directly.

 

As I understand it, there are no GPS coordinates mapped to individual frames as there would be with a single camera image from a still camera with a gps chip embedding coordinates into the metadata. Instead, GPS tracklogs alongside video (GoPro included) are separate streams (stored in various places and in various ways, making it interesting for developers to try and pull them out and make them comprehensible).

 

You can see some of the ramifications of this by looking at a GPX (or csv) of GoPro gps data extracted by dashware or GPMD2CSV: A hyperlapse I shot has 3 GPS stamps per second but 30 video frames per second. A 60fps video I shot has GPS coordinate data at 20x per second.

 

The best you'd be able to do -- if you could get a perfect timestamp for a frame off the video -- would be interpolating between the known GPS coordinates. Exiftool can do that for you via -geotag, or you can do it yourself using something like lightroom. Since any timestamp you got on a frame would be an interpolation, you'd be locating the frame by matching one interpolation to another. Probably more than adequate, but not simple.

 

If I were pulling frames, I'd just snapshot them in VLC player, fix the individual frame datetimeoriginal field to the video's shot datetime + elapsed time to the frame, and either let exiftool -geotag it (or them) from the exported gpx file, or drop them on a map in lightroom or similar in the next window. This would obviously only be tolerable for a handful of frames at a time.

 

Maybe there's a better way.

Highlighted
Nomad
Posts: 107
Re: Exporting still image with GPS coordinates in EXIF

@thegrave 

I'm not suggesting that you extract GPS metadata using ffmpeg.

It might be easier to suggest possible solutions if you could explain at a high level what you are ultimately trying to do with the MP4 and the images you export and GPS tag from the MP4.

Sightseer
Posts: 9
Re: Exporting still image with GPS coordinates in EXIF
Hm, my understanding was that telemetry data is embedded in the MP4 file as a separate stream. Hence only handful of software was able to read it. At least Dashware is generating some sort of a track (I can't find a way to export) purely based on an MP4 file, I'm not feeding it anything else.
Hiker
Posts: 27
Re: Exporting still image with GPS coordinates in EXIF

Dashware already exports the data to a CSV, which is found in the project save folder alongside the other saved project files. If and when you grab the correct data profile, and the sync is OK, it then does the overlays and gauges correctly (though not always, in my experience. Hyperlapses seem to vex it, as they vex Quik).

 

A GPX  (as well as few different CSV) exports of the telemetry can be obtained via GPMD2CSV's batch process. These can also easily be used in dashware with the correct data profile. However,  (again, as I understand it) there's no per-frame GPS data to be obtained by any extraction method, because  (as outlined above) this does not exist. There's video stream. There's telemetry and  GPS data in a separate stream, and these are not mapped to each other frame by frame. Any software mapping overlay is interpolating map position and frame display based on a synchronization routine from a more-or-less known position at a more-or-less known time (either automatic or manual).

Nomad
Posts: 107
Re: Exporting still image with GPS coordinates in EXIF
[ Edited ]

@thegrave 

Let me clarify. Yes, you could use ffmpeg to extract the metadata from the MP4. But, it would be at the track (aka stream) level. The GPS data associated with a specific frame would need to be done using another method from the extracted track data.

Again, could you please explain at a high level what you are trying to achieve?

Sightseer
Posts: 9
Re: Exporting still image with GPS coordinates in EXIF
1 second precision is good enough, as long as you can match the GPX track to the video track. Something along these lines can be done I think:

1) Extract a GPX (either from MP4 or misc telemetry files on the GoPro)
2) Check the file creation timestamp in the EXIF of the MP4
3) Mark down the time of extracting the JPGs with 1s precision and hand them over to ffmpeg
4) Check the duration from the start frame to the target frame and add this time difference to the original file creation time from EXIF
5) Grab coordinates from GPX
6) Apply geotag with exiftool.

(Even semi-)Automating this will be a real pain in the ass IMHO. I started by simply comparing a movie EXIF file creation timestamp and GPX exported from here:

https://tailorandwayne.com/gopro-telemetry-extractor/

There is a big discrepancy in timing, about 10 minutes (and couple of hours but let's say this is due to the timezone). I guess this telemetry extractor is buggy.

Btw snapshotting from VLC player will give you at max your monitor resolution and video stream will be almost always certainly higher so not sure it's a good idea.

Just saw this other topic:

https://community.gopro.com/t5/GoPro-Metadata-Visualization/DroneViewer-video-and-data-visualizer-no...

Advertisement video claims to be able to do what I need but on MacOS only:

https://youtu.be/Rw1PsbiB8q0?t=193

I got Windows 7 and 10 but software is buggy as hell and can't load a single video with it, let alone export a JPG. Anyone caring to try?
Tourist
Posts: 10
Re: Exporting still image with GPS coordinates in EXIF

This may help: The Mac version of DroneViewer embeds GoPRO GPS coordinates in the EXIF section of the JPG and also in the title of the image:

 

Sightseer
Posts: 9
Re: Exporting still image with GPS coordinates in EXIF
Mucho nice!

I can only hope this is valid for the Windows version nowadays as well. Running another VM with MacOS just because of this software makes me wanna shoot myself in the foot :)