m2ts DateTimeOriginal editing

Started by ganymede55, December 30, 2015, 06:10:54 PM

Previous topic - Next topic

Phil Harvey

Very cool.  I tried the script and it seems to work very well!

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

ganymede55

Thanks for the effort guys!  I got tied up with the back to work backlog the last 2 days, but I will try to install perl and run the script tomorrow. 

ganymede55

Hayo,
Thanks again for the effort.  Unfortunately, it still doesn't appear to be working for me.  When I run the script, it seems to loop an varying number of times (another file had 26) and then not update anything (another file had a fileModifyDate several months newer than DateTimeOriginal and nothing changed, so it's not timezone offset). 

C:\Perl64\bin>exiftool -s -a -G0:1 -"*Date*" 20150809234216.m2ts
[File:System]   FileModifyDate                  : 2015:08:10 03:42:15-05:00
[File:System]   FileAccessDate                  : 2016:01:09 22:48:46-06:00
[File:System]   FileCreateDate                  : 2016:01:09 22:48:46-06:00
[H264]          DateTimeOriginal                : 2015:08:09 23:42:15-09:00

C:\Perl64\bin>perl matchDateTime 20150809234216.m2ts
Updated 2015:08:09 23:42:15 -09:00 DST => 2015:08:10 03:42:15 -09:00 DST in 20150809234216.m2ts (2 times)

Updated 2015:08:09 23:42:16 -09:00 DST => 2015:08:10 03:42:16 -09:00 DST in 20150809234216.m2ts (2 times)

Updated 2015:08:09 23:42:17 -09:00 DST => 2015:08:10 03:42:17 -09:00 DST in 20150809234216.m2ts (2 times)

Updated 2015:08:09 23:42:18 -09:00 DST => 2015:08:10 03:42:18 -09:00 DST in 20150809234216.m2ts (2 times)

Updated 2015:08:09 23:42:19 -09:00 DST => 2015:08:10 03:42:19 -09:00 DST in 20150809234216.m2ts (2 times)

Updated 2015:08:09 23:42:20 -09:00 DST => 2015:08:10 03:42:20 -09:00 DST in 20150809234216.m2ts (2 times)

OK: Changed date 12 times in 20150809234216.m2ts

C:\Perl64\bin>exiftool -s -a -G0:1 -"*Date*" 20150809234216.m2ts
[File:System]   FileModifyDate                  : 2015:08:10 03:42:15-05:00
[File:System]   FileAccessDate                  : 2016:01:09 22:48:46-06:00
[File:System]   FileCreateDate                  : 2016:01:09 22:48:46-06:00
[H264]          DateTimeOriginal                : 2015:08:09 23:42:15-09:00


It's possible that I'm not running something correctly.  I simply copied the files to the Perl64 .exe directory and ran the command as shown from the command prompt.  If not, is there anything else that you can think of?

Hayo Baan

It leaves the original file intact, unless you specify -overwrite. Look in the directory you will see files with matchdatetime in their name :)
Hayo Baan – Photography
Web: www.hayobaan.nl

ganymede55

Doh! :-[  That's what I get for working after midnight.  I spent a little more time on this and it's working really well!  I do have a few questions though.

  • The script doesn't appear to support recursion or even application to all the files in a directory (wildcards or just specifying the directory), even though exiftool does all of that.  I saw where you said to specify the file names I the command line, but I have several hundred that I want to apply this to.  Do you have any suggestions?  If a batch file, do you have an example?  I've seen where Phil said exiftool has to start up for every file if this is done improperly.  I do understand the amount of work you are saving me here, so please don't spend any more major time on this.
  • I did find a small logic loop when using the -tz and -overwrite flags in combination with setting the FileModifyDate from the DateTimeOriginal.  Say that the DateTimeOriginal is 01:00 UTC-10 and I'm in UTC-5.  When I set the FileModifyDate from the DateTimeOriginal, it is set to 06:00 UTC-5.  When I run your script with tz -10, it sets it to 06:00 UTC-10.  Another round and it's 11:00 UTC-10, and so on.  I can adjust for this by staying at one loop or adjusting the FileModifyDate backward, so no big deal, but I thought you might be interested.
  • I don't really understand the DST flag.  I see how to set it if not already on, but how do you specify to turn it off if it's already on?  I only have a few files like this and this and I don't even know what programs look at this, so this is a curiosity (very low priority).

Phil Harvey

It is easy for me to add a " DST" to the time if the DST flag is set.  I'll do this in the next release (ExifTool 10.10) so you'll have an indication if the time is DST when reading H264:DateTimeOriginal.

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

ganymede55


Hayo Baan

Hi Chris,

I made some adjustments to the script :)

When you now provide a directory, all files in that directory are processed and a recurse option (-r) can now be specified as well, Furthermore, the script now restores the original file modification time (so repeated calls will not have the unwanted effect of changing the time again and again).

Note: directory recursion is indiscriminate and will process all files in the specified directories!

The behaviour you see with the datetime is expected: when you update the file modification datetime with the datetimeoriginal, its timezone is taken into account, but when you use the script to set the datetimeoriginal to that of the file, the timezone is explicitly ignored. So yes, you should only once set the file modification time to what you want the datatime original to be, than match it with the script and be done. The problem here is that file modification is local time and datetime original isn't...
As the script now restores the file modification time this might be less of a problem.

If you set the timezone with -tz, the daylight savings setting will be off unless you specify -dst
(but this was hard to check as exiftool currently does not tell you what it was set to ;))

The new script is attached.
Hayo Baan – Photography
Web: www.hayobaan.nl

ganymede55

