GPS Date/Time YEAR= 4022 instead of 2022 from Kenwood dashcam mp4 file

Started by oldHacker, October 26, 2022, 01:52:17 AM

Previous topic - Next topic

oldHacker

Please see attached files with GPS data from a Kenwood DRV-A301W dashcam (maybe format 62?).
GPS Date/Time : 4022:07:12 14:40:07Z  should be
GPS Date/Time : 2022:07:12 14:40:07Z
May be related to zulu vs local time. 14:40 is local time. See more detailed notes along with complete exiftool output in the attached files. I've been all thru the site and the forum, sorry if i missed a previous solution. Thought i'd post this question before trying some of the python utilities. It seems that you dig deeper into the video metadata with exiftool than the python utilities i've seen.
Thanks from an old hacker.

attached;
20220712_143905.MP4_gpx2022a.fmt_4022DateErr.txt
20220712_143905.MP4_ee3-ALL_4022DateErr.txt

Phil Harvey

Can you upload the video somewhere so I can take a look?  You can email 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 ($).

oldHacker

Thanks much for the prompt reply.  Here's a smaller mp4, might be easier to work with. It contains only 3 GPS Date/Time datapoints, all with YEAR =4022.
20220712_143905.MP4 (422 MB) is 'Finalizing' the upload to dropbox now - but might be hung. will email the link when done.

attached;
20220829_132940.MP4
20220829_132940.MP4_ee3-ALL_4022DateErr.txt

oldHacker

link to the 422MB mp4 file 
https://www.dropbox.com/s/s74t0bc3f7kyqt2/20220712_143905.MP4?dl=0

5 min video, 239 GPS track points.
points 1,2,4 YEAR =2022, all others YEAR =4022

Phil Harvey

Great, thanks.  I can reproduce this problem.  I'll post back here when I've had a chance to look at it in detail.

- 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

This is insane.  Here are the first 3 points from the large video you uploaded:

Type='gps ', Sample 55 of 300 (16384 bytes)
 4d4ed34: 00 00 40 00 66 72 65 65 47 50 53 20 f0 03 00 00 [..@.freeGPS ....]
 4d4ed44: 15 00 00 00 27 00 00 00 3a 00 00 00 16 00 00 00 [....'...:.......]
 4d4ed54: 07 00 00 00 0c 00 00 00 41 4e 57 00 7f 0e 94 45 [........ANW....E]
 4d4ed64: 71 52 37 46 29 5c 0f 3f 3d 2a 8e 43 fe ff ff ff [qR7F)\.?=*.C....]
 4d4ed74: fc ff ff ff fa ff ff ff 00 00 00 00 00 00 00 00 [................]
    [snip 16304 bytes]
