How to skip 0,0 lat/lon when extracting a GPS track from MP4 file?

Started by dwvsurf, February 19, 2025, 06:37:21 PM

Previous topic - Next topic

dwvsurf

Hello

I have several .mp4 files collected with a GoPro 11.  I use exiftool to extract KML Tracks from them using the kml_track.fmt file available here: https://github.com/exiftool/exiftool/blob/master/fmt_files/kml_track.fmt
and using the following command line:
"D:\Videos\exiftool\exiftool.exe" -p kml_track.fmt -ee3 -w %d%f.kml "D:\Videos\Output Folder"

This works perfectly, expect that often the GoPro's GNSS receiver hasn't kicked in fast enough, so many of the initial positions are 0,0 lat/lon.

Is there a way to skip 0,0 positions?  Presently, I have to do this manually, by opening up each .kml file generated and manually deleting them.  Would be great to skip/ignore these values on extraction (even though, yes, I know 0,0 is a valid GPS position).

Thank you!

Phil Harvey

Edit the kml_track.fmt file and add this line anywhere in the file:

#[IF] ${gpslatitude#;$_ == 0 and $_ = undef}
This will skip the point if GPSLatitude is 0.

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