Hayo, Thanks again.  This is great!  I created a little batch file to copy the files to a folder and then modify the files (the modification part output is shown below). 
C:\Windows\system32>exiftool -r -s -a -G0:1 -"*Date*" "G:\Public Videos\_Updated\8-8-2015" -ext mts -ext m2ts
======== G:/Public Videos/_Updated/8-8-2015/20150808213521.m2ts
[File:System]   FileModifyDate                  : 2015:11:17 22:16:08-06:00
[File:System]   FileAccessDate                  : 2015:08:09 10:13:21-05:00
[File:System]   FileCreateDate                  : 2015:08:09 10:13:21-05:00
[H264]          DateTimeOriginal                : 2015:08:08 21:35:21-05:00
======== G:/Public Videos/_Updated/8-8-2015/20150808213804.m2ts
[File:System]   FileModifyDate                  : 2015:11:17 22:16:12-06:00
[File:System]   FileAccessDate                  : 2015:08:09 10:16:04-05:00
[File:System]   FileCreateDate                  : 2015:08:09 10:16:04-05:00
[H264]          DateTimeOriginal                : 2015:08:08 21:38:04-05:00
======== G:/Public Videos/_Updated/8-8-2015/20150808215232.m2ts
[File:System]   FileModifyDate                  : 2015:11:17 22:16:16-06:00
[File:System]   FileAccessDate                  : 2015:08:09 10:30:32-05:00
[File:System]   FileCreateDate                  : 2015:08:09 10:30:32-05:00
[H264]          DateTimeOriginal                : 2015:08:08 21:52:32-05:00
======== G:/Public Videos/_Updated/8-8-2015/20150809224855.m2ts
[File:System]   FileModifyDate                  : 2015:11:15 15:47:43-06:00
[File:System]   FileAccessDate                  : 2015:08:10 15:26:55-05:00
[File:System]   FileCreateDate                  : 2015:08:10 15:26:55-05:00
[H264]          DateTimeOriginal                : 2015:08:09 22:48:55-09:00
======== G:/Public Videos/_Updated/8-8-2015/20150809225048.m2ts
[File:System]   FileModifyDate                  : 2015:11:15 15:47:44-06:00
[File:System]   FileAccessDate                  : 2015:08:10 15:28:48-05:00
[File:System]   FileCreateDate                  : 2015:08:10 15:28:48-05:00
[H264]          DateTimeOriginal                : 2015:08:09 22:50:48-09:00
======== G:/Public Videos/_Updated/8-8-2015/20150809234216.m2ts
[File:System]   FileModifyDate                  : 2015:11:15 15:48:10-06:00
[File:System]   FileAccessDate                  : 2015:08:10 16:20:15-05:00
[File:System]   FileCreateDate                  : 2015:08:10 16:20:15-05:00
[H264]          DateTimeOriginal                : 2015:08:09 23:42:15-09:00
    1 directories scanned
    6 image files read

C:\Windows\system32>exiftool -r "-fileModifyDate<dateTimeOriginal" "-fileCreateDate<dateTimeOriginal" "G:\Public Videos\_Updated\8-8-2015" -ext mts -e
xt m2ts
    1 directories scanned
    6 image files updated

C:\Windows\system32>exiftool -r -s -fileCreateDate+="7:38:00" -fileModifyDate+="7:38:00" "G:\Public Videos\_Updated\8-8-2015" -ext mts -ext m2ts
    1 directories scanned
    6 image files updated

