Change output directory after GPS update

Started by b193709, April 26, 2022, 06:39:49 PM

Previous topic - Next topic

b193709

Hi all:

I'm trying to, on a source folder on which I'll have many different kind of photo formats and some videos, apply Geo info coming from CSV file. Main issue is that after update some (not all of them), it writes on the same directory, the modified photo + .original file, mixing the updated with the no updated photos.

I'm looking for specify the output folder for the updated photos. I tried many formats for the option -o, but none works.

Any help?

Thanks

Phil Harvey

try this:

exiftool -o output_directory/ ...

Note that this will copy the files if any metadata is changed and leave the originals in the source folder unless the -overwrite_original option is used.

Quote from: b193709 on April 26, 2022, 06:39:49 PM
after update some (not all of them), it writes on the same directory, the modified photo + .original file

Unless you are setting the new directory from the values of other tags or using the -overwrite_original option, then all files which are rewritten will generate a _original file in the same folder.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

b193709

Hola Phill:

Well.. didn't work. That's one of the things I tried. It takes ./DIR as a filename, and then it owerwrites the output.

...   :-X

Phil Harvey

You used the wrong command then, but I can't help because you haven't shown me the command you used.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

b193709

Oh.. yes.. you're right.. sorry for that:

Here you have my commands:

Bobs-iMac:+0000 bob$ exiftool -geotag /Volumes/DISC_A/GPX.GPX  '-geotime<${DateTimeOriginal}+00:00' /Volumes/DISC_A/oo/temp/+0000/* -api GeoMaxIntSecs=300  -o ./converted

Bobs-iMac:+0000 bob$ exiftool -geotag /Volumes/DISC_A/GPX.GPX  '-geotime<${DateTimeOriginal}+00:00' /Volumes/DISC_A/oo/temp/+0000/* -api GeoMaxIntSecs=300  -o converted

Bobs-iMac:+0000 bob$ exiftool -geotag /Volumes/DISC_A/GPX.GPX  '-geotime<${DateTimeOriginal}+00:00' /Volumes/DISC_A/oo/temp/+0000/* -api GeoMaxIntSecs=300  converted


Bobs-iMac:+0000 bob$ exiftool  -o ./converted  -geotag /Volumes/DISC_A/GPX.GPX  '-geotime<${DateTimeOriginal}+00:00' /Volumes/DISC_A/oo/temp/+0000/* -api GeoMaxIntSecs=300


None of them works.

Thanks

StarGeek

From the docs on the -o (-out) option
     The output file is taken to be a directory name if it already exists as a directory or if the name ends with '/'.

Add a slash to the end so exiftool knows you want to make a directory and not the name of a file, i.e. -o ./converted/
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

b193709

#6
Right.. thanks a lot.

this works..

exiftool  -o ./converted/  -geotag /Volumes/DISC_A/GPX.GPX  '-geotime<${DateTimeOriginal}+00:00' /Volumes/DISC_A/oo/temp/+0000/* -api GeoMaxIntSecs=300

But.. there is behavior that I don't expect:

on the source folder ( /Volumes/DISC_A/oo/temp/+0000/ ) I have all original files (15) and on ./converted/  I have also 15 files, but only 12 of them has been changed. I saw that exif copies the other 3 with same name untouched.

I was expecting be able to know how many of them has been converted without parsing the response.

I was reading the documentation about. The option -overwrite_original will delete the original file, but will leave originals on source dir.

The goal is: leave original files on the source dir ( /Volumes/DISC_A/oo/temp/+0000/  ) and only produce a modified file on dest dir (./converted/ ) in case exif modifies something,

Any other option I need to enable for just add modified files into ./converted/ , and if there were no modification, just don't do anything?

Thanks

StarGeek

Add the -v2 option to the command to see what is actually happening.  I suspect that data is still written to the "unchanged" files, it's just the same data that is already there.

You might try adding the -wm (-writeMode) option, specifically -wm cg which will not overwrite already existing tags, only create new ones.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

b193709

With tracking option -v2 this is what I can see:

exiftool -o ./convert/ -v2 -geotag /Volumes/RAM\ Disk/GPX.GPX  '-geotime<${DateTimeOriginal}+00:00' /Volumes/RAM\ Disk/+0000/*           -api GeoMaxIntSecs=300
Loaded 724161 points from XML-format GPS track log file '/Volumes/RAM Disk/GPX.GPX'
  GPS track start: 2018:08:19 16:02:27.699 UTC
  GPS track end:   2022:04:20 21:55:01.669 UTC
Writing File:Geotag
======== /Volumes/RAM Disk/+0000/00000-1.MP4
Setting new values from /Volumes/RAM Disk/+0000/00000-1.MP4
Warning: [minor] Tag 'DateTimeOriginal' not defined - /Volumes/RAM Disk/+0000/00000-1.MP4
Warning: No writable tags set from /Volumes/RAM Disk/+0000/00000-1.MP4
'/Volumes/RAM Disk/+0000/00000-1.MP4' --> './convert/00000-1.MP4'
Created directory ./convert
Rewriting /Volumes/RAM Disk/+0000/00000-1.MP4...
Nothing changed in /Volumes/RAM Disk/+0000/00000-1.MP4
======== /Volumes/RAM Disk/+0000/DSC00153.ARW
Setting new values from /Volumes/RAM Disk/+0000/DSC00153.ARW
  Geotime value:   2020:10:27 06:17:44.000 UTC
Warning: No writable tags set from /Volumes/RAM Disk/+0000/DSC00153.ARW
'/Volumes/RAM Disk/+0000/DSC00153.ARW' --> './convert/DSC00153.ARW'
Rewriting /Volumes/RAM Disk/+0000/DSC00153.ARW...
Nothing changed in /Volumes/RAM Disk/+0000/DSC00153.ARW
======== /Volumes/RAM Disk/+0000/DSC00278.ARW


So.. it's basically copying the file even if it did not change anything (just rewrite?) some of the info.

If I add -wm wc option same behavior... it copies all files.. either if it added GPS info or not.


Phil Harvey

Add this to the command to avoid coping files without DateTimeOriginal:

-if '$datetimeoriginal'

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

b193709

Thanks a lot.

I'll add it. The idea is being able to apply GPS info. If there is no DateTimeOriginal, should be another Tag (Creation Time?) valid for the GPS info update.

I can also look for the .original files and move the files that has an .original copy. It's longer, but it's also valid.

Is there any tag that takes all creation time tags equivalent in one shot'?

Thanks for all your support

Phil Harvey

I can't say what date/time tags are valid for your files, but CreateDate is a good bet.  Often I use a fallback of FileModifyDate which always exists but generally isn't very reliable.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

b193709