Export multiple .gpx files from multiple folders

Started by Martla, February 13, 2019, 05:12:02 AM

Previous topic - Next topic

Martla

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

Phil Harvey

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


Deano

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.

StarGeek

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.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Deano

Hi StarGeek,

Amazing what a good sleep can do, it was the extra \ on the directory.  :-[

Deano

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

Any help would be appreciated.

Phil Harvey

Can you provide a link to an MP4 that shows this effect?

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