C:\Windows\system32>perl matchDateTime -r -overwrite -tz -10 "G:\Public Videos\_Updated\8-8-2015"
Updated 2015:08:08 21:35:21 -05:00 DST => 2015:08:09 05:13:21 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:08 21:35:22 -05:00 DST => 2015:08:09 05:13:22 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:08 21:35:23 -05:00 DST => 2015:08:09 05:13:23 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:08 21:35:24 -05:00 DST => 2015:08:09 05:13:24 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:08 21:35:25 -05:00 DST => 2015:08:09 05:13:25 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:08 21:35:26 -05:00 DST => 2015:08:09 05:13:26 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:08 21:35:27 -05:00 DST => 2015:08:09 05:13:27 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:08 21:35:28 -05:00 DST => 2015:08:09 05:13:28 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:08 21:35:29 -05:00 DST => 2015:08:09 05:13:29 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:08 21:35:30 -05:00 DST => 2015:08:09 05:13:30 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:08 21:35:31 -05:00 DST => 2015:08:09 05:13:31 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:08 21:35:32 -05:00 DST => 2015:08:09 05:13:32 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:08 21:35:33 -05:00 DST => 2015:08:09 05:13:33 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
OK: Changed date 26 times in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts
Updated 2015:08:08 21:38:04 -05:00 DST => 2015:08:09 05:16:04 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
Updated 2015:08:08 21:38:05 -05:00 DST => 2015:08:09 05:16:05 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
Updated 2015:08:08 21:38:06 -05:00 DST => 2015:08:09 05:16:06 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
Updated 2015:08:08 21:38:07 -05:00 DST => 2015:08:09 05:16:07 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
Updated 2015:08:08 21:38:08 -05:00 DST => 2015:08:09 05:16:08 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
Updated 2015:08:08 21:38:09 -05:00 DST => 2015:08:09 05:16:09 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
Updated 2015:08:08 21:38:10 -05:00 DST => 2015:08:09 05:16:10 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
Updated 2015:08:08 21:38:11 -05:00 DST => 2015:08:09 05:16:11 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
Updated 2015:08:08 21:38:12 -05:00 DST => 2015:08:09 05:16:12 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
Updated 2015:08:08 21:38:13 -05:00 DST => 2015:08:09 05:16:13 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
Updated 2015:08:08 21:38:14 -05:00 DST => 2015:08:09 05:16:14 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
Updated 2015:08:08 21:38:15 -05:00 DST => 2015:08:09 05:16:15 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
Updated 2015:08:08 21:38:16 -05:00 DST => 2015:08:09 05:16:16 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
Updated 2015:08:08 21:38:17 -05:00 DST => 2015:08:09 05:16:17 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
Updated 2015:08:08 21:38:18 -05:00 DST => 2015:08:09 05:16:18 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
Updated 2015:08:08 21:38:19 -05:00 DST => 2015:08:09 05:16:19 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
Updated 2015:08:08 21:38:20 -05:00 DST => 2015:08:09 05:16:20 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
Updated 2015:08:08 21:38:21 -05:00 DST => 2015:08:09 05:16:21 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
OK: Changed date 36 times in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts
Updated 2015:08:08 21:52:32 -05:00 DST => 2015:08:09 05:30:32 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808215232.m2ts (2 times)
Updated 2015:08:08 21:52:33 -05:00 DST => 2015:08:09 05:30:33 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808215232.m2ts (2 times)
Updated 2015:08:08 21:52:34 -05:00 DST => 2015:08:09 05:30:34 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808215232.m2ts (2 times)
Updated 2015:08:08 21:52:35 -05:00 DST => 2015:08:09 05:30:35 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808215232.m2ts (2 times)
Updated 2015:08:08 21:52:36 -05:00 DST => 2015:08:09 05:30:36 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808215232.m2ts (2 times)
Updated 2015:08:08 21:52:37 -05:00 DST => 2015:08:09 05:30:37 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808215232.m2ts (2 times)
OK: Changed date 12 times in G:\Public Videos\_Updated\8-8-2015/20150808215232.m2ts
Updated 2015:08:09 22:48:55 -09:00 DST => 2015:08:10 10:26:55 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:48:56 -09:00 DST => 2015:08:10 10:26:56 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:48:57 -09:00 DST => 2015:08:10 10:26:57 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:48:58 -09:00 DST => 2015:08:10 10:26:58 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:48:59 -09:00 DST => 2015:08:10 10:26:59 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:00 -09:00 DST => 2015:08:10 10:27:00 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:01 -09:00 DST => 2015:08:10 10:27:01 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:02 -09:00 DST => 2015:08:10 10:27:02 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:03 -09:00 DST => 2015:08:10 10:27:03 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:04 -09:00 DST => 2015:08:10 10:27:04 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:05 -09:00 DST => 2015:08:10 10:27:05 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:06 -09:00 DST => 2015:08:10 10:27:06 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:07 -09:00 DST => 2015:08:10 10:27:07 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:08 -09:00 DST => 2015:08:10 10:27:08 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:09 -09:00 DST => 2015:08:10 10:27:09 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:10 -09:00 DST => 2015:08:10 10:27:10 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:11 -09:00 DST => 2015:08:10 10:27:11 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:12 -09:00 DST => 2015:08:10 10:27:12 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:13 -09:00 DST => 2015:08:10 10:27:13 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:14 -09:00 DST => 2015:08:10 10:27:14 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:15 -09:00 DST => 2015:08:10 10:27:15 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:16 -09:00 DST => 2015:08:10 10:27:16 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:17 -09:00 DST => 2015:08:10 10:27:17 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:18 -09:00 DST => 2015:08:10 10:27:18 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:19 -09:00 DST => 2015:08:10 10:27:19 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:20 -09:00 DST => 2015:08:10 10:27:20 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (1 times)
OK: Changed date 51 times in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts
Updated 2015:08:09 22:50:48 -09:00 DST => 2015:08:10 10:28:48 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809225048.m2ts (2 times)
Updated 2015:08:09 22:50:49 -09:00 DST => 2015:08:10 10:28:49 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809225048.m2ts (2 times)
Updated 2015:08:09 22:50:50 -09:00 DST => 2015:08:10 10:28:50 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809225048.m2ts (2 times)
Updated 2015:08:09 22:50:51 -09:00 DST => 2015:08:10 10:28:51 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809225048.m2ts (2 times)
Updated 2015:08:09 22:50:52 -09:00 DST => 2015:08:10 10:28:52 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809225048.m2ts (2 times)
Updated 2015:08:09 22:50:53 -09:00 DST => 2015:08:10 10:28:53 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809225048.m2ts (2 times)
Updated 2015:08:09 22:50:54 -09:00 DST => 2015:08:10 10:28:54 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809225048.m2ts (2 times)
Updated 2015:08:09 22:50:55 -09:00 DST => 2015:08:10 10:28:55 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809225048.m2ts (2 times)
Updated 2015:08:09 22:50:56 -09:00 DST => 2015:08:10 10:28:56 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809225048.m2ts (2 times)
Updated 2015:08:09 22:50:57 -09:00 DST => 2015:08:10 10:28:57 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809225048.m2ts (2 times)
Updated 2015:08:09 22:50:58 -09:00 DST => 2015:08:10 10:28:58 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809225048.m2ts (2 times)
Updated 2015:08:09 22:50:59 -09:00 DST => 2015:08:10 10:28:59 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809225048.m2ts (2 times)
Updated 2015:08:09 22:51:00 -09:00 DST => 2015:08:10 10:29:00 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809225048.m2ts (1 times)
OK: Changed date 25 times in G:\Public Videos\_Updated\8-8-2015/20150809225048.m2ts
Updated 2015:08:09 23:42:15 -09:00 DST => 2015:08:10 11:20:15 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809234216.m2ts (2 times)
Updated 2015:08:09 23:42:16 -09:00 DST => 2015:08:10 11:20:16 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809234216.m2ts (2 times)
Updated 2015:08:09 23:42:17 -09:00 DST => 2015:08:10 11:20:17 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809234216.m2ts (2 times)
Updated 2015:08:09 23:42:18 -09:00 DST => 2015:08:10 11:20:18 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809234216.m2ts (2 times)
Updated 2015:08:09 23:42:19 -09:00 DST => 2015:08:10 11:20:19 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809234216.m2ts (2 times)
Updated 2015:08:09 23:42:20 -09:00 DST => 2015:08:10 11:20:20 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809234216.m2ts (2 times)
OK: Changed date 12 times in G:\Public Videos\_Updated\8-8-2015/20150809234216.m2ts
Skipped: Unable to find QuickTime CreateDate in G:\Public Videos\_Updated\8-8-2015/DSC00984.JPG
Skipped: Unable to find QuickTime CreateDate in G:\Public Videos\_Updated\8-8-2015/DSC00985.JPG
Skipped: Unable to find QuickTime CreateDate in G:\Public Videos\_Updated\8-8-2015/DSC00986.JPG
Skipped: Unable to find QuickTime CreateDate in G:\Public Videos\_Updated\8-8-2015/DSC00987.JPG
Skipped: Unable to find QuickTime CreateDate in G:\Public Videos\_Updated\8-8-2015/DSC00988.JPG
Skipped: Unable to find QuickTime CreateDate in G:\Public Videos\_Updated\8-8-2015/DSC00989.JPG
Skipped: Unable to find QuickTime CreateDate in G:\Public Videos\_Updated\8-8-2015/DSC00990.JPG
Skipped: Unable to find QuickTime CreateDate in G:\Public Videos\_Updated\8-8-2015/DSC00991.JPG
Skipped: Unable to find QuickTime CreateDate in G:\Public Videos\_Updated\8-8-2015/DSC00992.JPG
Skipped: Unable to find QuickTime CreateDate in G:\Public Videos\_Updated\8-8-2015/DSC01811.JPG
Skipped: Unable to find QuickTime CreateDate in G:\Public Videos\_Updated\8-8-2015/DSC01812.JPG
Skipped: Unable to find QuickTime CreateDate in G:\Public Videos\_Updated\8-8-2015/IMG_4690.JPG
Skipped: Unable to find QuickTime CreateDate in G:\Public Videos\_Updated\8-8-2015/IMG_4691.JPG
Skipped: Unable to find QuickTime CreateDate in G:\Public Videos\_Updated\8-8-2015/IMG_4691.JPG_original
Skipped: Unable to find QuickTime CreateDate in G:\Public Videos\_Updated\8-8-2015/Thumbs.db

