juanmcasillas / gopro2gpx

Parse the gpmd stream for GOPRO moov track (MP4) and extract the GPS info into a GPX (and kml) file.
GNU General Public License v3.0
181 stars 50 forks source link

Use first GPSU record to determine GPX start time #31

Closed stakita closed 1 year ago

stakita commented 1 year ago

Currently the start time in the GPX output is determined by the first GPS record after GPSFIX is obtained. However, if it takes time to obtain GPS lock, the first record may be offset by many seconds compared to the start time of the raw video stream. This means that the time offset between the <metadata><time> field won't be the same time offset between the beginning of the originating video stream and the point in time in the video.

This change obtains the start time from the first GPSU (GPSDateTime record) and populates the <metadata><time> so that time offset to the GPS records matches the time offset in the video stream.