It appears that not only my quick hack of a script is popular but also that the dashcam manufacturers keep changing things.
In this case the biggest change (beyond utterly stupid data obfuscation) is the switch to the TS format.
In retrospect TS format is an obvious choice for something like dashcam as it is very resilient to crashes (no pun intended).
TS format unlike the MP4/MOV format is very simple, it is pretty much made up of fixed 188 byte segments which have ASCII ‘G’ as a header. The actual payload lives in last 184 bytes while the first 4 bytes are reserved for header (of course this is all simplified).
The biggest difficulty of adding TS functionality is that Blueskysea B4K camera was engineered by sadists and they split the payload into two packets (arbitrary cutting off at the seconds 4 bytes). If you are the person at the BlueSkysea who made this obfuscation – fuck you.
In anyway this update is massive rewrite.
Just to make it easy here is the script: nvtk_mp42gpx.py
Great work, thank you!
Hi,
I tried export the gps data from mp4 (dashcam Azdome M10) by nvtk_mp42gpx.py and I got a message –
https://prnt.sc/1r4kwnu
I’m wonder because when I’m trying get coordinates by https://gist.github.com/hiskang/d12c70722a5aeca0280d1f0e28b0ac44
it’s works fine.
There is a written that it is JavaScript implementation of Sergei’s nvtk_mp42gpx.py + Google Maps.
Am I doing something wrong? Or what I can do?
Hey,
I have fixed the script. The Azdome “support” fell through the cracks after numerous updates to the script.
I have made it python2/3 agnostic as well (the thing showed its age as the Azdome bit of code was python2 specific).
It is good to see someone using the thing ;).
Regards.
Sergei.
Thank you very much for providing this. It worked with my A139 Pro flawlessly. I was interested in how accurate the GPS was in the A139 Pro and your code allowed me to determine that it is actually more accurate than my Garmin Nuvi and Garmin 60CSx.
I appreciate you breaking the proprietary chain on this as I want the raw data to do what I want to do with it rather than someone elses idea of what they think I may want to do with it. Since I’m a Linux user myself I hate having to depend on Winblows programs or Android apps to just get the job done quickly and efficiently.
Thank you for your feedback. I really appreciate it.
Hello,
I am using AZDOME M27 but I get from you script this error message
Found the ‘moov’ atom.
GPS data not found in the ‘out.gpx’!
Failure!
Do you know by any change what could be the issue ? Thanks in advance and I would really appreciate if you can help me there.
Hello,
It could be that Azdome changed the structure/signature of their GPS data thus script does not pick it up.
Typical anticompetitive obfuscation.
To figure it out I need a sample.
Hello,
i’m using azdome m550 pro and it either i used the script wrong or they change it , either way it did not work.
i did not know what are deobfuscate and del outliers and if it’s important for azdome
could you please fix the issue
Hi, most likely Azdome changed the structure yet again. I will need a sample to figure out what they done.
how can i send a sample to you?
google drive link or similar, please use the contact form: https://sergei.nz/contact/
Recently my Viofo A129 Pro Duo dashcam outputted a file with a date of “2027-00-4294967295T23:43:48Z” which crashed the script. I wanted to be able to use as much as I could from the file so I updated the script like this so it would skip bad records.
For the end of the get_gps_data(data, deobfuscate) method:
currentEpoch = convert_to_epoch(gps[‘DT’][‘DT’])
if currentEpoch == 0:
return None;
else:
gps[‘Epoch’] = currentEpoch
For the convert_to_epoch(datetime) method:
epoch = 0
try:
time_struct = time.strptime(datetime[:-1]+’UTC’, “%Y-%m-%dT%H:%M:%S%Z”)
epoch = int(time.mktime(time_struct))
except:
print(“Found bad date: ” + datetime)