Inverse geotagging from NextBase dashcam footage

Started by jusw, March 18, 2016, 11:10:38 AM

Previous topic - Next topic

Phil Harvey

North should be 0 if this is compass data.  I thought about direction, but it didn't make sense because you made some 90 degree turns and I don't see changes in this number that reflect this.

Also, is this local time or UTC?

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

zubairlk

Quote from: Phil Harvey on October 09, 2018, 09:12:44 AM

Also, does the video start at 06:42 local time, or UTC?

This is from the UK so local time is the same as UTC.
The actual time of footage was 07:42 cause of daylight saving.
But the camera hasn't picked that from the GPS and remains at GMT +0.

Regards
ZubairLK

Phil Harvey

Thanks.  I'll just assume UTC and add "Z" to the date/time values like I do with the NextBase 512GW (although the 512G format is VERY different!).

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

Phil Harvey

#18
Actually, I think you are right about the compass data.  Could the signed value be degrees * 100?  (in the range -180 to 180 degrees?)

- Phil

Edit: So is the the direction of the camera, or direction of travel?  (ie. GPSTrack, or GPSImgDirection?)
...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.13 with the assumption that the direction should be extracted as GPSTrack -- please let me know if you discover otherwise.  It should be GPSTrack for the 512GW because it was stored as an NMEA RMC sentence, and the NMEA specification states that this is the track direction.  I'm hoping the 512G is the same (even though it isn't stored as NMEA).

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

zubairlk

Thank-you so much! I'll check it out over the weekend and let you know.

Regards
ZubairLK

Watcher

I just happen to be looking at extracting GPS data from nextbase MOV files.
We have a few threads open on this topic at the dashcamtalk forum, for
example https://dashcamtalk.com/forum/threads/next-base-312-gps-format.29175/#post-440026.

The sggps program mentioned there will decode video written by older firmware,
but Nextbase have changed the way they record GPS under more recent firmware.
It now seems to be straight forward  NMEA. I am exploring the go language which is new to me before writing a version to handle, at least, the Nextbase 312GW output. It looks straightforward.

If you compare the old and new versions of the GPS data with the NMEA spec, it ought to be possible to identify all the fields.

Hope this helps.

Phil Harvey

As I mentioned earlier, my 512GW sample stores GPS in NMEA format, and ExifTool can decode that.  If you have any samples that don't work with ExifTool, please send them to me.

Thanks.

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

Watcher

I have at last put my program "mov2gpx" onto github at
github.com/clarified/mov2gps.

It works with Nextbase 312GW and similar cameras. But not (yet) with the other Nextbase models. After it was written, Nextbase sent me samples from their other models that generate MOV rather than mp4. I was surprised that the way that the gps information was recorded was different enough to stop Version1 working. But except for one outlier, it seems to be easy to modify mov2gpx to handle them. That will be Version 2 - but it will have to wait until I have some spare time.

exiftool was useful when writing mov2gpx.

mjc-506

Sorry for the necro-bump...

I have a 522GW, and reverse geocoding nearly works.

'.\exiftool.exe' -n -s -ee .\file.MP4
...
SampleTime                      : 59.7
SampleDuration                  : 0.1
Text                            : 20200312110802.Ç      $GPRMC,110803.700,A,5214.38508,N,00415.90726,W,6.873,138.26,120320,,,A*56...$GPGGA,110803.800,5214.38494,N,00415.90705,W,1,07,1.08,31.5,M,51.9,M,,*5C..
GPSDateTime                     : 2020:03:12 11:08:03Z
GPSLatitude                     : 52.2397513333333
GPSLongitude                    : -4.265121
GPSSpeed                        : 12.728796
GPSSpeedRef                     : K
GPSTrack                        : 6.873
GPSTrackRef                     : T
Text                            : $GPGGA,110803.800,5214.38494,N,00415.90705,W,1,07,1.08,31.5,M,51.9,M,,*5C..
SampleTime                      : 59.8
SampleDuration                  : 0.1
Text                            : 20200312110802Ç.└      $GPRMC,110803.900,A,5214.38480,N,00415.90682,W,7.114,136.44,120320,,,A*55...$GPGGA,110803.900,5214.38480,N,00415.90682,W,1,07,1.08,31.5,M,51.9,M,,*56..
GPSDateTime                     : 2020:03:12 11:08:03Z
GPSLatitude                     : 52.2397466666667
GPSLongitude                    : -4.26511366666667
GPSSpeed                        : 13.175128
GPSSpeedRef                     : K
GPSTrack                        : 7.114
GPSTrackRef                     : T
Text                            : $GPGGA,110803.900,5214.38480,N,00415.90682,W,1,07,1.08,31.5,M,51.9,M,,*56..
SampleTime                      : 59.9
SampleDuration                  : 0.1
Text                            : 20200312110802.Ç   @   $GPRMC,110803.900,A,5214.38480,N,00415.90682,W,7.114,136.44,120320,,,A*55...$GPGGA,110804.000,5214.38465,N,00415.90660,W,1,07,1.08,31.5,M,51.9,M,,*5F..
GPSDateTime                     : 2020:03:12 11:08:03Z
GPSLatitude                     : 52.2397466666667
GPSLongitude                    : -4.26511366666667
GPSSpeed                        : 13.175128
GPSSpeedRef                     : K
GPSTrack                        : 7.114
GPSTrackRef                     : T
Text                            : $GPGGA,110804.000,5214.38465,N,00415.90660,W,1,07,1.08,31.5,M,51.9,M,,*5F..


The 522GW records GPS at 10Hz, but Exiftool reports timestamps only to the nearest second. Also, GPSTrack is taking its values from the wrong $GPRMC field? Elevation is also present in the GPGGA output, but not reported by Exiftool.

I tried to modify the gpx.fmt file to also dump the 'Text' tags into another field (intending to then process this outside Exiftool and update time, altitude and heading) but could only manage to output the second 'Text' tag (which only included the $GPGGA string).

The end goal is to use ffmpeg to split the mp4 into a series of images, and then geotag these using Exiftool.

Is there an (easy?) way to change the $GPRMC/$GPGGA fields read by Exiftool? Alternatively, is there a way of outputting both 'Text' tags to file?

(Exiftool 11.91 Windows executable - no perl)

Many thanks!

Phil Harvey

Could you send me a sample so I can test this myself?  My email is 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 ($).

mjc-506

Thanks Phil, an email with a GDrive link should be on its way to you now.

Edit: Perhaps I'm misunderstanding the GPSTrack tag - I thought this was heading, but it's actually distance travelled? I'm after a bearing so I can tell which way the camera was pointing...

Phil Harvey

This is a bit of a mess.  I can fix reading of the fractional seconds, but the bigger problem is that the GGA sentence in the same Text block as the RMC sentence is actually for the next fix.  Weird.

I think the best thing to do is to extract the raw Text data into a separate file, and work with this:

exiftool -ee -text -b MOVIEFILE > out.txt

Note that there is a binary header before the RMC entries (that likely contains accelerometer readings or some such).  However, this file can be used as-is to tag images like this (provided they have DateTimeOriginal set properly):

exiftool -geotag out.txt IMAGEFILE

To answer your question:  GPSTrack is the compass direction of travel.

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

mjc-506

You're right, all kinds of strange in there...

Perfect, that will do me for now, thanks. :)

Phil Harvey

ExifTool 11.92 (to be released soon) will extract the subseconds properly in GPSDateTime.  The RMC sentences will be used, and the GGA ignored for the purposes of generating the GPS tags.

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