C:\Windows\system32>exiftool -r -s -a -G0:1 -"*Date*" "G:\Public Videos\_Updated\8-8-2015" -ext mts -ext m2ts
======== G:/Public Videos/_Updated/8-8-2015/20150808213521.m2ts
[File:System]   FileModifyDate                  : 2015:08:09 05:13:34-05:00
[File:System]   FileAccessDate                  : 2015:08:09 05:13:34-05:00
[File:System]   FileCreateDate                  : 2015:08:09 05:13:21-05:00
[H264]          DateTimeOriginal                : 2015:08:09 05:13:21-10:00
======== G:/Public Videos/_Updated/8-8-2015/20150808213804.m2ts
[File:System]   FileModifyDate                  : 2015:08:09 05:16:22-05:00
[File:System]   FileAccessDate                  : 2015:08:09 05:16:22-05:00
[File:System]   FileCreateDate                  : 2015:08:09 05:16:04-05:00
[H264]          DateTimeOriginal                : 2015:08:09 05:16:04-10:00
======== G:/Public Videos/_Updated/8-8-2015/20150808215232.m2ts
[File:System]   FileModifyDate                  : 2015:08:09 05:30:38-05:00
[File:System]   FileAccessDate                  : 2015:08:09 05:30:38-05:00
[File:System]   FileCreateDate                  : 2015:08:09 05:30:32-05:00
[H264]          DateTimeOriginal                : 2015:08:09 05:30:32-10:00
======== G:/Public Videos/_Updated/8-8-2015/20150809224855.m2ts
[File:System]   FileModifyDate                  : 2015:08:10 10:27:21-05:00
[File:System]   FileAccessDate                  : 2015:08:10 10:27:21-05:00
[File:System]   FileCreateDate                  : 2015:08:10 10:26:55-05:00
[H264]          DateTimeOriginal                : 2015:08:10 10:26:55-10:00
======== G:/Public Videos/_Updated/8-8-2015/20150809225048.m2ts
[File:System]   FileModifyDate                  : 2015:08:10 10:29:01-05:00
[File:System]   FileAccessDate                  : 2015:08:10 10:29:01-05:00
[File:System]   FileCreateDate                  : 2015:08:10 10:28:48-05:00
[H264]          DateTimeOriginal                : 2015:08:10 10:28:48-10:00
======== G:/Public Videos/_Updated/8-8-2015/20150809234216.m2ts
[File:System]   FileModifyDate                  : 2015:08:10 11:20:21-05:00
[File:System]   FileAccessDate                  : 2015:08:10 11:20:21-05:00
[File:System]   FileCreateDate                  : 2015:08:10 11:20:15-05:00
[H264]          DateTimeOriginal                : 2015:08:10 11:20:15-10:00
    1 directories scanned
    6 image files read

