GPS Altitude missing, extracting from ContourGPS Quicktime .mov file

Started by geoffers, April 27, 2020, 06:39:55 AM

Previous topic - Next topic

geoffers

Hi – new user here so please be kind ;D... any help or input would be greatly appreciated.

I'm trying to extract GPS data from a QuickTime .mov file produced by a Contour GPS action camera and have been successful so far, using the notes etc. in the Exiftool help (very impressed so far)

The one thing which is missing however is the GpsAltitude. Is there an additional command I'm missing to extract the altitute from the metadata in the NMEA $GPGGA sentence described below?

If I run the command   exiftool -a "-gps*" –ee myfile.mov I see the following (which presumably is the GPS data which the command is able to extract, and is missing the GpsAltitude)
GPS Date/Time : 2020:04:12 09:50:36.00Z
GPS Latitude  : 51 deg 29' 14.57" N
GPS Longitude : 2 deg 45' 58.24" W
GPS Speed     : 29.882
GPS Speed Ref : km/h
GPS Track     : 46.13
GPS Track Ref : True North


However if I run exiftool -c "%+.6f" –ee  myfile.mov I  can see the NMEA sentences which contain the actual data, with the GpsAltitude in this case being the 33.3,M field in the $GPGGA sentence
Sample Time    : 0.25 s
   Sample Duration: 0.25 s
   Text           : $GPRMC,095036.00,A,5129.24278,N,00245.97062,W,16.135,46.13,120420,,,A*7D..  $GPGGA,095036.00,5129.24278,N,00245.97062,W,1,08,0.94,33.3,M,48.8,M,,*78..
   GPS Date/Time  : 2020:04:12 09:50:36.00Z
   GPS Latitude   : +51.487380
   GPS Longitude  : -2.766177
   GPS Speed      : 29.882
   GPS Speed Ref  : km/h
   GPS Track      : 46.13
   GPS Track Ref  : True North
   Text           : $GPGGA,095036.00,5129.24278,N,00245.97062,W,1,08,0.94,33.3,M,48.8,M,,*78..


The actual output GPX file extracted using the Contour "Storyteller"  software (which I'm trying to avoid using – hence this query) shows the following data extracted from the NMEA data which does include the altitude in the <ele> tag  (note also that the speed has been extracted  from the $GPRMC sentence, where 16.135kts = 8.3m/s  = 29.882km/h)
    <name>Track exported from Contour camera movie: FI010053.mov</name>
    <trkseg>
      <trkpt lat="51.487380" lon="-2.766177">
        <time>2020-04-12T09:50:36Z</time>
        <ele>33.3</ele>
        <speed>8.3</speed>
        <course>46.13</course>
        <magvar></magvar>
        <fix></fix>
        <sat>08</sat>
        <hdop>0.94000</hdop>
        <vdop></vdop>
        <pdop></pdop>
        <geoidheight></geoidheight>
        <extensions>
          <mediatime>00:00:00.25</mediatime>
          <qtmediatimescale>90000</qtmediatimescale>
          <qtmediatimevalue>22500</qtmediatimevalue>
          <valid>1</valid>
        </extensions>
      </trkpt> 

Phil Harvey

NMEA is a bit tricky because the GGA sentence contains the elevation, but the RMC sentence contains the date.  Some cameras store these in separate blocks, and it can be difficult to put them back together again, so ExifTool uses just the RMC sentences in this case.

Combining the GGA with the RMC will take a bit of work, but I will do this for the next release if you can send me a (hopefully not too large) sample.  Upload it to some file server and send me a link (philharvey66 at gmail.com).

- 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 ($).

geoffers

Wow - thanks for your quick response.

I'll PM you with the mov file details. It's about 3 mins & 176meg so hope that's not too big. (I can wander around outside for a few seconds & make a smaller one if you want  ;D)

Thanks, Geoff

Phil Harvey

...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 ($).

geoffers


Phil Harvey

Got it, thanks.  I'll see about releasing a new version with full support for this format within a day or two.

- 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 ($).

Alan Clifford

Quote from: Phil Harvey on April 27, 2020, 06:51:21 AM

Combining the GGA with the RMC will take a bit of work, ...

I used the time stamp to match the sentences in a log file from my Nikon W300 camera.  But I couldn't find any reference as to whether sentences in a NMEA log file always came in a specific order which was a bit disconcerting.

Phil Harvey

The NMEA specification really sucks for that reason.  For RMC/GGA this is do-able using the common timestamp as you mentioned, but other sentences don't have a timestamp.

However, the complication for me is not just in matching the timestamps.  It vastly complicates the logic ExifTool uses to group tags into sub-documents if the RMC and GGA are physically in different blocks of the timed metadata.

- Phil

Edit: Luckily for this specific sample the corresponding sentences are in the same subtitle Text block, but I know this isn't the case for all cameras.
...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 ($).

Phil Harvey

I've just released ExifTool 11.97.  This version should fully decode the GGA sentence if available.  The changes were fairly significant, but it didn't "vastly" complicate the logic as I thought it could -- I came up with a sneaky way to backdate new tags to a previous sub-document if they had the same timestamp as a previous NMEA sentence.

- 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 ($).

geoffers

Many thanks Phil - that looks perfect

exiftool -a "-gps*" -ee H:\Rouvy\brockleyClevedon\FI010053.mov
GPS Altitude                    : 33.3 m
GPS Dilution Of Precision       : 0.94
GPS Date/Time                   : 2020:04:12 09:50:36.00Z
GPS Latitude                    : 51 deg 29' 14.57" N
GPS Longitude                   : 2 deg 45' 58.24" W
GPS Satellites                  : 08
GPS Speed                       : 29.882
GPS Speed Ref                   : km/h
GPS Track                       : 46.13
GPS Track Ref                   : True North


And the extracted GPX file (using gpx.fmt) is just what I needed

<?xml version="1.0" encoding="utf-8"?>
<gpx version="1.0"
creator="ExifTool 11.97"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.topografix.com/GPX/1/0"
xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd">
<trk>
<number>1</number>
<trkseg>
<trkpt lat="51.4873796666667" lon="-2.766177">
  <ele>33.3</ele>
  <time>2020-04-12T09:50:36.00Z</time>
</trkpt>   

Phil Harvey

...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 ($).