ExifTool Forum

ExifTool => Developers => Topic started by: rwhalb on October 04, 2022, 11:34:58 AM

Title: Dashcam Video Segments Sometimes Are Incomplete
Post by: rwhalb on October 04, 2022, 11:34:58 AM
ExifTool Version: 12.47
OS: Linux
DashCam: NextBase622GW
Video File Type: mp4
File Size: 105MB
CLI: /usr/bin/exiftool -q -j -g:3 -ee -c '%+.6f deg' -GPS* -Sample* /DATA/images/nextbase/220905_164033_010_FH.MP4

Issue: Some "Doc" segments are incomplete. Is this behavior normal and to be expected?

Piping the output to the jq utility reveals this:

A typical complete video "Doc" segment:
    "Doc53": {
      "SampleTime": "5.20 s",
      "SampleDuration": "0.10 s",
      "GPSAltitude": "88.5 m",
      "GPSDOP": 1.52,
      "GPSDateTime": "2022:09:05 20:40:40.000Z",
      "GPSLatitude": "+42.693928 deg",
      "GPSLongitude": "-73.868049 deg",
      "GPSSatellites": "06",
      "GPSSpeed": 10.0582,
      "GPSTrack": 265.57
    },

Incomplete "Doc" video segments ("Doc54" needs to be part of "Doc55"):
    "Doc54": {
      "SampleTime": "5.30 s",
      "SampleDuration": "0.10 s"
    },
    "Doc55": {
      "GPSAltitude": "88.6 m",
      "GPSDOP": 1.52,
      "GPSLatitude": "+42.693928 deg",
      "GPSLongitude": "-73.868053 deg",
      "GPSSatellites": "06",
      "GPSTimeStamp": "20:40:40.1"
    },

Notes:
1) This behavior can happen many times throughout the video.
2) The "SampleTime" and "SampleDuration" attribute "Doc" segment can occur either before or after
   the "Doc" segment with coordinate information.
3) When this occurs, I typically see a "GPSTimeStamp" attribute and not a "GPSDateTime" attribute.
4) I can upload the file to a private location if you would like or send you a google link for
   download.

---Ron Henderson
Title: Re: Dashcam Video Segments Sometimes Are Incomplete
Post by: Phil Harvey on October 04, 2022, 10:13:26 PM
Hi Ron,

Can you send me a google link so I can take a look?:  philharvey66 at gmail.com

- Phil
Title: Re: Dashcam Video Segments Sometimes Are Incomplete
Post by: rwhalb on October 05, 2022, 11:44:34 AM
Phil:

Just sent you a link to the video: 220905_164033_010_FH.MP4
using your gmail account.

---Ron Henderson
Title: Re: Dashcam Video Segments Sometimes Are Incomplete
Post by: Phil Harvey on October 06, 2022, 04:21:53 PM
I got the sample, thanks.

OK, here is the problem.  For the Doc53 sample, here is the stored NMEA GPS (lat/lon redacted for your privacy):

GPRMC,204040.000,A,XXXX.XXXXX,N,YYYYY.YYYYY,W,5.431,265.57,050922,,,A*5F
GPGGA,204040.000,XXXX.XXXXX,N,YYYYY.YYYYY,W,1,06,1.52,88.5,M,-33.5,M,,*7C

All is well and good, and the times in the RMC and GGA sentences match, so they may be combined into a single fix (the RMC contains the date, speed and direction which GGA is missing, and GGA contains satellites, DOP and altitude that RMC is missing, so we need both for a complete fix).

But for what would have been Doc54 sample, this is what is stored:

GPRMC,204040.000,A,XXXX.XXXXX,N,YYYYY.YYYYY,W,5.431,265.57,050922,,,A*5F
GPGGA,204040.100,UUUU.UUUUU,N,VVVVV.VVVVV,W,1,06,1.52,88.6,M,-33.5,M,,*77

Unfortunately the times don't match, so ExifTool can't combine them into a single fix.  What is worse, the RMC time (and lat/lon) matches the previous sample, so the logic in ExifTool to combine the NMEA sentences sort of breaks down.

If you ask me, this is a timing glitch in the dashcam software, but I have to think about the best way to deal with this situation.

- Phil
Title: Re: Dashcam Video Segments Sometimes Are Incomplete
Post by: Phil Harvey on October 06, 2022, 05:06:24 PM
I've added a patch that handles the situation as best I can.  The result is that Doc54 will have a GPSTimeStamp instead of GPSDateTime, and will be missing GPSSpeed and GPSTrack.  Then Doc55 is back to normal.

This patch will appear in ExifTool 12.48.

- Phil