Adjusting date while using it to create file name

Started by hawkeyeknight, June 21, 2012, 04:17:36 PM

Previous topic - Next topic

hawkeyeknight

This exiftool has been a godsend in helping me correct incorrect camera time setting metadata (all different) from a set of recent vacation photos and videos. However, since I believe that the tool can not write to the metadata on .MOV or .MTS files, I am extracting the "CreateDate" info from video metadata and using exiftool to change the file name using that date info. However, since the "CreateDate" info needs to be corrected to eliminate the original camera time setting error, I would like to be able to modify the date before it is used to create the new file name. The file name is in the format %Y%m%D%H%M%S, but I need to know if I can somehow adjust the hour value before it is used to create the file name. Any help would be greatly appreciated.

Phil Harvey

There are two ways that you can do this:

1) Create a sidecar file containing the metadata from the video, adjust the time in the sidecar file, then set the video filename from the sidecar.

2) Create a user-defined tag to give you a shifted date/time, then set the video filename from this (see this post or this post or this post or this post or this post for example config files that do just this).

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

Phil Harvey

OK.  This has come up enough times in the past that I think it is worth adding a new option.

ExifTool 8.96 will have a new -globalTimeShift option, which takes a shift string as an argument and shifts all extracted date/time values.

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

bratwoscht

I tried to use the globaltimeshift option for renaming files but it just seems to be not working (using ver. 9.02):

I used this example from the documentation:


    # set the file name from the shifted CreateDate (-1 day) for
    # all images in a directory
    exiftool "-filename<createdate" -globaltimeshift "-0:0:1 0:0:0" \
        -d %Y%m%d-%H%M%S.%%e dir


Could you please check this? Thank you!

Phil Harvey

You're right, this isn't working as intended when copying tags.  How embarrassing that my example doesn't work.

This will be fixed in ExifTool 9.04, which I plan to release later today.

Thanks for this report.

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


Phil Harvey

Version 9.04 is now available.

Thanks again for reporting this bug.

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