ExifTool Forum

ExifTool => Newbies => Topic started by: zead on March 27, 2020, 07:07:43 PM

Title: Organizing photos by the hour shot
Post by: zead on March 27, 2020, 07:07:43 PM
I have been taking a timelapse of one of my plants that is flowering. A photo is taken every 10 minutes and the project is approaching two months for a total of 7,034 NEF files at 173GB. The flower is beginning to close and I have now begun to consider how I will process the images in Lightroom. I am exposing with a fixed aperture and ISO, with automatic shutter speed (Aperture priority).

Normally I would sync an edit in Lightroom across all of the images in order to avoid processing the images individually, but because the lighting situation in each image is different across time this wouldn't work. I want to organize the images either by the hour of the day that they were taken or their shutter speed to group them by their lighting situation and sync an edit the groups in Lightroom to be processed and exported to Premiere to create the video. This problem has guided me here, where I have been able to install ExifTool and use it to look at the metadata of my images, but I am struggling to correctly deploy the commands I am looking for (if I am even using the correct ones).

To be specific, I am looking for a command that will move the NEF files to new folders based on the hour that they were taken, and I'd also like to try out a command that moves files that share shutter speed into respective new folders. I don't have much experience with the command prompt but I'm confident I will understand this after some guidance and time. I am using the command prompt in Win10. I apologize, as I suspect this question has been asked and answered before, but I thank y'all for your time nonetheless.
Title: Re: Organizing photos by the hour shot
Post by: StarGeek on March 27, 2020, 08:13:45 PM
To move them into directories by the hour
exiftool -d "%H" "-Directory</path/to/dir/DateTimeOriginal" /path/to/source/

Change /path/to/dir to the path to where you want the Hour directories located. Change /path/to/source/ to the path to the source images.  I'm using DateTimeOriginal for the timestamp, but you can change that to any other time based tag in the file. The -d (dateFormat) option (https://exiftool.org/exiftool_pod.html#d-FMT--dateFormat) with the %H means that only the Hour of the timestamp will be used.

Sorting by shutter speed would be a bit trickier because shutter speed usually includes a slash, which would be interpreted as another directory.  This command will sort by only the denominator of the shutter speed.  If you have another way in mind, then that can be worked out.
exiftool "-Directory<${ShutterSpeed;m/(\d+$)/;$_=$1}" /path/to/source/
Title: Re: Organizing photos by the hour shot
Post by: zead on March 28, 2020, 06:14:22 PM
I think I am moving in the right direction but I am encountering some errors in my tests on another batch of photographs.
My input is:
C:\mytools>exiftool -d "%H" "-Directory<C:/Users/tfkel/Desktop/exiftest/FileModifyDate" C:/Users/tfkel/Desktop/exiftest

Output:
Warning: No writable tags set from C:/Users/tfkel/Desktop/exiftest/3-24-2020E-1.jpg
Warning: Invalid tag name 'c:/users/tfkel/desktop/exiftest/filemodifydate' - C:/Users/tfkel/Desktop/exiftest/3-24-2020E-1.jpg


I tried all the different tags that I received from exiftool -time:all -s FILE

FileModifyDate                  : 2020:03:25 11:25:40-07:00
FileAccessDate                  : 2020:03:28 14:53:38-07:00
FileCreateDate                  : 2020:03:28 14:53:38-07:00
ModifyDate                      : 2020:03:25 11:25:40
ProfileDateTime                 : 1998:02:09 06:49:00
MetadataDate                    : 2020:03:25 11:25:40-07:00
HistoryWhen                     : 2020:03:25 11:25:40-07:00


I suspect that the issue is not with the time-based tag, but with how I'm inputting the directories, but I can't figure it out.

For what it's worth I also tried exiftool -d "%H" "-Directory<C:\Users\tfkel\Desktop\exiftest\FileModifyDate" C:\Users\tfkel\Desktop\exiftest

Title: Re: Organizing photos by the hour shot
Post by: StarGeek on March 28, 2020, 06:31:04 PM
Ooops, sorry, my mistake.  Put a dollar sign in front of the tag name

exiftool -d "%H" "-Directory<C:/Users/tfkel/Desktop/exiftest/$FileModifyDate" C:/Users/tfkel/Desktop/exiftest

The other option was to put the directory in front of the %H, which is probably what I was thinking when typing it out.  In that case, the dollar sign isn't needed because only the tag is there.  When you have other data or tags, the tags need a dollar sign.
exiftool -d "C:/Users/tfkel/Desktop/exiftest/%H" "-Directory<FileModifyDate" C:/Users/tfkel/Desktop/exiftest

Quote from: zead on March 28, 2020, 06:14:22 PM
For what it's worth I also tried exiftool -d "%H" "-Directory<C:\Users\tfkel\Desktop\exiftest\FileModifyDate" C:\Users\tfkel\Desktop\exiftest

The direction of the slashes doesn't matter.  Exiftool is written in Perl which automatically switches back slashes to slashes in path names.  Works either way on Windows.