Author Topic: extract GPS from Pittasoft Blackvue dashcam?  (Read 286 times)

fmp2a

  • Newbie
  • *
  • Posts: 8
extract GPS from Pittasoft Blackvue dashcam?
« on: April 16, 2019, 06:31:10 PM »
Hi,
I was unable to extract correctly gps data from mp4 movie from my dashcam.
Could you help me?

Here a sample mp4 movie:
https://drive.google.com/open?id=1XtsJQPZMMPsB8BH0hGyrFksW6gLA0Fgc

And here an extract with -v5: exiftool -v5 20190415_121653_EF.mp4
https://drive.google.com/open?id=1laMHLcJq2oAYJ90EZBExMoW806mPwnuZ

We can see some NMEA sentences in tag '-Free': exiftool -U -Free -b 20190415_121653_EF.mp4
https://drive.google.com/open?id=1NXbnSKnJ0vISA9_YP8zMHbsLgMea_Q3k

I would like to extract GPS data and export to a gpx file.

Thanks.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14748
    • ExifTool Home Page
Re: extract GPS from Pittasoft Blackvue dashcam?
« Reply #1 on: April 16, 2019, 09:55:41 PM »
I'll take a look at this first thing tomorrow and post back here after I have looked at it.

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

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14748
    • ExifTool Home Page
Re: extract GPS from Pittasoft Blackvue dashcam?
« Reply #2 on: April 17, 2019, 08:12:57 AM »
OK, I can see the accelerometer data and GPS log.  The GPS log is text and looks like this (basically an NMEA track log with a leading timestamp of some kind):

Code: [Select]
[1555330614073]

[1555330614073]$GPGGA,101651.00,4158.08609,N,00845.58707,E,1,07,1.02,142.2,M,46.8,M,,*5E

[1555330614073]$GPGSA,A,3,10,24,12,13,17,19,15,,,,,,1.93,1.02,1.63*02

[1555330614073]$GPGSV,3,1,11,06,02,108,,10,15,293,25,12,54,246,31,13,23,154,25*78

[1555330614073]$GPGSV,3,2,11,15,47,187,34,17,30,051,36,19,45,077,31,20,10,265,16*7C

[1555330614073]$GPGSV,3,3,11,24,76,341,41,25,17,243,,32,01,324,*4C

[1555330614073]$GPGLL,4158.08609,N,00845.58707,E,101651.00,A,A*60

[1555330614073]$GPRMC,101652.00,A,4158.09041,N,00845.58949,E,13.065,26.45,150419,,,A*67

[1555330614073]$GPVTG,26.45,T,,M,13.065,N,24.196,K,A*01[1555330615078]

[1555330615078]$GPGGA,101652.00,4158.09041,N,00845.58949,E,1,08,1.02,142.7,M,46.8,M,,*58

[1555330615078]$GPGSA,A,3,10,20,24,12,13,17,19,15,,,,,1.93,1.02,1.63*00

[1555330615078]$GPGSV,3,1,11,06,02,108,,10,15,293,23,12,54,246,35,13,23,154,25*7A

[1555330615078]$GPGSV,3,2,11,15,47,187,28,17,30,051,39,19,45,077,31,20,10,265,17*7F

[1555330615078]$GPGSV,3,3,11,24,76,341,33,25,17,243,,32,01,324,*49

I can easily extract the whole log in text form, and patch the next version of exiftool to ignore leading garbage before the NMEA sentence so that you can geotag images from this log.  But you would have to use some other utility to convert this to a GPX file unless I do more work to parse this in ExifTool... I'll look into this.

Parsing the accelerometer data is easier, and the result looks like this (excerpt from exiftool -ee -G3 output):

Code: [Select]
[Doc1]          Time Code                       : 0
[Doc1]          Accelerometer                   : 12.6 1 3.6
[Doc2]          Time Code                       : 0.1
[Doc2]          Accelerometer                   : 11.4 1.6 3.2
[Doc3]          Time Code                       : 0.21
[Doc3]          Accelerometer                   : 13 2.4 3
[Doc4]          Time Code                       : 0.32
[Doc4]          Accelerometer                   : 12 1.8 2.4
...

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

fmp2a

  • Newbie
  • *
  • Posts: 8
Re: extract GPS from Pittasoft Blackvue dashcam?
« Reply #3 on: April 17, 2019, 08:23:10 AM »
Great!
The leading timestamp seems to be the unix epoch in ms.
Waiting for your next version...
Thanks

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14748
    • ExifTool Home Page
Re: extract GPS from Pittasoft Blackvue dashcam?
« Reply #4 on: April 17, 2019, 08:36:40 AM »
The leading timestamp seems to be the unix epoch in ms.

Right.  Thanks.  I just figured this out and came back to find that you beat me to it! :)
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14748
    • ExifTool Home Page
Re: extract GPS from Pittasoft Blackvue dashcam?
« Reply #5 on: April 17, 2019, 08:51:38 AM »
I have a working version now that will produce a GPX file with timestamps and lat/lon.  It this good enough?  Extracting stuff like altitude from the other NMEA sentences would be possible, but more work.

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

fmp2a

  • Newbie
  • *
  • Posts: 8
Re: extract GPS from Pittasoft Blackvue dashcam?
« Reply #6 on: April 17, 2019, 08:59:10 AM »
Yes! Gpx with timestamps end lat/long is enough. This is very cool.
Others improvments to handle altitude, heading or accelerometer are welcome but not necessary for now...
Thanks again.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14748
    • ExifTool Home Page
Re: extract GPS from Pittasoft Blackvue dashcam?
« Reply #7 on: April 17, 2019, 09:29:03 AM »
OK, great.  I'll also extract speed and heading since they are in the RMC sentence.

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

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14748
    • ExifTool Home Page
Re: extract GPS from Pittasoft Blackvue dashcam?
« Reply #8 on: April 17, 2019, 10:52:44 AM »
ExifTool 11.37 is now available.

ExifTool now extracts 27 different formats of streaming GPS from videos.

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

fmp2a

  • Newbie
  • *
  • Posts: 8
Re: extract GPS from Pittasoft Blackvue dashcam?
« Reply #9 on: April 17, 2019, 01:37:20 PM »
works great!