Shifting all date/time tags simultaneously

Started by mklein, January 12, 2019, 11:37:49 AM

Previous topic - Next topic

mklein

Hello

I am using ExifTool for a while now and it works great. Now I like to optimize the following call to adjust my Sony RAW files, which is used in a BATCH file:

exiftool -globalTimeShift "%time%" "-FileCreateDate<DateTimeOriginal" "-FileModifyDate<DateTimeOriginal" "-AllDates<DateTimeOriginal" "-IFD0:ModifyDate<DateTimeOriginal" "-IFD1:ModifyDate<DateTimeOriginal" "-SonyDateTime<DateTimeOriginal" "-SonyDateTime2<DateTimeOriginal" -overwrite_original %folder% -m -r

I would like to set the following tags simultaneously as easy as possible (I got them using: exiftool -time:all -a -G0:1 -s <filename>.ARW):

[File:System]   FileModifyDate
[File:System]   FileAccessDate
[File:System]   FileCreateDate
[EXIF:IFD0]     ModifyDate
[EXIF:ExifIFD]  DateTimeOriginal
[EXIF:ExifIFD]  CreateDate
[MakerNotes:Sony] SonyDateTime
[MakerNotes:Sony] SonyDateTime2
[EXIF:IFD1]     ModifyDate

Is there a way to simplify my above call, e.g. by replacing tags with groups of tags?
Can I adjust all of the above tags with one simply tag?

Thanks,
Michael

Phil Harvey

Hi Michael,

You can write all existing writable date/time tags with "-time:all<datetimeoriginal" -wm w

The -wm w is important because otherwise you will create all sorts of other date/time tags.

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

mklein

Thanks, Phil.

I tried: exiftool -globalTimeShift "%time%" "-time:all<DateTimeOriginal" -wm w -overwrite_original %folder% -m -r

But this only updates the DateTimeOriginal field, not the other ones. Am I missing something?

Michael

Phil Harvey

Oh, right.  My command also won't modify the tags that are marked as "unsafe", like the system date/time tags.  So the system ones will have to be written separately.  Also, IFD1:ModifyDate will have to be written separately because ExifTool writes this by default in IFD0.  I think the others should get written though.

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

mklein

Hi Phil,

Thanks again.

I just thought to use an arguments file.

Can you tell me how the exiftool call and the arguments file would like like?

e.g. exiftool -@ convert.args

And convert.args
...
...
...

Thanks,
Michael

Phil Harvey

The command:

exiftool -globalTimeShift "%time%" -@ my.args -r DIR

and my.args:


-time:all<DateTimeOriginal
-FileCreateDate<DateTimeOriginal
-FileModifyDate<DateTimeOriginal
-IFD1:ModifyDate<DateTimeOriginal
-wm
w
-overwrite_original
-m
...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 ($).

mklein


deepaksinbox

Hello,

The scripts given here work well, but for some reason my AVI files did not get updated - any pointers to what I am missing ? (see bold text - was expecting FileCreateDate to be updated with DateTimeOriginal)

======== D:/Temp/Dup Pics/Folder 1 with Spaces/MVI_7253.AVI
[File:System]   FileModifyDate                  : 2011:12:13 14:29:00+08:00
[File:System]   FileAccessDate                  : 2021:07:24 19:42:04+08:00
[File:System]   FileCreateDate                  : 2021:07:24 19:39:49+08:00
[RIFF]          DateTimeOriginal                : 2011:12:13 14:29:01

Regards

StarGeek

See FAQ #16
   By default, ExifTool only processes writable file types...

AVI files are not writable by exiftool, so they are skipped by default when writing data.  See the -ext (-extension) option to add them to the process.
* 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).