Extracting GPS data from GoPro for each video frame

2.5k Views Asked by At

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?

0

There are 0 best solutions below