ExifTool Forum

ExifTool => Newbies => Topic started by: Koen on September 19, 2012, 08:31:38 AM

Title: Date/Timeshift and renaming fast
Post by: Koen on September 19, 2012, 08:31:38 AM
Hi there,

While I was travelling I made a lot of pictures/video's I want to sort.

Here are some details:

The way I started to try doing this was manually sorting all files by placing it in one of 11 folders of the camera used
Then I figured how much every file needed to be shifted in YY:MM:DD hh:mm
I corrected all the dates/times of the pictures (not the video's) and moved everything to the same folder, so I could rename everything

By doing this, Windows 7 renames all files of the same type, let's say: Pictures (1).jpg, Pictures (2).jpg, Pictures (3).jpg, Pictures (1).mp4, Pictures (1).png, Pictures (4).jpg, Pictures (5).jpg, Pictures (2).mp4, Pictures (6).jpg,  Pictures (7).jpg, Pictures (8).jpg, Pictures (9).jpg, Pictures (10).jpg, Pictures (11).jpg.
Of course this isn't the right way, because if you sort by name it would be like: Pictures (1).jpg, Pictures (1).mp4, Pictures (1).png, Pictures (10).jpg, Pictures (100).jpg, Pictures (1000).jpg, Pictures (11).jpg, or something similar

Is there any easy way I can manage my pictures by using a few (simple) commands in a batch file?
Title: Re: Date/Timeshift and renaming fast
Post by: Phil Harvey on September 19, 2012, 08:57:16 AM
Yes.

This can be done with a single exiftool command:

exiftool -fileorder datetimeoriginal -filename="My Pictures %7.nc.jpg" -ext jpg DIR

Where DIR is one or more directory and/or file names.

This will rename JPG files in the directories specified.  You can add a -r to also rename files in sub-directories.

You can also move files in the same command by adding -directory="destination directory name".

If some images don't have DateTimeOriginal information, you may specify secondary (and tertiary, etc...) sort keys with additional -fileorder options.

- Phil
Title: Re: Date/Timeshift and renaming fast
Post by: Koen on September 19, 2012, 03:29:20 PM
Thanks Phil,

This will certainly help me with my last step.
My idea was to start all over so I can easily organize everything from scratch and use te command so I only have to edit some parameters if I want to use it another time (with new pictures).

Obviously, there are more than a few errors left in the code below


exiftool "-DateTimeOriginal<FileModifyDate" d:\foto\*.mp4
exiftool "-DateTimeOriginal<FileModifyDate" d:\foto\*.mov
exiftool "-DateTimeOriginal<FileModifyDate" d:\foto\*.avi


exiftool -DateTimeOriginal+=9:29 -if '$make eq "SONY"' d:\foto
exiftool -DateTimeOriginal+=1:10 -if '$make eq "SAMSUNG"' d:\foto
exiftool -DateTimeOriginal+=1:10 d:\foto\*.mov
exiftool -DateTimeOriginal+=0:0:2 12:16 -if '$make eq "Apple"' d:\foto
exiftool -DateTimeOriginal+=0:0:2 12:16 d:\foto\*.mov
exiftool -DateTimeOriginal-=11:13 -if '$make eq "FUJIFILM"' d:\foto
exiftool -DateTimeOriginal+=0:15 -if '$make eq "NIKON"' d:\foto

exiftool -DateTimeOriginal+=8:00 -if '$model eq "TG-310"  AND $CreateDate => 01-06-2012' d:\foto         ; only files created after 1-6-2012 need a TimeShift
exiftool -DateTimeOriginal+=8:00 -if '$CreateDate => 01-06-2012' d:\foto\P*.mp4                                      ; all mp4 video's after 1-6-2012 as well

exiftool -DateTimeOriginal+=1:3:23 17:17 -if '$make eq "GoPro" AND $Filename eq GO&&41&&.*' d:\foto   ; this is GoPro cam1
exiftool -DateTimeOriginal+=0:0:7 23:17 -if '$make eq "GoPro" AND $Filename eq GO&&1&&&.*' d:\foto     ;GoPro cam2 needs an additional TimeShift
exiftool -DateTimeOriginal+=0:0:7 23:17 -if '$make eq "GoPro" AND $Filename eq GO&&2&&&.*' d:\foto     ;GoPro cam2 has a range of files between 1250 - 2700

exiftool -DateTimeOriginal-=0:02 -if '$make eq "SEMC"' d:\foto
exiftool -DateTimeOriginal+=0:04 -if '$make eq "HTC"' d:\foto
exiftool -DateTimeOriginal+=1:6:3 16:43 -if '$model eq "ATC9K"' d:\foto


exiftool -fileorder datetimeoriginal -filename="My Pictures %7.nc.%e" -ext jpg d:\foto                            ; I want all files to have a consequential number, not only the images