How to obtain Original Create time and its offset on any photo

Started by b193709, April 09, 2022, 05:02:21 PM

Previous topic - Next topic

b193709

Hi all:

I'm working on a script that tries to set any kind of photo / video (from Mobile, DSLR, old DSLR, etc etc) from it's Create time data to UTC 0.

What I found is that ARW format stores on different place that CR2, than MP4, than MOV, etc etc.

is there any way of read the source time on which the video/photo was taken (the one that the camera has), and its timezone?.

All my cameras are correctly sync, but when I travel, I don't change the timezone, therefore I'm looking for having everything on UTC 0.

The problem is I have thousands of photos / Videos that I need to organize and the are not on UTC 0

Thanks


StarGeek

Quote from: b193709 on April 09, 2022, 05:02:21 PM
is there any way of read the source time on which the video/photo was taken (the one that the camera has), and its timezone?.

It really depends upon the camera.  Some newer phones will set the EXIF time zone tags (EXIF:OffsetTimeOriginal/EXIF:OffsetTimeDigitized/EXIF:OffsetTime).  Some DSLRs will keep trace of the time zone if it is properly set in the camera.  You can usually find these in the MakerNotes.  For example, my Nikon holds the time zone in Nikon:TimeZone.  But that has to be correctly manually set.  And then, you have to manually set the Nikon:DaylightSavings to Yes or No whenever Daylight savings starts/ends.

But otherwise, there's no way of knowing the time zone if the camera either doesn't have it properly set or doesn't even save it in the first place.  Unless you know where the image was taken and are able to geotag it correctly.  GPS timestamps are set to UTC and geotagging programs can usually set things correctly if the coordinates and time stamps are correct.

* 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).

b193709

Thanks for the response.

I have a track of GPX data for my position 24h, so I can obtain the timezone using it. The problem is that I need to know the timezone the camera has when it shoot. The objective is set all those photos/videos to UTC 0. I saw that for my Sony DSLR, I have EXIF:OffsetTimeOriginal, I.E. But on CR2 format I need to find another, MP4 from videocam another... It's complex.

I wonder if I asking for  timezone (%z) to exiftool on '-datetimeoriginal' on any format will it reply the timezone the camera uses when writes the file, but I'm not looking for the information of the metadata of the file system, but the one related to the photo/video creation.



StarGeek

Quote from: b193709 on April 10, 2022, 03:55:31 AM
I wonder if I asking for  timezone (%z) to exiftool on '-datetimeoriginal' on any format will it reply the timezone the camera uses when writes the file

Exiftool cannot magically create the timezone out of nothing.  As per note #3 under Common Date Format Codes, if the time zone does not already exist in the image, then %z will return the computer's time zone.

You can use this command to see all available date/time tags in the file.
exiftool -time:all -G1 -a -s file.jpg

If you have the GPS data, your best bet is to find a GPS program that can do the look up for you.
* 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).

b193709

Thanks.

Maybe I have a concept issue here. AFAIK, all devices knows its timezone. I don't mean that this is the real one, but the one that is configured (manually) on each one. I.E > my video cam. my DSLR, etc.. all of them allows to set time and timezone. In my case, all are set to UTC 0 and time is correct.

Now, I suppose that all devices are able to add the timezone they have configured when the shot the photo, right?. Why is this important?, because it changes the time and when I try to sync with other devices that "knows" via GPS where are they, times for 2 instant photos are different (I.E.. from my mobile and from my DSLR).

I have ways to know the real timezone when I shot, but I need to extract the timezone/offset  that the camera had configured in  order to be able to set UTC 0 (if they are not already, because my fault), and then appy the correct timezone / offset time.

The original question was... if there is a unified way to know this (the configured camera one) timezone / offset, instead of multiple different ways based on each camera / photo raw format.

Thanks

StarGeek

Quote from: b193709 on April 10, 2022, 12:09:10 PMThe original question was... if there is a unified way to know this (the configured camera one) timezone / offset, instead of multiple different ways based on each camera / photo raw format.

No.  Different cameras and different file formats save data differently.  The command I give above will show you the locations of all time related data in the file and you'll have to proceed from there.
* 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

I don't know if this is helpful to you but the way I approach it is for a script to refer to an adjustment file for the timezone offset.  For example, for a trip to South Africa, I had

photofilename   actual  datetimeoriginal
default         2       2
ft30_0821.jpg   2       1:10   
ft30_0826.jpg   2       1:10
ft30_0827.jpg   2       1:10
fz18_0040.jpg   2       -11:8:42

which shows the actual time zone and the time zone of exif:datetimeoriginal

I like to put my cameras to local time but, as can been seen above, my wife's camera was not quite correct.  And not all my cameras actually store the time zone anywhere in the photo metadata.  But two do, but in different formats.

The logic of using this is essentially:

if the photo is explicity named, use these values
otherwise use exif:offsettimeoriginal
otherwise use the nikon makernotes values
otherwise use the default value from the adjustment file

I then insert xmp:datetimeoriginal which allows for an offset and use that when matching against my gps logs.







b193709

Ok thanks for all your responses.

I end of creating a script that recognizes on each case what to do. I dump all exiftool output on an array and then I create many cases for each kind of photo/video case.