Time shift when copying timestamp

Started by twoj, May 13, 2021, 11:06:48 PM

Previous topic - Next topic

twoj

I'm seeing an odd issue, i have taken my original mts video file and converted it to an mp4, when i copy the timestamp from the mts to the mp4 it seems to shift the time.
Here is the original;

exiftool -DateTimeOriginal 20170716182638_FR-59.94i_AF-AC3.mts
Date/Time Original              : 2017:07:16 18:26:38-05:00

then the command;
exiftool -TagsFromFile 20170716182638_FR-59.94i_AF-AC3.mts "-FileCreateDate<DateTimeOriginal" 20170716182638_FR-59.94i_AF-AC3.mp4

and the result
exiftool 20170716182638_FR-59.94i_AF-AC3.mp4 -a -G1 -time:all
[System]        File Modification Date/Time     : 2017:07:16 19:26:38-04:00
[System]        File Access Date/Time           : 2017:07:16 19:26:38-04:00
[System]        File Creation Date/Time         : 2017:07:16 19:26:38-04:00

There are 2 issues here;
1 - I am in ET, and i'm pretty sure the camcorder was set properly for timezone so why would the file say 18:26:38-05:00 on July 16th which would be EDT, which should be UTC-4?

2 - Why is exiftool not writing the exact value of Date/Time Original              : 2017:07:16 18:26:38-05:00, to the FileCreateDate? Is it because it is writing to my current Windows time zone (ET) and it recognizes that for that date, July 16, 2017 that it was EDT, so UTC-4 and not 5 as indicated in the DateTimeOriginal, so it adjusts the time?

thanks


StarGeek

The FileCreateDate and FileModifyDate are controlled by the underlying OS and will always be shown in your local time.  2017:07:16 18:26:38-05:00 and 2017:07:16 19:26:38-04:00 is the exact same time, just in two different time zones.  When you assign 2017:07:16 18:26:38-05:00 to the file system timestamp, the OS will automatically adjust it to your local time zone.  If I use the same command on my computer, which is in the -07:00 timezone, the result is 2017:07:16 16:26:38-07:00.

Quote from: twoj on May 13, 2021, 11:06:48 PM
1 - I am in ET, and i'm pretty sure the camcorder was set properly for timezone so why would the file say 18:26:38-05:00 on July 16th which would be EDT, which should be UTC-4?
I cannot answer as to why the camera would do that.  You'll have to check the camera's settings to see what data it will write during DST.

If you want to copy the DateTimeOriginal base value to the FileCreateDate, you'll need to tell exiftool to drop the time zone.  Something like this
exiftool -d "%Y:%m:%d %H:%M:%S" -TagsFromFile 20170716182638_FR-59.94i_AF-AC3.mts "-FileCreateDate<DateTimeOriginal" 20170716182638_FR-59.94i_AF-AC3.mp4

or if you want to do it in batch
exiftool -ext mp4 -d "%Y:%m:%d %H:%M:%S" -TagsFromFile %d%f.mts "-FileCreateDate<DateTimeOriginal" /path/to/files/

Of course, if the FileCreateDate on the original mts file is correct, you could always just copy that
exiftool -TagsFromFile 20170716182638_FR-59.94i_AF-AC3.mts -FileCreateDate 20170716182638_FR-59.94i_AF-AC3.mp4
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

twoj

I have been forensically picking away at this and i think i understand a bit more;

I must have incorrectly set the videocamera to turn on DST in the winter and then turned it off in the change for Spring;
The video camera has a wierd way of recording it; ie;
DateTimeOriginal: 2012:12:14 09:42:56-05:00 DST     [DST should not be on for this date]
DateTimeOriginal: 2013:06:20 19:30:57-05:00            [DST should be on for this date]

Because this is MTS there is no way to correct this, this is one of the reason why i am converting it to MP4

I have figured out to record the Create Date
exiftool -TagsFromFile Src -DateCreated<DateTimeOriginal Dest