I do have a few questions:

  • It's skipping the .JPG files because they don't have a QuickTime Create Date.  I assume it would modify any file that does have that date.  Do you know what file types do have that so that I know if I need to extract those files from my folders?
  • You said the script now restores the original file modification time.  In the last file in the output below, it restores it to 11:20 -5 while the DateTimeOriginal is 11:20 -10.  I was running a exiftool -r "-fileModifyDate<dateTimeOriginal" command to clean this up, but it set the modify time to 16:20 -5, which is how trying to prevent looping.  Since 16:20-5 = 11:20-10, which is technically more correct?
  • I ran your script again after the output show above and it gets stuck in an infinite loop on the first .m2ts file.  It did not do that with the older script.

Hayo Baan

Quote

  • It's skipping the .JPG files because they don't have a QuickTime Create Date.  I assume it would modify any file that does have that date.  Do you know what file types do have that so that I know if I need to extract those files from my folders?
  • You said the script now restores the original file modification time.  In the last file in the output below, it restores it to 11:20 -5 while the DateTimeOriginal is 11:20 -10.  I was running a exiftool -r "-fileModifyDate<dateTimeOriginal" command to clean this up, but it set the modify time to 16:20 -5, which is how trying to prevent looping.  Since 16:20-5 = 11:20-10, which is technically more correct?
  • I ran your script again after the output show above and it gets stuck in an infinite loop on the first .m2ts file.  It did not do that with the older script.
1. I don't have a full answer for your first question, but it is likely that it would be mostly only QuickTime video files that have this. My script currently doesn't support selecting a filename extension, perhaps something I could add at a later stage.
2. I restore the modification time (using exiftool) as I find it. So my guess is it is not updated correctly when you run your modification exiftool commands. You didn't provide datetime output after you ran the updates so it is hard to tell.
3. What do you mean with infinite loop? Does the script stall, or otherwise keep changing the same files over and over? Can you post the command line and output when this happens?
Hayo Baan – Photography
Web: www.hayobaan.nl

ganymede55

Thanks Hayo.
QuoteYou didn't provide datetime output after you ran the updates so it is hard to tell.
I thought I provided the output after running the files (the command lines are included in the output after the system32 prompt), but maybe I'm missing what exactly you're asking for.  I went ahead and included the output again, but also included the loop where it keeps changing the same file over and over.

Show directory contents of all m2ts files before starting
C:\Windows\system32>exiftool -r -s -a -G0:1 -"*Date*" "G:\Public Videos\_Updated\8-8-2015" -ext mts -ext m2ts
======== G:/Public Videos/_Updated/8-8-2015/20150808213521.m2ts
[File:System]   FileModifyDate                  : 2015:11:17 22:16:08-06:00
[File:System]   FileAccessDate                  : 2015:08:09 05:13:34-05:00
[File:System]   FileCreateDate                  : 2015:08:09 05:13:21-05:00
[H264]          DateTimeOriginal                : 2015:08:08 21:35:21-05:00
======== G:/Public Videos/_Updated/8-8-2015/20150808213804.m2ts
[File:System]   FileModifyDate                  : 2015:11:17 22:16:12-06:00
[File:System]   FileAccessDate                  : 2015:08:09 05:16:22-05:00
[File:System]   FileCreateDate                  : 2015:08:09 05:16:04-05:00
[H264]          DateTimeOriginal                : 2015:08:08 21:38:04-05:00
======== G:/Public Videos/_Updated/8-8-2015/20150808215232.m2ts
[File:System]   FileModifyDate                  : 2015:11:17 22:16:16-06:00
[File:System]   FileAccessDate                  : 2015:08:09 05:30:38-05:00
[File:System]   FileCreateDate                  : 2015:08:09 05:30:32-05:00
[H264]          DateTimeOriginal                : 2015:08:08 21:52:32-05:00
======== G:/Public Videos/_Updated/8-8-2015/20150809224855.m2ts
[File:System]   FileModifyDate                  : 2015:11:15 15:47:43-06:00
[File:System]   FileAccessDate                  : 2015:08:10 10:27:21-05:00
[File:System]   FileCreateDate                  : 2015:08:10 10:26:55-05:00
[H264]          DateTimeOriginal                : 2015:08:09 22:48:55-09:00
======== G:/Public Videos/_Updated/8-8-2015/20150809225048.m2ts
[File:System]   FileModifyDate                  : 2015:11:15 15:47:44-06:00
[File:System]   FileAccessDate                  : 2015:08:10 10:29:01-05:00
[File:System]   FileCreateDate                  : 2015:08:10 10:28:48-05:00
[H264]          DateTimeOriginal                : 2015:08:09 22:50:48-09:00
======== G:/Public Videos/_Updated/8-8-2015/20150809234216.m2ts
[File:System]   FileModifyDate                  : 2015:11:15 15:48:10-06:00
[File:System]   FileAccessDate                  : 2015:08:10 11:20:21-05:00
[File:System]   FileCreateDate                  : 2015:08:10 11:20:15-05:00
[H264]          DateTimeOriginal                : 2015:08:09 23:42:15-09:00
    1 directories scanned
    6 image files read


Set file create and modify dates back to match DateTimeOriginal since the modify date will be used by your script to update the DateTimeOriginal.
C:\Windows\system32>exiftool -r "-fileModifyDate<dateTimeOriginal" "-fileCreateDate<dateTimeOriginal" "G:\Public Videos\_Updated\8-8-2015" -ext mts -e
xt m2ts
    1 directories scanned
    6 image files updated


Update the DateTimeOriginal.  At first I was using +11:38, but +7:38 appears to adjust for the UTC-9 timezone vs. my UTC-5 time zone better.  For example, the 20150809234216.m2ts is getting adjusted from 2015:08:09 23:42:15-09:00 to  2015:08:10 11:20:15-10:00 correctly (see output section two down from here) using the combination of all my steps that use the exiftool commands and your script.
C:\Windows\system32>exiftool -r -s -fileCreateDate+="7:38:00" -fileModifyDate+="7:38:00" "G:\Public Videos\_Updated\8-8-2015" -ext mts -ext m2ts
    1 directories scanned
    6 image files updated


