ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: hawkeyeknight on June 21, 2012, 04:17:36 PM

Title: Adjusting date while using it to create file name
Post by: hawkeyeknight on June 21, 2012, 04:17:36 PM
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.
Title: Re: Adjusting date while using it to create file name
Post by: Phil Harvey on June 22, 2012, 07:26:27 AM
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 (https://exiftool.org/forum/index.php/topic,1937.msg8460.html#msg8460) or this post (https://exiftool.org/forum/index.php/topic,2186.msg9571.html#msg9571) or this post (https://exiftool.org/forum/index.php/topic,1924.msg8415.html#msg8415) or this post (https://exiftool.org/forum/index.php/topic,2818.msg12482.html#msg12482) or this post (https://exiftool.org/forum/index.php/topic,1886.msg8222.html#msg8222) for example config files that do just this).

- Phil
Title: Re: Adjusting date while using it to create file name
Post by: Phil Harvey on June 22, 2012, 09:23:46 AM
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
Title: Re: Adjusting date while using it to create file name
Post by: bratwoscht on November 02, 2012, 06:58:19 PM
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!
Title: Re: Adjusting date while using it to create file name
Post by: Phil Harvey on November 03, 2012, 06:14:50 AM
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
Title: Re: Adjusting date while using it to create file name
Post by: bratwoscht on November 03, 2012, 09:16:58 AM
Great!

Many thanks!

Title: Re: Adjusting date while using it to create file name
Post by: Phil Harvey on November 03, 2012, 01:01:59 PM
Version 9.04 is now available.

Thanks again for reporting this bug.

- Phil