GPSDateTime = 2022:07:12 21:39:58Z
GPSLatitude = 47.6302001953125
GPSLongitude = -117.543505859375
GPSSpeed = 1.03712000441551
GPSTrack = 284.329986572266
Type='gps ', Sample 56 of 300 (16384 bytes)
 4eb5ec0: 00 00 40 00 66 72 65 65 47 50 53 20 f0 03 00 00 [..@.freeGPS ....]
 4eb5ed0: 15 00 00 00 27 00 00 00 3b 00 00 00 16 00 00 00 [....'...;.......]
 4eb5ee0: 07 00 00 00 0c 00 00 00 41 4e 57 00 7f 0e 94 45 [........ANW....E]
 4eb5ef0: 72 52 37 46 1f 85 eb 3e ec 31 87 43 04 00 00 00 [rR7F...>.1.C....]
 4eb5f00: ff ff ff ff f8 ff ff ff 00 00 00 00 00 00 00 00 [................]
    [snip 16304 bytes]
GPSDateTime = 2022:07:12 21:39:59Z
GPSLatitude = 47.6302001953125
GPSLongitude = -117.543522135417
GPSSpeed = 0.851920015454292
GPSTrack = 270.390014648438
Type='gps ', Sample 58 of 300 (16384 bytes)
 5183eec: 00 00 40 00 66 72 65 65 47 50 53 20 f0 03 00 00 [..@.freeGPS ....]
 5183efc: 0e 00 00 00 27 00 00 00 3b 00 00 00 e6 07 00 00 [....'...;.......]
 5183f0c: 07 00 00 00 0c 00 00 00 41 4e 57 00 7f 0e 94 45 [........ANW....E]
 5183f1c: 73 52 37 46 3d 0a 17 3f 71 fd 76 43 fd ff ff ff [sR7F=..?q.vC....]
 5183f2c: fd ff ff ff 02 00 00 00 00 00 00 00 00 00 00 00 [................]
    [snip 16304 bytes]
GPSDateTime = 4022:07:12 14:39:59Z
GPSLatitude = 47.6302001953125
GPSLongitude = -117.543538411458
GPSSpeed = 1.09267995142937
GPSTrack = 246.990005493164

For points 1 and 2 the year (stored at offset 0x1c in the hex dump) is number of years since 2000 (ie. 22, or 0x00000016 hex) and the time is UTC (hours stored at offset 0x10 is 21 or 0x00000015).  For point 3, the year is absolute (ie. 2022, or 0x000007e6 hex) and the time is local (hour is 14 or 0x0000000e).

Very odd.  Other software never ceases to find new ways to make life difficult for me.

I will patch ExifTool 12.50 to look for an absolute year (ie. > 2000) then not add 2000 and assume local time.  Of course, this will only work if you run ExifTool on a system where the local time is in the same time zone as the dashcam.  I'll also issue a minor warning if this happens: "Converting GPSDateTime to UTC based on local time zone".

- 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

As a bonus, ExifTool 12.50 will also decode Accelerometer data from this file:

Screen Shot 2022-10-27 at 11.44.05 AM.png
 
- 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 ($).

oldHacker

Great sleuthing! 
Keep in mind the dashcam was still acquiring the Satellite signal when the first points were recorded. Points 1 and 2 are NOT accurate geographically, about a mile off. They are invalid points anyway.  All valid points list the year as 4022 so all valid points must be using absolute year.

If not running in the same time zone as the dashcam can the output be time shifted via an ExifTool option in the cmd line? I think i've seen some notes in the Forum or in your documentation regarding this capability.
Thanks for the bonus Accelerometer data!

oldHacker

" Very odd.  Other software never ceases to find new ways to make life difficult for me."

what a can o worms...
I purchased this Kenwood DRV-A301W only because their DRV-320 records separate "xx.NMEA" files containing all the GPS and Accl data. The "xx.NMEA" files import seamlessly into the map/routing software i use.  But! no such capability on the new/improved DRV-A301W,  and absolutely NO help from Kenwood. I've spent man-weeks trying to get the same data from the newer device.

Phil Harvey

Quote from: oldHacker on October 27, 2022, 12:40:53 PMKeep in mind the dashcam was still acquiring the Satellite signal when the first points were recorded. Points 1 and 2 are NOT accurate geographically, about a mile off. They are invalid points anyway.

You should report this to Kenwood.  These bad points still have an "A" (measurement Active) status (as you can see from byte 0x28 in the hex dumps), but it should be "V" (measurement Void) for invalid points.

If they did this then the bad points wouldn't appear in the ExifTool output.

Quote from: oldHacker on October 27, 2022, 12:40:53 PMIf not running in the same time zone as the dashcam can the output be time shifted via an ExifTool option in the cmd line?

There is an exiftool -API TimeZone option for this, but read the notes because you may need to do something else in Windows.

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

oldHacker

12.50 Works great,  thank you very much! 
Finally downloaded v12.50.  Created over 2000 gpx files in various folders using this cmd.
exiftool -ee3 -p gpx.fmt -ext mp4 DIR -w .gpx

All Years/Dates are as expected.
Thanks again for your excellent tool.