Run your script to recursively update DateTimeOriginal from FileModifyDate ... and set it to UTC-10 time zone.  I didn't change the DST flag, but previous testing didn't show any difference since exiftool can't show it for these files.  I'm not completely clear if I should specify it or not.  The location I was in doesn't use DST.  It does appear to update only the .m2ts files and skip the .JPGs (and even a Thumbs.db for good measure).  It does update the files several times, but it works. 

C:\Windows\system32>perl matchDateTime -r -overwrite -tz -10 "G:\Public Videos\_Updated\8-8-2015"
Updated 2015:08:08 21:35:21 -05:00 DST => 2015:08:09 05:13:21 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:08 21:35:22 -05:00 DST => 2015:08:09 05:13:22 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:08 21:35:23 -05:00 DST => 2015:08:09 05:13:23 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:08 21:35:24 -05:00 DST => 2015:08:09 05:13:24 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:08 21:35:25 -05:00 DST => 2015:08:09 05:13:25 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:08 21:35:26 -05:00 DST => 2015:08:09 05:13:26 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:08 21:35:27 -05:00 DST => 2015:08:09 05:13:27 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:08 21:35:28 -05:00 DST => 2015:08:09 05:13:28 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:08 21:35:29 -05:00 DST => 2015:08:09 05:13:29 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:08 21:35:30 -05:00 DST => 2015:08:09 05:13:30 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:08 21:35:31 -05:00 DST => 2015:08:09 05:13:31 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:08 21:35:32 -05:00 DST => 2015:08:09 05:13:32 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:08 21:35:33 -05:00 DST => 2015:08:09 05:13:33 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
OK: Changed date 26 times in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts
Updated 2015:08:08 21:38:04 -05:00 DST => 2015:08:09 05:16:04 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
Updated 2015:08:08 21:38:05 -05:00 DST => 2015:08:09 05:16:05 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
Updated 2015:08:08 21:38:06 -05:00 DST => 2015:08:09 05:16:06 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
Updated 2015:08:08 21:38:07 -05:00 DST => 2015:08:09 05:16:07 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
Updated 2015:08:08 21:38:08 -05:00 DST => 2015:08:09 05:16:08 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
Updated 2015:08:08 21:38:09 -05:00 DST => 2015:08:09 05:16:09 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
Updated 2015:08:08 21:38:10 -05:00 DST => 2015:08:09 05:16:10 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
Updated 2015:08:08 21:38:11 -05:00 DST => 2015:08:09 05:16:11 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
Updated 2015:08:08 21:38:12 -05:00 DST => 2015:08:09 05:16:12 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
Updated 2015:08:08 21:38:13 -05:00 DST => 2015:08:09 05:16:13 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
Updated 2015:08:08 21:38:14 -05:00 DST => 2015:08:09 05:16:14 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
Updated 2015:08:08 21:38:15 -05:00 DST => 2015:08:09 05:16:15 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
Updated 2015:08:08 21:38:16 -05:00 DST => 2015:08:09 05:16:16 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
Updated 2015:08:08 21:38:17 -05:00 DST => 2015:08:09 05:16:17 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
Updated 2015:08:08 21:38:18 -05:00 DST => 2015:08:09 05:16:18 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
Updated 2015:08:08 21:38:19 -05:00 DST => 2015:08:09 05:16:19 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
Updated 2015:08:08 21:38:20 -05:00 DST => 2015:08:09 05:16:20 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
Updated 2015:08:08 21:38:21 -05:00 DST => 2015:08:09 05:16:21 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts (2 times)
OK: Changed date 36 times in G:\Public Videos\_Updated\8-8-2015/20150808213804.m2ts
Updated 2015:08:08 21:52:32 -05:00 DST => 2015:08:09 05:30:32 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808215232.m2ts (2 times)
Updated 2015:08:08 21:52:33 -05:00 DST => 2015:08:09 05:30:33 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808215232.m2ts (2 times)
Updated 2015:08:08 21:52:34 -05:00 DST => 2015:08:09 05:30:34 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808215232.m2ts (2 times)
Updated 2015:08:08 21:52:35 -05:00 DST => 2015:08:09 05:30:35 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808215232.m2ts (2 times)
Updated 2015:08:08 21:52:36 -05:00 DST => 2015:08:09 05:30:36 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808215232.m2ts (2 times)
Updated 2015:08:08 21:52:37 -05:00 DST => 2015:08:09 05:30:37 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808215232.m2ts (2 times)
OK: Changed date 12 times in G:\Public Videos\_Updated\8-8-2015/20150808215232.m2ts
Updated 2015:08:09 22:48:55 -09:00 DST => 2015:08:10 10:26:55 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:48:56 -09:00 DST => 2015:08:10 10:26:56 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:48:57 -09:00 DST => 2015:08:10 10:26:57 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:48:58 -09:00 DST => 2015:08:10 10:26:58 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:48:59 -09:00 DST => 2015:08:10 10:26:59 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:00 -09:00 DST => 2015:08:10 10:27:00 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:01 -09:00 DST => 2015:08:10 10:27:01 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:02 -09:00 DST => 2015:08:10 10:27:02 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:03 -09:00 DST => 2015:08:10 10:27:03 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:04 -09:00 DST => 2015:08:10 10:27:04 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:05 -09:00 DST => 2015:08:10 10:27:05 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:06 -09:00 DST => 2015:08:10 10:27:06 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:07 -09:00 DST => 2015:08:10 10:27:07 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:08 -09:00 DST => 2015:08:10 10:27:08 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:09 -09:00 DST => 2015:08:10 10:27:09 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:10 -09:00 DST => 2015:08:10 10:27:10 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:11 -09:00 DST => 2015:08:10 10:27:11 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:12 -09:00 DST => 2015:08:10 10:27:12 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:13 -09:00 DST => 2015:08:10 10:27:13 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:14 -09:00 DST => 2015:08:10 10:27:14 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:15 -09:00 DST => 2015:08:10 10:27:15 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:16 -09:00 DST => 2015:08:10 10:27:16 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:17 -09:00 DST => 2015:08:10 10:27:17 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:18 -09:00 DST => 2015:08:10 10:27:18 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:19 -09:00 DST => 2015:08:10 10:27:19 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (2 times)
Updated 2015:08:09 22:49:20 -09:00 DST => 2015:08:10 10:27:20 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts (1 times)
OK: Changed date 51 times in G:\Public Videos\_Updated\8-8-2015/20150809224855.m2ts
Updated 2015:08:09 22:50:48 -09:00 DST => 2015:08:10 10:28:48 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809225048.m2ts (2 times)
Updated 2015:08:09 22:50:49 -09:00 DST => 2015:08:10 10:28:49 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809225048.m2ts (2 times)
Updated 2015:08:09 22:50:50 -09:00 DST => 2015:08:10 10:28:50 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809225048.m2ts (2 times)
Updated 2015:08:09 22:50:51 -09:00 DST => 2015:08:10 10:28:51 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809225048.m2ts (2 times)
Updated 2015:08:09 22:50:52 -09:00 DST => 2015:08:10 10:28:52 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809225048.m2ts (2 times)
Updated 2015:08:09 22:50:53 -09:00 DST => 2015:08:10 10:28:53 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809225048.m2ts (2 times)
Updated 2015:08:09 22:50:54 -09:00 DST => 2015:08:10 10:28:54 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809225048.m2ts (2 times)
Updated 2015:08:09 22:50:55 -09:00 DST => 2015:08:10 10:28:55 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809225048.m2ts (2 times)
Updated 2015:08:09 22:50:56 -09:00 DST => 2015:08:10 10:28:56 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809225048.m2ts (2 times)
Updated 2015:08:09 22:50:57 -09:00 DST => 2015:08:10 10:28:57 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809225048.m2ts (2 times)
Updated 2015:08:09 22:50:58 -09:00 DST => 2015:08:10 10:28:58 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809225048.m2ts (2 times)
Updated 2015:08:09 22:50:59 -09:00 DST => 2015:08:10 10:28:59 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809225048.m2ts (2 times)
Updated 2015:08:09 22:51:00 -09:00 DST => 2015:08:10 10:29:00 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809225048.m2ts (1 times)
OK: Changed date 25 times in G:\Public Videos\_Updated\8-8-2015/20150809225048.m2ts
Updated 2015:08:09 23:42:15 -09:00 DST => 2015:08:10 11:20:15 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809234216.m2ts (2 times)
Updated 2015:08:09 23:42:16 -09:00 DST => 2015:08:10 11:20:16 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809234216.m2ts (2 times)
Updated 2015:08:09 23:42:17 -09:00 DST => 2015:08:10 11:20:17 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809234216.m2ts (2 times)
Updated 2015:08:09 23:42:18 -09:00 DST => 2015:08:10 11:20:18 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809234216.m2ts (2 times)
Updated 2015:08:09 23:42:19 -09:00 DST => 2015:08:10 11:20:19 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809234216.m2ts (2 times)
Updated 2015:08:09 23:42:20 -09:00 DST => 2015:08:10 11:20:20 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150809234216.m2ts (2 times)
OK: Changed date 12 times in G:\Public Videos\_Updated\8-8-2015/20150809234216.m2ts
Skipped: Unable to find QuickTime CreateDate in G:\Public Videos\_Updated\8-8-2015/DSC00984.JPG
Skipped: Unable to find QuickTime CreateDate in G:\Public Videos\_Updated\8-8-2015/DSC00985.JPG
Skipped: Unable to find QuickTime CreateDate in G:\Public Videos\_Updated\8-8-2015/DSC00986.JPG
Skipped: Unable to find QuickTime CreateDate in G:\Public Videos\_Updated\8-8-2015/DSC00987.JPG
Skipped: Unable to find QuickTime CreateDate in G:\Public Videos\_Updated\8-8-2015/DSC00988.JPG
Skipped: Unable to find QuickTime CreateDate in G:\Public Videos\_Updated\8-8-2015/DSC00989.JPG
Skipped: Unable to find QuickTime CreateDate in G:\Public Videos\_Updated\8-8-2015/DSC00990.JPG
Skipped: Unable to find QuickTime CreateDate in G:\Public Videos\_Updated\8-8-2015/DSC00991.JPG
Skipped: Unable to find QuickTime CreateDate in G:\Public Videos\_Updated\8-8-2015/DSC00992.JPG
Skipped: Unable to find QuickTime CreateDate in G:\Public Videos\_Updated\8-8-2015/DSC01811.JPG
Skipped: Unable to find QuickTime CreateDate in G:\Public Videos\_Updated\8-8-2015/DSC01812.JPG
Skipped: Unable to find QuickTime CreateDate in G:\Public Videos\_Updated\8-8-2015/IMG_4690.JPG
Skipped: Unable to find QuickTime CreateDate in G:\Public Videos\_Updated\8-8-2015/IMG_4691.JPG
Skipped: Unable to find QuickTime CreateDate in G:\Public Videos\_Updated\8-8-2015/IMG_4691.JPG_original
Skipped: Unable to find QuickTime CreateDate in G:\Public Videos\_Updated\8-8-2015/Thumbs.db


