ExifTool Forum

ExifTool => Newbies => Topic started by: Martla on February 13, 2019, 05:12:02 AM

Title: Export multiple .gpx files from multiple folders
Post by: Martla on February 13, 2019, 05:12:02 AM
Hello,

I was wondering if it is possible to export multiple .gpx files from multiple folders in one go?
I have over 100 folders with  different image sets and it is unimaginable to run the process one by one.

Thanks,
Erekle
Title: Re: Export multiple .gpx files from multiple folders
Post by: Phil Harvey on February 13, 2019, 08:27:14 AM
Hi Erekle,

ExifTool can almost do what you want with this command:

exiftool -p test.fmt -W+ %dout.gpx -r DIR

and this "test.fmt" file:

#[SECT]<?xml version="1.0" encoding="utf-8"?>
#[SECT]<gpx version="1.0"
#[SECT] creator="ExifTool $ExifToolVersion"
#[SECT] xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
#[SECT] xmlns="http://www.topografix.com/GPX/1/0"
#[SECT] xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd">
#[SECT]<trk>
#[SECT]<number>1</number>
#[SECT]<trkseg>
#[IF]  $gpslatitude $gpslongitude
#[BODY]<trkpt lat="$gpslatitude#" lon="$gpslongitude#">
#[BODY]  <ele>$gpsaltitude#</ele>
#[BODY]  <time>${gpsdatetime#;DateFmt("%Y-%m-%dT%H:%M:%SZ")}</time>
#[BODY]</trkpt>


The only problem is that the output GPX files won't be properly terminated, and you'll have to manually add these lines to each one to make a valid GPX file:

</trkseg>
</trk>
</gpx>


I haven't figured out how to do this automatically with ExifTool.

- Phil
Title: Re: Export multiple .gpx files from multiple folders
Post by: Martla on February 15, 2019, 09:20:15 AM
Thank you, Phil!
Title: Re: Export multiple .gpx files from multiple folders
Post by: Deano on December 13, 2023, 03:52:34 AM
Hi Phil,

Have just tried this and can't get it working. I'm also looking to extract GPX from .mp4 if that makes a difference... And doesn't make a difference using the test.fmt or gpx.fmt either.

Also found another option on another forum which gives the same output

exiftool -p gpx.fmt -ee -w %d%f.gpx video directory

The output i get is

    1 directories scanned
    0 image files read
    0 output files created

All mp4 files are in video directory and happy with a single file for every movie.

Any help would be super awesome. Thanks.
Title: Re: Export multiple .gpx files from multiple folders
Post by: StarGeek on December 13, 2023, 10:50:58 AM
Are the files in that directory or in subdirectories? The output of your command indicates that there are no files in the directory. If they are in subdirectories, then add -r (-recurse) option (https://exiftool.org/exiftool_pod.html#r-.--recurse).
Title: Re: Export multiple .gpx files from multiple folders
Post by: Deano on December 13, 2023, 05:46:03 PM
Hi StarGeek,

Amazing what a good sleep can do, it was the extra \ on the directory.  :-[
Title: Re: Export multiple .gpx files from multiple folders
Post by: Deano on December 17, 2023, 07:34:40 PM
Have just realised that the output from each mp4 seems to be duplicated within each gpx file? I.e each file has the same 60 seconds of data listed twice.

Link to GPX exported from one mp4 file (https://1drv.ms/u/s!Aq8suWK5oKFCh6MnU-5RUXJkPRglEQ?e=yTWHNF)

Any help would be appreciated.
Title: Re: Export multiple .gpx files from multiple folders
Post by: Phil Harvey on December 17, 2023, 09:39:44 PM
Can you provide a link to an MP4 that shows this effect?

- Phil