The format of the GPS data in the .mov video of LS460W/LS580W

jetsun

New Member
Joined
Sep 28, 2016
Messages
10
Reaction score
1
Country
China
Failed to use RegistratorViewer to export the GPS track data from my LS580W.
I decide to develop a utility to export the GPS data.

The GPS data in the file has starts with hex 00 00 80 00 and ASCII string "freegps".
00 00 80 00 66 72 65 65 47 50 53

After several hours study of the GPS data in the video file.
I find the time and GPS latitude, longitude by compare the hex in the file
and the time,GPS information OSD on the video.

2016/9/17 09:23:10 0kM/H N38'41'48.37 E116'52'12.53
corresponding to
24 53 00 00 0F D6 07E0 0911 01 17 006E 02 17 10 A8 45 45 A8 F8 2E 10
Year M D HHMM ms Latitude Longitude

07E0 0911 0117 006E is the date and time(UTC)
17 10 A8 45-> 386967621 ->38.696769
45 A8 F8 2E->1168701486->116.870147

The only thing I still unknown is which byte is the speed.
I got the speed from the video and try to find the relationship.
Maybe the 4 bytes with underline is, maybe the speed data is not in this part at all.
9:18:53 2km/h
24 53 00 51 FD 45 07 E0 09 1C 09 12 02 12 02 17 DD 09 30 45 64 CF 2B

2km/h N39'58'45.70'' E116'30'3.54 116.500983
24 53 00 14 CA BD 07 E0 09 1A 17 35 00 CC 02 17 D4 5D EB 45 70 A3 D5 10

9:4:51 33km/h
24 53 03 A1 03 40 07 E0 09 1C 09 04 01 FE 02 17 D7 70 DD 45 66 15 32 10

9:10:35 58km/h
24 53 06 62 00 6E 07 E0 09 1C 09 0A 01 5E 02 17 DB 45 DC 45 66 A2 FC 10
24 53 06 62 00 6E 07 E0 09 1C 09 0A 01 5F 02 17 DB 45 DC 45 66 A2 FC 10
24 53 06 74 00 84 07 E0 09 1C 09 0A 01 60 02 17 DB 47 0A 45 66 A3 06 10

format.gif
 
...
The only thing I still unknown is which byte is the speed.
I got the speed from the video and try to find the relationship.
Maybe the 4 bytes with underline is, maybe the speed data is not in this part at all....
It may be that speed is not in the data at all but rather is calculated for display as a function of time and distance.
 
speed from the GPS is in knots and is converted to MPH or KMH by the camera for display purposes only so if you're looking for the matching values as what is displayed maybe this is why you can't find them
 
There is tool "avchd2srt" available with C source. I believe you can find your answer there.

Code:
          for(i = 0; i < num_tags; i++)
            {
            tag = *ptr; ptr++;

            bt0 = ptr[0]; bt1 = ptr[1]; bt2 = ptr[2]; bt3 = ptr[3];
            ptr += 4;

            // correct for the 0x000003's representing 0x0000...:

            if ((bt0==0x00) & (bt1==0x00) & (bt2==0x03)) {
               bt2 = bt3; bt3 = ptr[0]; ptr++;
            } else
            if ((bt1==0x00) & (bt2==0x00) & (bt3==0x03)) {
               bt3 = ptr[0]; ptr++;
            }

            switch(tag)
              {
              case 0x18:
                if (year==-1) { tz=bt0;
                                year  = BCD_2_INT(bt1)*100 + BCD_2_INT(bt2);
                                month = BCD_2_INT(bt3);}
                break;
              case 0x19:
                if (day==-1) { day    = BCD_2_INT(bt0); hour   = BCD_2_INT(bt1);
                               minute = BCD_2_INT(bt2); second = BCD_2_INT(bt3);}
                break;
          case 0xb1:
        latH   = bt0;
        break;
          case 0xb2:
        latD   = bt0*256 + bt1;
                break;
              case 0xb3:
                latM   = bt0*256 + bt1;
                break;
              case 0xb4:
                latS   = bt0*256 + bt1;
                break;
          case 0xb5:
        lonE   = bt0;
        break;
          case 0xb6:
        lonD   = bt0*256 + bt1;
                break;
              case 0xb7:
                lonM   = bt0*256 + bt1;
                break;
              case 0xb8:
                lonS   = bt0*256 + bt1;
                break;
              case 0xb9:
                altS   = bt0;
                break;
              case 0xba:
                altL   = bt0*256 + bt1;
                altD   = bt3;
                break;
              case 0xc1:
                speU   = bt0;
                break;
              case 0xc2:
                speed  = bt0*256 + bt1;
                speD   = bt3;
                break;
              }
            }

Also please refer to http://owl.phy.queensu.ca/~phil/exiftool/TagNames/H264.html#MDPM
 
9:4:51 33km/h
24 53 03 A1 03 40 07 E0 09 1C 09 04 01 FE 02 17 D7 70 DD 45 66 15 32 10
03 A1 is the speed in the unit of m/s
03 A1 is 33km/h

Still don't know what's the 5th and 6th bytes stand for.
Maybe it is the value of G-force sensor.
It seems not the height of GPS data.
 
Back
Top