1

I have a GoPro video that includes GPS data in the mp4 file. Now using a Python script I want to extract every single frame of that video and save the respective GPS coordinates of each frame. I found a Python library pygpmf, which helps to extract the GPS data from the video. That works quite well so far, the GPS data can be extracted as XML file in this format:

<?xml version="1.0" encoding="UTF-8"?>
<gpx xmlns="http://www.topografix.com/GPX/1/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd" version="1.1" creator="gpx.py -- https://github.com/tkrajina/gpxpy">
  <trk>
    <trkseg>
      <trkpt lat="44.1287283" lon="5.427715">
        <ele>833.759</ele>
        <time>2020-07-03T12:36:56.940000Z</time>
        <sym>Square</sym>
        <fix>3d</fix>
        <pdop>1.82</pdop>
        <extensions>
          <speed_2d>
            <value>9.221</value>
            <unit>m/s</unit>
          </speed_2d>
          <speed_3d>
            <value>9.25</value>
            <unit>m/s</unit>
          </speed_3d>
        </extensions>
      </trkpt>
      ...
    </trkseg>
  </trk>
</gpx>

That looks fine, however, I cannot see how I can link a frame to that list of GPS coordinates. Is there any way I am missing here? Or is there another library better suited for this job? Or do you have any other idea how I can get that GPS data per frame?

Matthias
  • 9,817
  • 14
  • 66
  • 125
  • You apparently have time up to 1/100 of second (`2020-07-03T12:36:56.940000Z`), can not you use it to decude to which frame this location belong? – Daweo Jun 02 '21 at 13:32
  • 1
    Well, I could try to link these time steps with the video meta data. I was hoping though there is an "official" way how one can get GPS data for each frame. – Matthias Jun 02 '21 at 13:38

0 Answers0