When trying to copying the DateTimeOriginal (DTM) to the FileModifyDate (FMD) I am running into a multiple issues. The first being a synchronization error message. I believe the cause of this is due to how these files were originally recorded. On my camcorder I did not have the Daylight Savings Time (DST) option enabled when I took these videos back in 2012. From the output below you can see how on the videos that were taken in 2018 with DST enabled are attaching a "DST" to the end of the DTM timestamp. The videos that I took in 2012 do not have DST appended to the end of the DTM timestamp. When I run the below command on a file that does not have the DST value I receive a synchronization error. However the timestamp on the FMD ends up being accurate. When I copy the DTM to the FMD on files that were created with DST enabled on the camcorder thereby having the DST value I run into an issue. If DST is not in effect, FMD has the correct timestamp. If DST is in effect, FMD is off by an hour.
To recap,
1. DST not enabled, copied files have accurate FMD but ExifTool says there is a synchronization error due to not having the DST value on DTM.
2. DST enabled, copied files when DST is not in effect are fine, but copied files when DST in effect does not reflect the hour difference.
Since I have a mixed bag of these files. I'm wondering if there is a script that can be created that would,
1. Add the DST value to DTM.
2. Then, add an hour to the FMD only if DST is in effect. I'm not sure how it knows that to be honest, I'm assuming it's using the Windows timezone information or it's going off of the FMD UTC offset of -04:00.
Synchronization error when copying DTM to FMD on a file that was created without DST enabled on camcorder thereby not having the DST value on DTM.
C:\Users\XYZ>exiftool "-filemodifydate<DateTimeOriginal" -extractEmbedded -v "D:\File.MTS"
======== D:\File.MTS
Setting new values from D:\File.MTS
Warning: Synchronization error - D:\File.MTS
1 image files updated
====================================================================================
DST is in effect, the local timezone is -04:00, FMD should be an hour more than DTM.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DST enabled on camcorder, FMD is accurate despite being several seconds off.
[System] FileModifyDate : 2018:09:05 16:54:13-04:00
[H264] DateTimeOriginal : 2018:09:05 15:54:07-05:00 DST
Copied DTM to FMD, FMD is now off by an hour.
[System] FileModifyDate : 2018:09:05 15:54:07-04:00
[H264] DateTimeOriginal : 2018:09:05 15:54:07-05:00 DST
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DST disabled on camcorder, FMD should be an hour more than DTM.
[System] FileModifyDate : 2012:10:24 15:27:35-04:00
[H264] DateTimeOriginal : 2012:10:24 15:27:22-05:00
Copied DTM to FMD, accurate FMD but received synchronization error.
[System] FileModifyDate : 2012:10:24 16:27:22-04:00
[H264] DateTimeOriginal : 2012:10:24 15:27:22-05:00
====================================================================================
====================================================================================
DST is not in effect, the local timezone is -05:00, FMD and DTM should match.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DST enabled on camcorder, FMD is accurate despite being several seconds off.
[System] FileModifyDate : 2019:01:05 15:44:26-05:00
[H264] DateTimeOriginal : 2019:01:05 15:44:20-05:00 DST
Copied DTM to FMD, FMD and DTM match
[System] FileModifyDate : 2019:01:05 15:44:20-05:00
[H264] DateTimeOriginal : 2019:01:05 15:44:20-05:00 DST
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DST disabled on camcorder, FMD is an hour less than DTM.
[System] FileModifyDate : 2012:11:05 19:17:03-05:00
[H264] DateTimeOriginal : 2012:11:05 20:10:22-05:00
Copied DTM to FMD, accurate FMD but received synchronization error.
[System] FileModifyDate : 2012:11:05 20:10:22-05:00
[H264] DateTimeOriginal : 2012:11:05 20:10:22-05:00
====================================================================================
The synchronization warning is an problem parsing the M2TS container. This may affect extraction of metadata from the M2TS file, but if you drop the -extractEmbedded you may not get this warning because ExifTool won't parse as far into the file. DateTimeOriginal should be extracted without -extractEmbedded.
About the DST problem: The "DST" in the time string was messing up the date/time parsing. I'll fix this in version 11.24. But until then you can do this:
exiftool "-filemodifydate<${DateTimeOriginal;s/ DST//}" -v "D:\File.MTS"
- Phil
That worked, thank you!
It appears an update on exiftool has changed the way this command works. Currently using 11.49.
When I copy over the datetimeoriginal to the filemodifydate using either of these commands it adds an hour to the filemodifydate even if the DST tag is there or not. This may have been due to the fix you said you mentioned in this post that you would implement in version 11.24. I hadn't updated in a while and caught this happening after I did. Correct time for both photos is what's in the datetimeoriginal.
exiftool "-filemodifydate<${DateTimeOriginal;s/ DST//}" -v "D:\File.MTS"
exiftool "-filemodifydate<datetimeoriginal" -v "D:\File.MTS"
C:\Users\Office>exiftool -g1 -a -s -FileModifyDate -DateTimeOriginal "D:\File_A.MTS"
---- System ----
FileModifyDate : 2019:06:11 11:36:44-04:00
---- H264 ----
DateTimeOriginal : 2019:06:11 11:36:41-05:00 DST
C:\Users\Office>exiftool -g1 -a -s -FileModifyDate -DateTimeOriginal "D:\File_B.MTS"
---- System ----
FileModifyDate : 2019:06:11 11:38:06-04:00
---- H264 ----
DateTimeOriginal : 2019:06:11 11:38:04-05:00
C:\Users\Office>exiftool "-filemodifydate<datetimeoriginal" -v "D:\File_A.MTS"
======== D:/Pictures/MTS Test/00055.MTS
Setting new values from D:/Pictures/MTS Test/00055.MTS
Warning: [minor] The ExtractEmbedded option may find more tags in the video data - "D:\File_A.MTS"
1 image files updated
C:\Users\Office>exiftool "-filemodifydate<datetimeoriginal" -v "D:\File_B.MTS"
======== D:/Pictures/MTS Test/00056.MTS
Setting new values from D:/Pictures/MTS Test/00056.MTS
Warning: [minor] The ExtractEmbedded option may find more tags in the video data - "D:\File_B.MTS"
1 image files updated
C:\Users\Office>exiftool -g1 -a -s -FileModifyDate -DateTimeOriginal "D:\File_A.MTS"
---- System ----
FileModifyDate : 2019:06:11 12:36:42-04:00
---- H264 ----
DateTimeOriginal : 2019:06:11 11:36:41-05:00 DST
C:\Users\Office>exiftool -g1 -a -s -FileModifyDate -DateTimeOriginal "D:\File_B.MTS"
---- System ----
FileModifyDate : 2019:06:11 12:38:04-04:00
---- H264 ----
DateTimeOriginal : 2019:06:11 11:38:04-05:00
If I run version 11.03 this is the behavior I see.
D:\Pictures\MTS Test>exiftool -ver
11.03
D:\Pictures\MTS Test>exiftool "-filemodifydate<datetimeoriginal" -v "D:\File_A.MTS"
======== D:/Pictures/MTS Test/00055.MTS
Setting new values from D:/Pictures/MTS Test/00055.MTS
Warning: [minor] The ExtractEmbedded option may find more tags in the video data - D:/Pictures/MTS Test/00055.MTS
1 image files updated
D:\Pictures\MTS Test>exiftool "-filemodifydate<datetimeoriginal" -v "D:\File_B.MTS"
======== D:/Pictures/MTS Test/00056.MTS
Setting new values from D:/Pictures/MTS Test/00056.MTS
Warning: [minor] The ExtractEmbedded option may find more tags in the video data - D:/Pictures/MTS Test/00056.MTS
1 image files updated
D:\Pictures\MTS Test>exiftool -g1 -a -s -FileModifyDate -DateTimeOriginal "D:\File_A.MTS"
---- System ----
FileModifyDate : 2019:06:11 11:36:42-04:00
---- H264 ----
DateTimeOriginal : 2019:06:11 11:36:41-05:00 DST
D:\Pictures\MTS Test>exiftool -g1 -a -s -FileModifyDate -DateTimeOriginal "D:\File_B.MTS"
---- System ----
FileModifyDate : 2019:06:11 12:38:04-04:00
---- H264 ----
DateTimeOriginal : 2019:06:11 11:38:04-05:00
D:\Pictures\MTS Test>exiftool -ext MTS -v "-filemodifydate<${DateTimeOriginal;s/ DST//}" "D:\File_A.MTS"
======== D:/Pictures/MTS Test/00055.MTS
Setting new values from D:/Pictures/MTS Test/00055.MTS
Warning: [minor] The ExtractEmbedded option may find more tags in the video data - D:/Pictures/MTS Test/00055.MTS
1 image files updated
D:\Pictures\MTS Test>exiftool -ext MTS -v "-filemodifydate<${DateTimeOriginal;s/ DST//}" "D:\File_B.MTS"
======== D:/Pictures/MTS Test/00056.MTS
Setting new values from D:/Pictures/MTS Test/00056.MTS
Warning: [minor] The ExtractEmbedded option may find more tags in the video data - D:/Pictures/MTS Test/00056.MTS
1 image files updated
D:\Pictures\MTS Test>exiftool -g1 -a -s -FileModifyDate -DateTimeOriginal "D:\File_A.MTS"
---- System ----
FileModifyDate : 2019:06:11 12:36:42-04:00
---- H264 ----
DateTimeOriginal : 2019:06:11 11:36:41-05:00 DST
D:\Pictures\MTS Test>exiftool -g1 -a -s -FileModifyDate -DateTimeOriginal "D:\File_B.MTS"
---- System ----
FileModifyDate : 2019:06:11 12:38:04-04:00
---- H264 ----
DateTimeOriginal : 2019:06:11 11:38:04-05:00
To recap, it appears to me now that I incorrectly surmised on my original post back in January that I need an hour offset when in fact whatever the datetimeoriginal is, is the correct time in which that file was taken with or without the DST tag on it or if DST is in effect or not. So what I'm requesting now is that DST be not taken into effect when I run the "-filemodifydate<datetimeoriginal" command.
Look at the time zone offset: if you take that into account, both date times are the same! The reason you see a difference is because in windows file times always get reported with the current daylight savings in effect. The behaviour of the newer exiftool seems correct to me.
Does this fully answer your question?
Quote from: Exifdude on June 11, 2019, 10:41:12 PM
It appears an update on exiftool has changed the way this command works. Currently using 11.49.
When I copy over the datetimeoriginal to the filemodifydate using either of these commands it adds an hour to the filemodifydate even if the DST tag is there or not.
I think it is more likely that the difference is because your system is now on daylight savings time.
- Phil
Quote from: Phil Harvey on June 12, 2019, 07:37:47 AM
I think it is more likely that the difference is because your system is now on daylight savings time.
Exactly:
QuoteThe reason you see a difference is because in windows file times always get reported with the current daylight savings in effect.