Inverse geotagging from Akaso V1 (2019 version) dashcam footage

Started by Mickey1962, June 14, 2020, 03:53:47 AM

Previous topic - Next topic

Vasyoid

Hi Phil,

I've sent you one sample video. Please make sure you can download it.

- Vasily

Mickey1962

Hi Phil, here are "steady" samples:

Lat. 50.734303 - Long. 4.505689
https://rabozee.net/dashcamGPS/2021_0818_175823_002.MOV
https://rabozee.net/dashcamGPS/2021_0818_180123_003.MOV

Hope this helps :-)
-- Michel

Phil Harvey

Michel,

You need to have the vehicle running to get the video?  That's interesting.

Anyway, do what you can but don't go to too much trouble.  I'm playing with bit patterns here and am not much closer to figuring out the encryption, so even with these videos I may be stumped.  I'm downloading the new files now.

- 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

Vasily,

I downloaded the video you sent OK.  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 ($).

Mickey1962

Quote from: Phil Harvey on August 18, 2021, 12:43:52 PM
Michel,

You need to have the vehicle running to get the video?  That's interesting.

Anyway, do what you can but don't go to too much trouble.  I'm playing with bit patterns here and am not much closer to figuring out the encryption, so even with these videos I may be stumped.  I'm downloading the new files now.

- Phil

I need to have the engine running or at least the vehicle powered up otherwise the dash cam shuts down after 30 seconds (it is how it is wired). I currently cannot have the power on the vehicle without having it running because I do not drive a lot at the moment and the battery is not much charged (bloody modern cars ;-) ) :-)

Anyway, I put above the requested files, I copy again the urls here, will be easier:

Lat. 50.734303 - Long. 4.505689
https://rabozee.net/dashcamGPS/2021_0818_175823_002.MOV
https://rabozee.net/dashcamGPS/2021_0818_180123_003.MOV

Hope this helps :-)
-- Michel

Phil Harvey

Hi Michel,

OK.  I have averaged the encrypted latitude values based on the timestamp seconds, and the longitude values based on the timestamp minutes, then subtracted this from the known GPS coordinates you provided for the 2 long stationary videos.  The result gives me the lookup tables below which could potentially be used to decode coordinates from other videos.  The first column assumes the lat/lon are stored in decimal degrees (probably unlikely), and the second column assumes DDMM.MMMM format (I think this is more likely, particularly since the constants are smaller for this case).  But there a few problems with this:

1. We don't have all of the possible minutes values sampled, so the longitude table is incomplete.

2. The encryption may involve more than just minutes and seconds.

3. I don't know if the correction should be done by bitwise operations, or by adding a floating-point offset.  (Currently I'm thinking bitwise.)

4. Since I haven't been able to find a general algorithm that applies to all seconds/minutes, the decryption is based on empirical values averaged from your videos, so the lat/lon values won't be exact.  (Although we could theoretically improve this in time, provided we are doing things correctly.)

If I can generate a complete lookup table (ie. fill in the missing minutes from point 1), then I can test points 2 and 3 with the moving videos to see if I can get the decoding working (but we may get stumped here if more than minutes and seconds are used in the encryption).  If this works, then we can address point 4 to tweak the constants to improve the accuracy.

If this seems like a lot of work, it is.  Sorry, but the first step will be to obtain stationary videos for a complete hour so we can determine the constants for all minutes.

