GPX speed output abnormality

Started by pierWar, February 26, 2021, 01:21:54 PM

Previous topic - Next topic

pierWar

I'm trting to create graphs of speed against time and speed against distance from the GPS data of a dashcam MP4 video using the gpx format.
I'm using the command:

exiftool -p gpx.fmt -ee Sample.MP4 > Sample.gpx

when looking at the tables of gps data that this outputs in the .gpx file it is incorrect, the speed seems to be combining over 4 points (see image attached) so several pints read 0 and then the last one reads 113, when you compare it to the data that is output by a simpler command such as:

exiftool -ee Sample.MP4

the reported speeds are correct (in this case 28km/h).

Am I doing something wrong?

Edit: I believe now thats its a problem with how the the garmin 55 dashcam used works. I tested a different dashcam and it produced normal results. The "leg time" of the working dashcam was 1 seconf whereas the garmin uses a leg time of 0.25 seconds but I'm still unsure of how to fix this.

Phil Harvey

I don't know what it is, but screenshots that people post are rarely helpful.  What would be helpful is the ExifTool output for both your first command, and your second command with -G3 added.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

pierWar

Thanks for replying.

The standard input and output looks like this:


exiftool -ee Sample.MP4
.
.
.
.
[Main]          Image Size                      : 1280x720
[Main]          Megapixels                      : 0.922
[Main]          Avg Bitrate                     : 3.34 Mbps
[Main]          Rotation                        : 0
[Main]          GPS Position                    : 52 deg 23' 32.75" N, 1 deg 33' 5.48" W
[Doc1]          Sample Time                     : 0 s
[Doc1]          Sample Duration                 : 0.25 s
[Doc1]          GPS Latitude                    : 52 deg 23' 32.75" N
[Doc1]          GPS Longitude                   : 1 deg 33' 5.48" W
[Doc1]          GPS Speed                       : 22
[Doc1]          GPS Speed Ref                   : mph
[Doc1]          Warning                         : [minor] Approximating GPSDateTime as CreateDate + SampleTime
[Doc1]          GPS Date/Time                   : 2019:12:05 09:18:09.000Z
[Doc2]          Sample Time                     : 0.25 s
[Doc2]          Sample Duration                 : 0.25 s
[Doc2]          GPS Latitude                    : 52 deg 23' 32.75" N
[Doc2]          GPS Longitude                   : 1 deg 33' 5.48" W
[Doc2]          GPS Speed                       : 22
[Doc2]          GPS Speed Ref                   : mph
[Doc2]          GPS Date/Time                   : 2019:12:05 09:18:09.250Z
[Doc3]          Sample Time                     : 0.50 s
[Doc3]          Sample Duration                 : 0.25 s
[Doc3]          GPS Latitude                    : 52 deg 23' 32.75" N
[Doc3]          GPS Longitude                   : 1 deg 33' 5.48" W
[Doc3]          GPS Speed                       : 22
[Doc3]          GPS Speed Ref                   : mph
[Doc3]          GPS Date/Time                   : 2019:12:05 09:18:09.500Z
[Doc4]          Sample Time                     : 0.75 s
[Doc4]          Sample Duration                 : 0.25 s
[Doc4]          GPS Latitude                    : 52 deg 23' 32.70" N
[Doc4]          GPS Longitude                   : 1 deg 33' 5.08" W
[Doc4]          GPS Speed                       : 26
[Doc4]          GPS Speed Ref                   : mph
[Doc4]          GPS Date/Time                   : 2019:12:05 09:18:09.750Z
[Doc5]          Sample Time                     : 1.00 s
[Doc5]          Sample Duration                 : 0.25 s
[Doc5]          GPS Latitude                    : 52 deg 23' 32.70" N
[Doc5]          GPS Longitude                   : 1 deg 33' 5.08" W
[Doc5]          GPS Speed                       : 26
[Doc5]          GPS Speed Ref                   : mph
[Doc5]          GPS Date/Time                   : 2019:12:05 09:18:10.000Z



