Shift Date and Time during FileName

Started by danisaacson, February 21, 2011, 06:28:24 AM

Previous topic - Next topic

danisaacson

Phil, first off great work with exiftool; VERY useful.

I'm trying to use exiftool to rename a few thousand MTS files from an AVCHD camera based on the DateTimeOriginal.
Works fine if I don't need to timeshift...
$ exiftool '-FileName<DateTimeOriginal' -d  %Y-%m-%d-%H%M%S%%c.%%e -ext MTS *

but if I need to adjust the Date or Time during the rename process:
$ exiftool '-FileName<DateTimeOriginal+=5:0:0' -d  %Y-%m-%d-%H%M%S%%c.%%e -ext MTS *
gives me an error "Warning: No writable tags found" which I understand because MTS files are not writable by exiftool but I don't need to change the tag in the file, necessarily. I just want to able to adjust the date and time (i.e. shift timezones) as exiftool renames the files.  Does that make sense?

Any chance of making MTS files writeable?

Phil Harvey

The error is because there is no tag called "DateTimeOriginal+=5:0:0" in the file, so no tags are being written.

The best way to do what you want is to create a user-defined tag which shifts the DateTimeOriginal by 5 hours, then write FileName with this tag instead of DateTimeOriginal.

See this thread for an example config file that does this (but in this case, the shift was 2 months).

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).