--- latitude
00 sec 0x6764fa91bdad7500 0x85241d51ac560b00
01 sec 0xd0f0e86c68827f00 0xeeb00b2c572b1500
02 sec 0xb43fe498d37d8800 0xd1ff0758c2261e00
03 sec 0xc3b399430a678e00 0xe172bc03f9102400
04 sec 0x6c8fdd7068827f00 0x8a4f0030572b1500
05 sec 0xfa939fd2edbc7100 0x1852c292dc650700
06 sec 0x5d6e2fd4edbc7100 0x7b2d5294dc650700
07 sec 0xbd3e897768827f00 0xdafdac37572b1500
08 sec 0x1a95adf35bce9500 0x3854d0b34a772b00
09 sec 0xa9ac148054f48b00 0xc76b3740439d2100
10 sec 0xf262f5b298917b00 0x10221872873a1100
11 sec 0xd13eeb1af3d59300 0xeefe0ddae27e2900
12 sec 0xfe0babf693a47700 0x1bcaceb6824d0d00
13 sec 0x9785764e37738300 0xb544990e261c1900
14 sec 0xcfac2660f0e88e00 0xed6b4920df912400
15 sec 0x1f0f7c779c7e8000 0x3cce9f378b271600
16 sec 0xfd7f4426d3678600 0x1b3e66e6c2101c00
17 sec 0x4cfe277f9c7e8000 0x6abd4a3f8b271600
18 sec 0xaddab7809c7e8000 0xcb99da408b271600
19 sec 0x694d065a37738300 0x870c291a261c1900
20 sec 0xaf678a26e2b49700 0xcd26ace6d15d2d00
21 sec 0xc8281a5a03778200 0xe5e73d1af2201800
22 sec 0xf5d3150185c46f00 0x139237c1746d0500
23 sec 0xa68376dff3e09c00 0xc442999fe2893200
24 sec 0xb268ce65d76a8d00 0xd027f125c6132300
25 sec 0x43183e8d34867e00 0x60d7614d232f1400
26 sec 0x0175030527d29400 0x1f3425c5167b2a00
27 sec 0x1784de7368827f00 0x35440133572b1500
28 sec 0xa98a3e1fa65b9100 0xc74960df95042700
29 sec 0x0b2b018900897d00 0x28ea2449ef321300
30 sec 0x32c2dac3011f9c00 0x5081fd83efc83200
31 sec 0xe63a21df85c46f00 0x03f9449f746d0500
32 sec 0xc20bca47d66a8d00 0xdfcaed07c5132300
33 sec 0xe4d463db8be89a00 0x0293869b7a913000
34 sec 0x8db5d1febfd99200 0xab74f4beae822800
35 sec 0xffc79e3dcf7a8100 0x1d86c0fdbe231700
36 sec 0x8f334cd88be89a00 0xacf26f987a913000
37 sec 0x37a27ad685c46f00 0x55619d96746d0500
38 sec 0x268c656534867e00 0x444b8825232f1400
39 sec 0xdba93b3cd66a8d00 0xf9685dfcc5132300
40 sec 0xcb3258dc726a9900 0xe8f17b9c61132f00
41 sec 0xa4efddf9bfd99200 0xc2af00b9ae822800
42 sec 0x739514459b7e8000 0x915437058a271600
43 sec 0xddec7f2803778200 0xfbaba1e8f2201800
44 sec 0x4d530438cf7a8100 0x6b1226f8be231700
45 sec 0x7b5729959f818700 0x99164c558e2a1d00
46 sec 0x194f037100897d00 0x370e2631ef321300
47 sec 0x77b0d839d66a8d00 0x956ffaf9c5132300
48 sec 0x8a263cf90a729700 0xa7e55fb9f91b2d00
49 sec 0xf3c231b6011f9c00 0x11815476efc83200
50 sec 0x52886c7800897d00 0x70478f38ef321300
51 sec 0x465ec2f9da579200 0x641de5b9c9002800
52 sec 0x25ab21dc8be89a00 0x436a449c7a913000
53 sec 0x466c9ca555b57300 0x642bbf65445e0900
54 sec 0xf6b1170aeff39700 0x147039cade9c2d00
55 sec 0x737cb43803778200 0x913bd6f8f2201800
56 sec 0xc32e1f49cf7a8100 0xe0ed4209be231700
57 sec 0x732cdbdf5bce9500 0x90ebfe9f4a772b00
58 sec 0x7eeb8b198bdd9100 0x9caaadd97a862700
59 sec 0xf79fa3d3bfe49b00 0x155ec693ae8d3100
--- longitude
00 min 0x130b7c45afae7500 0xae46e17b0bce0d00
01 min 0x921f86564b8e8000 0x2d5aeb8ca7ae1800
02 min 0xee85a90ccdf38700 0x89c10e422a131f00
03 min 0xe7b513ca48008f00 0x82f07900a4202700
04 min 0x3f2c6cc9418e8000 0xda67d1ff9dae1800
58 min 0x100a4120a4ae9000 0xab45a65600ce2800
59 min 0x58ba6c10a36e9a00 0xf3f5d146ff8e3200