The gpx input produces this result:
C:\Users\IEUser\Documents\MyCases\PMA Garmin\Export\First test>exiftool -p gpx.fmt -ee -G3 GRMN0611.MP4 > Sample.gpx
.
.
.
Warning: [minor] Approximating GPSDateTime as CreateDate + SampleTime - GRMN0611.MP4
Warning: [Minor] Tag 'Doc1:gpsaltitude' not defined - GRMN0611.MP4
Warning: [Minor] Tag 'Doc10:gpsaltitude' not defined - GRMN0611.MP4
Warning: [Minor] Tag 'Doc100:gpsaltitude' not defined - GRMN0611.MP4
Warning: [Minor] Tag 'Doc101:gpsaltitude' not defined - GRMN0611.MP4
Warning: [Minor] Tag 'Doc102:gpsaltitude' not defined - GRMN0611.MP4
Warning: [Minor] Tag 'Doc103:gpsaltitude' not defined - GRMN0611.MP4
Warning: [Minor] Tag 'Doc104:gpsaltitude' not defined - GRMN0611.MP4
Warning: [Minor] Tag 'Doc105:gpsaltitude' not defined - GRMN0611.MP4
Warning: [Minor] Tag 'Doc106:gpsaltitude' not defined - GRMN0611.MP4
Warning: [Minor] Tag 'Doc107:gpsaltitude' not defined - GRMN0611.MP4
Warning: [Minor] Tag 'Doc108:gpsaltitude' not defined - GRMN0611.MP4
Warning: [Minor] Tag 'Doc109:gpsaltitude' not defined - GRMN0611.MP4
Warning: [Minor] Tag 'Doc11:gpsaltitude' not defined - GRMN0611.MP4
Warning: [Minor] Tag 'Doc110:gpsaltitude' not defined - GRMN0611.MP4
Warning: [Minor] Tag 'Doc111:gpsaltitude' not defined - GRMN0611.MP4
Warning: [Minor] Tag 'Doc112:gpsaltitude' not defined - GRMN0611.MP4
.
.
.


When using the gpx file to produce a speed vs time graph as seen in the image

Phil Harvey

GPSSpeed looks good in the -G1 output for the first 5 documents.  What does the .gpx output look like?

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

pierWar

here's the first 50 lines. Ive also attached the .gpx file if it helps.

<?xml version="1.0" encoding="UTF-8"?>
<gpx version="1.0" creator="GPSBabel - https://www.gpsbabel.org" xmlns="http://www.topografix.com/GPX/1/0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <time>2021-02-27T18:25:44.186Z</time>
  <bounds minlat="52.397000380" minlon="-1.631440222" maxlat="52.402648525" maxlon="-1.619959529"/>
  <trk>
    <number>1</number>
    <trkseg>
      <trkpt lat="52.402648525" lon="-1.631440222">
        <time>2018-10-05T00:01:47Z</time>
        <speed>0.000000</speed>
      </trkpt>
      <trkpt lat="52.402535286" lon="-1.631267387">
        <time>2018-10-05T00:01:47.250Z</time>
        <speed>68.899483</speed>
      </trkpt>
      <trkpt lat="52.402535286" lon="-1.631267387">
        <time>2018-10-05T00:01:47.500Z</time>
        <speed>0.000000</speed>
      </trkpt>
      <trkpt lat="52.402535286" lon="-1.631267387">
        <time>2018-10-05T00:01:47.750Z</time>
        <speed>0.000000</speed>
      </trkpt>
      <trkpt lat="52.402535286" lon="-1.631267387">
        <time>2018-10-05T00:01:48Z</time>
        <speed>0.000000</speed>
      </trkpt>
      <trkpt lat="52.402413664" lon="-1.631120956">
        <time>2018-10-05T00:01:48.250Z</time>
        <speed>67.196182</speed>
      </trkpt>
      <trkpt lat="52.402413664" lon="-1.631120956">
        <time>2018-10-05T00:01:48.500Z</time>
        <speed>0.000000</speed>
      </trkpt>
      <trkpt lat="52.402413664" lon="-1.631120956">
        <time>2018-10-05T00:01:48.750Z</time>
        <speed>0.000000</speed>
      </trkpt>
      <trkpt lat="52.402413664" lon="-1.631120956">
        <time>2018-10-05T00:01:49Z</time>
        <speed>0.000000</speed>
      </trkpt>
      <trkpt lat="52.402279135" lon="-1.630973853">
        <time>2018-10-05T00:01:49.250Z</time>
        <speed>72.009979</speed>
      </trkpt>
      <trkpt lat="52.402279135" lon="-1.630973853">
        <time>2018-10-05T00:01:49.500Z</time>
        <speed>0.000000</speed>

