Inverse Geotagging .mp4 files gives "Warning: Truncated" message

Started by PerKj, April 01, 2024, 03:32:02 AM

Previous topic - Next topic

PerKj

Hi,

I have a dashcam type system on my motorcycle. It is called Chigee AIO-5 and records .mp4 files from a front and rear cam.

I wanted to extract my tracks from an awesome off-road adventure and use the following command:

C:\_Junk>exiftool -p gpx.fmt -ee3 REC20240331-124910-F0-890.mp4 > output.gpx
Warning: Truncated 'T\xa4i\x9f' data - REC20240331-124910-F0-890.mp4

C:\_Junk>exiftool -p gpx.fmt -ee REC20240331-124910-F0-890.mp4 > output.gpx
Warning: Truncated 'T\xa4i\x9f' data - REC20240331-124910-F0-890.mp4


The video file plays just fine and I have tried it with several of the recorded videos. The Chigee system records video as long as it is switched on but splits them into 2 minute files.

This is the output:
<?xml version="1.0" encoding="utf-8"?>
<gpx version="1.0"
 creator="ExifTool 12.81"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns="http://www.topografix.com/GPX/1/0"
 xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd">
<trk>
<number>1</number>
<trkseg>
</trkseg>
</trk>
</gpx>

I used the gpx.fmt file described on the exiftool.org site

Any suggestions greatly appreciated.

StarGeek

Are you using the most current version of exiftool (12.81)
exiftool -ver

If so, can you provide a short, unedited, sample file?

It could be that the "Truncated" warning is the problem, or it could be that it is yet another unknown GPS format.  Exiftool currently reads 72 different formats of embedded GPS tracks, and there are more that have yet to be decoded.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

PerKj

Hi StarGeek,

Thanks for your reply.
The version is 12.81

Here is a link to a 2 minute sample video file:
Sample file

Thanks.

StarGeek

Phil will have to take a deeper look, but one problem I noticed right away is that the sample doesn't record the date/time.
C:\>exiftool -time:all --system:all -G1 -a -s Y:\!temp\x\y\z\REC20240331-124910-F0-890.mp4
[QuickTime]     CreateDate                      : 0000:00:00 00:00:00
[QuickTime]     ModifyDate                      : 0000:00:00 00:00:00
[Track1]        TrackCreateDate                 : 0000:00:00 00:00:00
[Track1]        TrackModifyDate                 : 0000:00:00 00:00:00
[Track1]        MediaCreateDate                 : 0000:00:00 00:00:00
[Track1]        MediaModifyDate                 : 0000:00:00 00:00:00
[Track2]        TrackCreateDate                 : 0000:00:00 00:00:00
[Track2]        TrackModifyDate                 : 0000:00:00 00:00:00
[Track2]        MediaCreateDate                 : 0000:00:00 00:00:00
[Track2]        MediaModifyDate                 : 0000:00:00 00:00:00
[Track3]        TrackCreateDate                 : 0000:00:00 00:00:00
[Track3]        TrackModifyDate                 : 0000:00:00 00:00:00
[Track3]        MediaCreateDate                 : 0000:00:00 00:00:00
[Track3]        MediaModifyDate                 : 0000:00:00 00:00:00

While the GPS data is overlaid on the video, there is the possibility that it wasn't embedded.  That's something that has popped up here before, but not for a while now.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

PerKj

Quote from: StarGeek on April 01, 2024, 04:27:25 PMWhile the GPS data is overlaid on the video, there is the possibility that it wasn't embedded.  That's something that has popped up here before, but not for a while now.

I will have a look at the SD card from the dash cam and see if there are any separate files that might include the GPS data.

wywh

Quote from: PerKj on April 01, 2024, 03:32:02 AMsplits them into 2 minute files

Do all clips (i.e. the 1st clip, clips in between and the last clip) have the same problem? (Encoder:Lavf58.20.100 hints to ffmpeg -- maybe the writing app too crudely splits the movie to such short clips). Just re-wrapping as .mp4 with 'ffmpeg -i input.mp4 -c copy output.mp4' fixes that.

PerKj

Quote from: wywh on April 02, 2024, 01:39:25 PMDo all clips (i.e. the 1st clip, clips in between and the last clip) have the same problem? (Encoder:Lavf58.20.100 hints to ffmpeg -- maybe the writing app too crudely splits the movie to such short clips).

Same problem with first and last files. The split theory does make sense though.

Quote from: wywh on April 02, 2024, 01:39:25 PMJust re-wrapping as .mp4 with 'ffmpeg -i input.mp4 -c copy output.mp4' fixes that.

I downloaded the latest ffmpeg from github and ran the command:
ffmpeg -i input.mp4 -c copy output.mp4

I got this error:
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001b0fc04ffc0] All samples in data stream index:id [2:3] have zero duration, stream set to be discarded by default. Override using AVStream->discard or -discard for ffmpeg command.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'rec871.mp4':
  Metadata:
    major_brand    : isom
    minor_version  : 512
    compatible_brands: isomiso2mp41
    encoder        : Lavf58.20.100
  Duration: 00:02:00.06, start: 0.000000, bitrate: 13973 kb/s
  Stream #0:0[0x1](und): Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv), 1920x1080, 11993 kb/s, 29.99 fps, 30 tbr, 90k tbn (default)
      Metadata:
        handler_name    : SStar Video
        vendor_id      :
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 16000 Hz, mono, fltp, 34 kb/s (default)
      Metadata:
        handler_name    : SStar Audio
        vendor_id      :
  Stream #0:2[0x3](und): Data: none (ssmd / 0x646D7373)
      Metadata:
        handler_name    : SStarMeta


StarGeek

Fixing a file with ffmpeg in this manner will likely remove any GPS data that may actually be in the file.

Of course it depends upon what is in that 3rd track. That might be where GPS data is held
  Stream #0:2[0x3](und): Data: none (ssmd / 0x646D7373)
    Metadata:
      handler_name    : SStarMeta
Unsupported codec with id 0 for input stream 2

That track is stripped away with the above ffmpeg command
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

PerKj

Chigee is a very young company and I think I will send them some of the information from here and see if they can help out with the process.  :)

Phil Harvey

Track3 contains a preview image that ExifTool 12.82 will extract.

There are a number of 'free' boxes, mostly containing un-useful information, but there is one that looks something like compressed data.  I threw it at Compress::Zlib::Inflate just for fun, but it came back with an error.

The bottom line is that I don't think I'll be able to extract GPS from the metadata of this file.  I have heard of OCR utilities that can extract text overlays from the video image, but I don't have any details about these.

The "truncated" problem is becoming more common.  You will see that warning if there is non-QuickTime-format trailer added to the file.  I think I should probably change the warning to make this more clear.

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

PerKj

Quote from: Phil Harvey on April 05, 2024, 10:38:50 AMThe bottom line is that I don't think I'll be able to extract GPS from the metadata of this file.  I have heard of OCR utilities that can extract text overlays from the video image, but I don't have any details about these.

I got a reply from Chigee support yesterday which confirms your findings:

"We regret to inform you that our logs are stored in separate files, and currently, we do not have the option to save logs using MP4 files.  We sincerely apologize for any inconvenience this may cause."


StarGeek

Did they tell you where the logs are located?  It might be possible to create a track from them.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

PerKj

Quote from: StarGeek on April 07, 2024, 02:12:54 PMDid they tell you where the logs are located?  It might be possible to create a track from them.

No they didn't. I am away travelling now, but when I get back home in a few days time I will have a look on the memory card to see if I can locate them.