ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: juma on January 29, 2021, 12:33:02 PM

Title: M2TS synchronization error
Post by: juma on January 29, 2021, 12:33:02 PM
I'm trying to extract the GPS info from a video I downloaded from my Motorcycle DVR, but for all videos from this camera, I'm getting the warning message "M2TS synchronization error". And this with all commands I tried.

The video has GPS info in it, because with "GPXPlayer" (http://www.sunningsoft.com/en/pcgps.html) who was delivered with the camera, I can view this info.
With "Dashcam Viewer" I can also open the video and see the GPS info if I rename the file from .TS to .MOV.

Extra info:

- I'm running Exiftool 12.16 on a Windows 10 laptop.

- Camera: GreenYi WiFi Motorcycle DVR Dash Cam 1080P+1080P Full HD Front Rear View Waterproof Motorcycle Camera GPS Logger Recorder Box (https://a.aliexpress.com/_mOcK2LR)

- Sample video: https://www.dropbox.com/sh/s7lne9casbhn56t/AAAkvlBmlKwAT0TPgX_frk9fa?dl=0  (271MB)

- Commands I tried and their output:

D:\>exiftool -a "-gps*" -ee FILE210111-173331-000017F.TS
Warning: M2TS synchronization error - FILE210111-173331-000017F.TS


D:\>exiftool -ee -G3 FILE210111-173331-000017F.TS
[Main]          ExifTool Version Number         : 12.16
[Main]          File Name                       : FILE210111-173331-000017F.TS
[Main]          Directory                       : .
[Main]          File Size                       : 272 MiB
[Main]          File Modification Date/Time     : 2021:01:11 17:36:34+01:00
[Main]          File Access Date/Time           : 2021:01:29 16:26:22+01:00
[Main]          File Creation Date/Time         : 2021:01:11 18:46:49+01:00
[Main]          File Permissions                : rw-rw-rw-
[Main]          File Type                       : M2T
[Main]          File Type Extension             : m2t
[Main]          MIME Type                       : video/mpeg
[Main]          Audio Stream Type               : MPEG-2 AAC Audio
[Main]          Image Width                     : 1920
[Main]          Image Height                    : 1080
[Main]          Warning                         : M2TS synchronization error
[Main]          Duration                        : 24.93 s
[Main]          Image Size                      : 1920x1080
[Main]          Megapixels                      : 2.1


D:\>exiftool -p gpx.fmt -ee -w ".gpx" FILE210111-173331-000017F.TS
Warning: M2TS synchronization error - FILE210111-173331-000017F.TS
    1 output files created


See attachments for the "gpx.fmt"-file used and the output file.

Any idea how to get past this error?

Thx in advance.



Title: Re: M2TS synchronization error
Post by: Phil Harvey on February 02, 2021, 03:39:38 PM
The synchronization error occurs when ExifTool runs into the binary trailer that is appended to the M2TS file.  The trailer starts with a "LIGOGPSINFO" header, and contains 183 records of 132 bytes each (I think that's one record per second, but I'm having trouble determining the clip duration).  ExifTool currently doesn't decode this trailer, but presumably it contains the information you want.

I've taken a quick look, and the byte order in the trailer is big-endian, and there are variable-length fields within each record, but I don't recognize any of the data.  Do you by any chance have any documentation for this?

- Phil
Title: Re: M2TS synchronization error
Post by: juma on February 03, 2021, 02:49:00 PM
Unfortunately not, all info I have/could find are in my 1st post.  :(
Title: Re: M2TS synchronization error
Post by: Phil Harvey on December 10, 2024, 03:18:41 PM
ExifTool 13.07 will have the ability to extract GPS from this video.

- Phil