My question now is that i notice that some Manufactures put tags for Time Zone and Daylight Saving Time (DST) in the maker notes,
Is there equivalent xmp tags for these?

Now that i've gone through all this trouble i want to make sure that I properly record which mp4s were recorded in which time zone and if DST was on or not.

thanks again!

StarGeek

Quote from: twoj on May 16, 2021, 03:50:15 PM
I must have incorrectly set the videocamera to turn on DST in the winter and then turned it off in the change for Spring;

Welcome to the club!  ;)

QuoteMy question now is that i notice that some Manufactures put tags for Time Zone and Daylight Saving Time (DST) in the maker notes,
Is there equivalent xmp tags for these?

There isn't a separate tag for those.  The time zone can be included as part of the XMP tag.  See the first example under FAQ #5.  As for DST, you'll have to include it in some other place.  Most of MakerNotes tags don't have a equivalent XMP tag.

QuoteNow that i've gone through all this trouble i want to make sure that I properly record which mp4s were recorded in which time zone and if DST was on or not.

You'll have to include the value in some other tag like Description or repurpose an rarely used tag.  I tend to use HierarchicalSubject for things like this.  This can work out really well if you use a Digital Asset Manager (DAM) that works with hierarchical keywords.  At the simplest level, you could set up something like
Daylight Savings
├───On
├───Off


Or more complex like I do
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

twoj

QuoteYou'll have to include the value in some other tag like Description or repurpose an rarely used tag.

I'm already using the Description field - I'll hunt around for a tag that makes sense.

QuoteThis can work out really well if you use a Digital Asset Manager (DAM) that works with hierarchical keywords.

Which DAM are you using?

StarGeek

That image is from IMatch.  It's pricey, but very powerful when it comes to dealing with metadata and it uses exiftool on the back end.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Alan Clifford

QuoteI'm already using the Description field - I'll hunt around for a tag that makes sense.

In all my photographs I put in an xmp:datetimeoriginal as this takes a timezone.  xmp seems to be the most universal set of tag systems.  Once you have this in all your photos and videos, it is there in a stardard palce and you can use it for reference if you need to update any other tag to make various applications happy.

I like to have my cameras set to local time as this makes the most sense to me when comparing the time to the contents of the photo but need timezone information to add gps data.

twoj

QuoteIn all my photographs I put in an xmp:datetimeoriginal as this takes a timezone.

While I agree that a tag with a timezone is better than one without, there is still some ambiguity of what timezone it is depending on DST.
Unless you have location information which can tell you if the media was taken in a location that follows DST or not.

So many of these tags are half-measures, i wish they could have just have designed a proper structure/set from the start.
Anyways i like the idea - i will investigate if I can implement it as well.

thanks

StarGeek

Quote from: twoj on May 17, 2021, 08:06:49 PMSo many of these tags are half-measures, i wish they could have just have designed a proper structure/set from the start.

And my answer to that is always


For further fun, you can read Phil's Problems with current Metadata Standards and Writing Meta Information pages.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

twoj

 :D
Yup - my favorite is: The great thing about Standards is there are so many good ones to choose from!

Ok - I did find another issue which is causing my issues with the timestamps;
As i mentioned these are mts files from a Canon Videocamera, they have almost no metadata and the one they do have is the DateTimeOriginal such as;

[H264]          Date/Time Original              : 2019:07:03 10:21:01+01:00 DST

You can see that the DST is a suffix on the DateTimeOriginal, it seems that Exiftool ignores this DST when it copies this value
In this case the video was taken in CEST (UTC+2), but Exiftool copies it as BST (UTC+1)

I wonder if Phil can weigh in on this, if this could be corrected or not?

StarGeek

Try using this in place of DateTimeOriginal
${DateTimeOriginal;s/\+01:00/+02:00/ if m/DST/}

If "DST" exists in the DateTimeOriginal, then replace +01:00 with +02:00

Hardcoded and not flexible for usage by everyone, but it should get the job done in your case.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).