Date/Timeshift and renaming fast

Started by Koen, September 19, 2012, 08:31:38 AM

Previous topic - Next topic

Koen

Hi there,

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

Here are some details:

  • I've used 11 different camera's
  • 2 camera's were both of the same manufacturer & model (OLYMPUS IMAGING CORP. & TG-310)
  • 2 other camera's were both of the same manufacturer & model (GoPro & HD2)
  • 1 camera is used in 5 different timezones and the time was never adjusted on the camera
  • the camera's aren't synchronized, and the date/time is wrong somewhere between 1,5 years and 1 minute
  • I've got approximately 7500 pictures and 300 video's I want to sort (oldest first)
  • I have to use the [ModifyDate] of the video's and [DateTimeOriginal] or [CreateDate] of all pictures
  • I'd like to rename all the files My Pictures 00001 - My Pictures 07799 based on the date and time I took the picture/video

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?

Phil Harvey

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

Koen

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