Phil Harvey

Doc1:GPSDateTime is "2019:12:05 09:18:09.000Z" in your -G3 output, but "2018-10-05T00:01:47Z" in the first track point of your .gpx output.  I can't compare the differences if they are from different source files.

You're making this much more difficult to diagnose than it needs to be.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

pierWar

Ah I'm incredibly sorry. Turns out I had 2 sample.gpx files and copied accross the wrong one.

This should be the correct file. As you can see only every 4th point has a speed value and that disagrees with the regular exiftool extraction i wrote before.


<?xml version="1.0" encoding="UTF-8"?>
<gpx version="1.0" creator="GPSBabel - https://www.gpsbabel.org" xmlns="http://www.topografix.com/GPX/1/0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <time>2021-02-28T00:00:12.947Z</time>
  <bounds minlat="52.390360236" minlon="-1.551522547" maxlat="52.392429309" maxlon="-1.547404351"/>
  <trk>
    <number>1</number>
    <trkseg>
      <trkpt lat="52.392429309" lon="-1.551522547">
        <time>2019-12-05T09:18:09Z</time>
        <speed>0.000000</speed>
      </trkpt>
      <trkpt lat="52.392429309" lon="-1.551522547">
        <time>2019-12-05T09:18:09.250Z</time>
        <speed>0.000000</speed>
      </trkpt>
      <trkpt lat="52.392429309" lon="-1.551522547">
        <time>2019-12-05T09:18:09.500Z</time>
        <speed>0.000000</speed>
      </trkpt>
      <trkpt lat="52.392416485" lon="-1.551410817">
        <time>2019-12-05T09:18:09.750Z</time>
        <speed>30.893047</speed>
      </trkpt>
      <trkpt lat="52.392416485" lon="-1.551410817">
        <time>2019-12-05T09:18:10Z</time>
        <speed>0.000000</speed>
      </trkpt>
      <trkpt lat="52.392416485" lon="-1.551410817">
        <time>2019-12-05T09:18:10.250Z</time>
        <speed>0.000000</speed>
      </trkpt>
      <trkpt lat="52.392416485" lon="-1.551410817">
        <time>2019-12-05T09:18:10.500Z</time>
        <speed>0.000000</speed>
      </trkpt>
      <trkpt lat="52.392408857" lon="-1.551295398">
        <time>2019-12-05T09:18:10.750Z</time>
        <speed>31.546223</speed>
      </trkpt>
      <trkpt lat="52.392408857" lon="-1.551295398">
        <time>2019-12-05T09:18:11Z</time>
        <speed>0.000000</speed>
      </trkpt>
      <trkpt lat="52.392408857" lon="-1.551295398">
        <time>2019-12-05T09:18:11.250Z</time>
        <speed>0.000000</speed>
      </trkpt>
      <trkpt lat="52.392408857" lon="-1.551295398">
        <time>2019-12-05T09:18:11.500Z</time>
        <speed>0.000000</speed>
      </trkpt>