- Phil

P.S. We got a couple of rainy days in a row, which is why I have time to play with this now.  And the forecast is for rain again tomorrow.
...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 ($).

Mickey1962

Wow ! Great .

Tomorrow morning (European time), I will record like 1:15 hour of steady videos then (25 files). I found a spot where I am quiet to do that (near the one from the 2 videos this afternoon). Then I will upload them. Is this timing OK for you ? (now it is 21:00 here hence run the engine for one hour is not a good idea, I am in a quite silent external environment.

Thank you !
-- Michel

Phil Harvey

Hi Michel,

That would be great, thanks.  Try to give me as accurate a GPS position as possible for where you take the videos.  Also, it would be best if you have a clear view of the whole sky (no large objects around) to make the GPS as stable as possible.

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

Mickey1962

No problem, the area is wide in the open, I will wait for GPS stabilisation and provide the lat/long as the Akaso Player gives.
-- Michel

Mickey1962

Hello Phil, I just sent you an email with the details of the location of the files - just to avoid anyone to download those large files -.

Lat. 50.734150-50.734190 - Long. 4.505630 - 4.505670 (variations due to satellites, the dash cam was firmly fixed on a pole at 25 cm from the ground)

PS: I do not know why I did not think about that yesterday (the sad weather here as well maybe...) but it was way easier to unmount the dash cam from the vehicule, power it with a USB adapter, and put it in the alley near my house... no vehicule involved :-) How stupid I am.

Thank you !
-- Michel

Phil Harvey

I've spent a couple of hours working with the new files so far.

When I apply the decryption offsets calculated from the stationary videos, the residual error is about 20-30x larger than expected using both bitwise xor and floating point subtraction when I assume the floating point is stored in DDMM.MMMM format.  The residual would be 100x larger if I assumed DD.DDDDD format, so this isn't it.   So I tried using larger scaling factors to reduce the residual to expected range.  After this I got good results for the stationary video, but GPS from a moving video was garbage.  So I don't think I'm on the right track here.  A complication is that the encryption can be applied to either the binary or the floating point values, and the floating point could be scaled by an arbitrary amount, and with some unknown encoding.  The combination of all of these factors leads to a large number of possibilities.  I've explored about 6 of them so far, without success.

I'll move on to analyzing the moving videos to see if I can find any patterns that would give hints as to the strategy used.

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

Mickey1962

It is really strange they added so much complexity to that thing. Also because so many computations are not easy on such a small device (I mean, the footprint of the internal memory and the velocity of the processor should not be so big).
-- Michel

Phil Harvey

Hi Michel,

I've bashed my head against this for another couple of hours, but no luck.

ExifTool 12.31 (not yet released) will extract GPSDateTime, GPSSpeed and GPSTrack from these files, and un-decrypted GPSLatitude and GPSLongitude.  Maybe someone will be able to figure out how to decrypt this.  I'm attaching the output of the following command for ExifTool 12.31 run on the stationary files at 50.734170,4.505650, and for the moving files from your trip.  These attachments show the stored values of lat/lon before decryption, interpreted as double-precision floating-point numbers.

exiftool -p "$main:filename $gpsdatetime $gpslatitude# $gpslongitude# $gpsspeed $gpstrack" -ee FILES > OUT.txt

I don't have the time to go any further with this right now.

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

Mickey1962

OK, Phil, thank you for all the time you spent on this.

I guess it is a lost cause :-( BTW I downloaded the 2 result files you attached, just in case I come to some brilliant idea (I doubt it, but who knows), maybe it could be interesting to have the encrypted lat/lon in hexadecimal format ?
-- Michel

Phil Harvey

Hi Michel,

Getting an output which includes hexadecimal would be a bit of work for me.  But if anyone is doing some serious work with this, converting from double back to hex should be easy.  However, let me know if you really need this and I can do the work to add the hex.

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