Display directory contents, dates, and times again to see how this worked.  DateTimeOriginal fields appear correct.  File Modify and Create Dates are the same time, but set to UTC-5 (my time zone), which is effective a different time.  I'm fine with this, just a little confused as to why they're not 5 hours later if UTC-5.
C:\Windows\system32>exiftool -r -s -a -G0:1 -"*Date*" "G:\Public Videos\_Updated\8-8-2015" -ext mts -ext m2ts
======== G:/Public Videos/_Updated/8-8-2015/20150808213521.m2ts
[File:System]   FileModifyDate                  : 2015:08:09 05:13:34-05:00
[File:System]   FileAccessDate                  : 2015:08:09 05:13:34-05:00
[File:System]   FileCreateDate                  : 2015:08:09 05:13:21-05:00
[H264]          DateTimeOriginal                : 2015:08:09 05:13:21-10:00
======== G:/Public Videos/_Updated/8-8-2015/20150808213804.m2ts
[File:System]   FileModifyDate                  : 2015:08:09 05:16:22-05:00
[File:System]   FileAccessDate                  : 2015:08:09 05:16:22-05:00
[File:System]   FileCreateDate                  : 2015:08:09 05:16:04-05:00
[H264]          DateTimeOriginal                : 2015:08:09 05:16:04-10:00
======== G:/Public Videos/_Updated/8-8-2015/20150808215232.m2ts
[File:System]   FileModifyDate                  : 2015:08:09 05:30:38-05:00
[File:System]   FileAccessDate                  : 2015:08:09 05:30:38-05:00
[File:System]   FileCreateDate                  : 2015:08:09 05:30:32-05:00
[H264]          DateTimeOriginal                : 2015:08:09 05:30:32-10:00
======== G:/Public Videos/_Updated/8-8-2015/20150809224855.m2ts
[File:System]   FileModifyDate                  : 2015:08:10 10:27:21-05:00
[File:System]   FileAccessDate                  : 2015:08:10 10:27:21-05:00
[File:System]   FileCreateDate                  : 2015:08:10 10:26:55-05:00
[H264]          DateTimeOriginal                : 2015:08:10 10:26:55-10:00
======== G:/Public Videos/_Updated/8-8-2015/20150809225048.m2ts
[File:System]   FileModifyDate                  : 2015:08:10 10:29:01-05:00
[File:System]   FileAccessDate                  : 2015:08:10 10:29:01-05:00
[File:System]   FileCreateDate                  : 2015:08:10 10:28:48-05:00
[H264]          DateTimeOriginal                : 2015:08:10 10:28:48-10:00
======== G:/Public Videos/_Updated/8-8-2015/20150809234216.m2ts
[File:System]   FileModifyDate                  : 2015:08:10 11:20:21-05:00
[File:System]   FileAccessDate                  : 2015:08:10 11:20:21-05:00
[File:System]   FileCreateDate                  : 2015:08:10 11:20:15-05:00
[H264]          DateTimeOriginal                : 2015:08:10 11:20:15-10:00
    1 directories scanned
    6 image files read


