ExifTool Forum

ExifTool => Newbies => Topic started by: bravodelta on September 15, 2022, 12:15:53 PM

Title: Incrementing datetimeoriginal by 1s per photo
Post by: bravodelta on September 15, 2022, 12:15:53 PM
Hello, I've successfully been able to batch change all dates for a DIR to the correct starting date, and then I ran a few attempts to increment the created date by 1 second per photo.

These are the lines that have successfully incremented each photo:
exiftool '-AllDates+<0:0:${filesequence}' -overwrite_original -r . exiftool '-datetimeoriginal+<0:0:$filesequence' . -overwrite_original -r
Unfortunately, I cannot get the exiftool to process the photos in the order I need them processed. See the output below to understand my naming convention and subsequently how exiftool is parsing the directory. (Ignore the Warning. I messed up the syntax just to get that output.)

spice@spice Tour of Italy - Summer 2006 % exiftool '-AllDates+<0:0:${Filename}' -overwrite_original -r .
Warning: No writable tags set from ./Italy '06 00142.jpg
Warning: No writable tags set from ./Italy '06 00022.jpg
Warning: No writable tags set from ./Italy '06 00036.jpg
Warning: No writable tags set from ./Italy '06 00037.jpg
Warning: No writable tags set from ./Italy '06 00023.jpg
Warning: No writable tags set from ./Italy '06 00141.jpg
Warning: No writable tags set from ./Italy '06 00009.jpg
Warning: No writable tags set from ./Italy '06 00035.jpg
Warning: No writable tags set from ./Italy '06 00021.jpg
Warning: No writable tags set from ./Italy '06 00020.jpg
Warning: No writable tags set from ./Italy '06 00034.jpg
Warning: No writable tags set from ./Italy '06 00008.jpg
Warning: No writable tags set from ./Italy '06 00140.jpg

Thanks for the help getting exiftool to start with 00001 and end with 00142.

StarGeek Edit: Edited to correct [code][/code] formatting.
Title: Re: Incrementing datetimeoriginal by 1s per photo
Post by: StarGeek on September 15, 2022, 04:26:17 PM
You need to add the -FileOrder option (https://exiftool.org/exiftool_pod.html#fileOrder-NUM---TAG).

Most of the time, the OS will pass the files to exiftool in alphabetical order but there are circumstances where it doesn't.  For example, on my Windows machine, I have Stable Bit Drive Pool running which treats multiple drives as a single drive.  The files are grouped by the drive they actually are on instead of being returned in alphabetical order.

So add -FileOrder Filename to your command.
Title: Re: Incrementing datetimeoriginal by 1s per photo
Post by: bravodelta on September 15, 2022, 04:32:34 PM
Solved!

Thank you so much — it's great that it was that simple of a solution.

For any other newbies curious with this process, my syntax is now:
exiftool '-datetimeoriginal+<0:$filesequence' DIR -FileOrder Filename -overwrite_original -r(I decided on 1 minute increments instead of 1 second as previously mentioned.)