Extract embedded GPS data from Garmin Virb Video

There is a programmatic way (with some command-line tool for example) to extract a gpx file from a video recorded with Garmin Virb?

And, after fixing/filtering this file, embed again in the original video replacing the original one?

I know a way to get the GPX via Virb Edit and that Virb Edit can build overlays based on an external GPX but, because I have to do this work for a lot of recorded videos, I'm searching a programmatic way to do this.