Ran your script again just to see what would happen (might need to do this if I made a mistake the first time).  It gets stuck updating the same file over and over (I stopped execution manually).

C:\Windows\system32>perl matchDateTime -r -overwrite -tz -10 "G:\Public Videos\_Updated\8-8-2015"
Updated 2015:08:09 05:13:21 -10:00 => 2015:08:09 05:13:34 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:09 05:13:22 -10:00 => 2015:08:09 05:13:35 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:09 05:13:23 -10:00 => 2015:08:09 05:13:36 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:09 05:13:24 -10:00 => 2015:08:09 05:13:37 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:09 05:13:25 -10:00 => 2015:08:09 05:13:38 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:09 05:13:26 -10:00 => 2015:08:09 05:13:39 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:09 05:13:27 -10:00 => 2015:08:09 05:13:40 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:09 05:13:28 -10:00 => 2015:08:09 05:13:41 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:09 05:13:29 -10:00 => 2015:08:09 05:13:42 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:09 05:13:30 -10:00 => 2015:08:09 05:13:43 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:09 05:13:31 -10:00 => 2015:08:09 05:13:44 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:09 05:13:32 -10:00 => 2015:08:09 05:13:45 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:09 05:13:33 -10:00 => 2015:08:09 05:13:46 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:09 05:13:34 -10:00 => 2015:08:09 05:13:47 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:09 05:13:35 -10:00 => 2015:08:09 05:13:48 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:09 05:13:36 -10:00 => 2015:08:09 05:13:49 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Updated 2015:08:09 05:13:37 -10:00 => 2015:08:09 05:13:50 -10:00 in G:\Public Videos\_Updated\8-8-2015/20150808213521.m2ts (2 times)
Terminating on signal SIGBREAK(21)
Terminate batch job (Y/N)? y


Hayo Baan

Hi Chris,

What I meant is that I need to see the output of your first command exiftool -r -s -a -G0:1 -"*Date*" "G:\Public Videos\_Updated\8-8-2015" -ext mts -ext m2ts again after you did your two modifications with exiftool. The fileModifyDate you see then is what my script will use and I bet you that is not what you expect it to be :)

And the script is actually NOT in an infinite loop, it is just a large video so it has to change many timestamps (there are about two per second of video). As you can see, the time keeps increasing, so it is just churning through your file. If the video is really long, this can take a while to finish ;)

Hope this explains things,
Hayo
Hayo Baan – Photography
Web: www.hayobaan.nl