Closed jrasm91 closed 9 months ago
Thanks for this research. Is this video metadata directly from a smartphone, or was it edited?
If you could attach all date and time fields coming from exiftool for that file, or just attach the file itself, that might be helpful for me to replicate your table.
(Fwiw, I would have expected defaultVideosToUTC: false, backfillTimezones: true
to do what you wanted)
It's directly from the phone. In general, I don't think any of the videos from my pixel phones have timezone information in them.
Here's the file: File1.zip
Here's *Date*
properties:
jrasm91@jrasm91-ubuntu:Videos$ exiftool -*Date* File1.mp4
File Modification Date/Time : 2022:10:26 19:56:17-04:00
File Access Date/Time : 2023:09:13 13:22:13-04:00
File Inode Change Date/Time : 2023:09:13 13:21:46-04:00
Create Date : 2021:09:06 17:44:16
Modify Date : 2021:09:06 17:44:16
Track Create Date : 2021:09:06 17:44:16
Track Modify Date : 2021:09:06 17:44:16
Media Create Date : 2021:09:06 17:44:16
Media Modify Date : 2021:09:06 17:44:16
OK, I just checked the relevant code again, and these settings should indeed work.
Here's the validation spec:
Ah -- I misread your expectations: you want both the timezone to default to UTC, and the timestamps to be shoved to Phoenix. Gotcha.
Poking the code with a stick now.
Yeah, it's the combination of "don't mess up the timestamp because it is a video" and "please convert it from UTC to X using GPS"
Currently backfillTimezones
is conservative: it doesn't set the time zone for ExifDateTime instances that already "have a zone".
Unfortunately, there isn't a discriminator for those ExifDateTime instances that are UTC because of #defaultToUTC
, or because their raw value actually included a zone offset.
Edit: I just added the discriminator, so we can make this change safely now.
OK, I think this warrants a major release, as the output will be different for people using backfillTimezones
.
Pushed. I'll release as soon as GHA validates the tests pass. Details here:
https://github.com/photostructure/exiftool-vendored.js/blob/main/CHANGELOG.md#v2300
released v23.0.0 :tada:
Perfect! Thank you for working on this an the fast turn around time. I just wanted to confirm that I've tested against v23 and everything is working as expected. :pray:
It does not seem possible to get a correct
Create Date
with a GPS inferred timezone for a video that is using UTC.Example
File
Options
Results
defaultVideosToUTC
isfalse
, the timezone from GPS is correct, but the time is now wrong.defaultVideosToUTC
istrue
, the timezone is time is correct, but the GPS timezone is not used.Creation Date
with a timezone)Expected Value
When
defaultVideosToUTC
is used withbackfillTimezones
and GPS data is available, I expectedtz
to be populated from GPS (America/Phoenix
) andCreateDate
to be adjusted for said timezone (2021-09-06T10:44:16-07:00
).